src/Sim/Op/OpContainer/OpBuffer.h

説明を見る。
00001 // 
00002 // Copyright (c) 2005-2008 Kenichi Watanabe.
00003 // Copyright (c) 2005-2008 Yasuhiro Watari.
00004 // Copyright (c) 2005-2008 Hironori Ichibayashi.
00005 // Copyright (c) 2008-2009 Kazuo Horio.
00006 // Copyright (c) 2009-2013 Naruki Kurata.
00007 // Copyright (c) 2005-2013 Ryota Shioya.
00008 // Copyright (c) 2005-2013 Masahiro Goshima.
00009 // 
00010 // This software is provided 'as-is', without any express or implied
00011 // warranty. In no event will the authors be held liable for any damages
00012 // arising from the use of this software.
00013 // 
00014 // Permission is granted to anyone to use this software for any purpose,
00015 // including commercial applications, and to alter it and redistribute it
00016 // freely, subject to the following restrictions:
00017 // 
00018 // 1. The origin of this software must not be misrepresented; you must not
00019 // claim that you wrote the original software. If you use this software
00020 // in a product, an acknowledgment in the product documentation would be
00021 // appreciated but is not required.
00022 // 
00023 // 2. Altered source versions must be plainly marked as such, and must not be
00024 // misrepresented as being the original software.
00025 // 
00026 // 3. This notice may not be removed or altered from any source
00027 // distribution.
00028 // 
00029 // 
00030 
00031 
00032 #ifndef __OP_BUFFER_H__
00033 #define __OP_BUFFER_H__
00034 
00035 #include "Sim/Op/OpContainer/OpList.h"
00036 #include "Sim/Foundation/TimeWheel/ClockedResourceBase.h"
00037 #include "Sim/Dumper/Dumper.h"
00038 
00039 namespace Onikiri 
00040 {
00041     class OpBuffer : 
00042         protected OpList,
00043         public ClockedResourceBase
00044     {
00045     protected:
00046         void CheckAndDumpStallBegin( OpIterator op )
00047         {
00048             if( IsStalledThisCycle() )
00049                 g_dumper.DumpStallBegin( op );
00050         }
00051 
00052 
00053     public:
00054 
00055         typedef OpList::iterator iterator;
00056 
00057         OpBuffer();
00058         OpBuffer( const OpArray& opArray );
00059         virtual ~OpBuffer();
00060 
00061         // Dump stall information of containing ops.
00062         virtual void BeginStall();
00063         virtual void EndStall();
00064 
00065         // --- OpList
00066         // Note: These methods are not virtual.
00067         void resize(const OpArray& opArray)
00068         {
00069             OpList::resize( opArray );
00070         }
00071 
00072         void resize( int capacity )
00073         {
00074             OpList::resize( capacity );
00075         }
00076 
00077         size_t size() const
00078         {
00079             return OpList::size();
00080         }
00081         size_t count( const OpIterator& op ) const
00082         {
00083             return OpList::count( op );
00084         }
00085 
00086         bool find_and_erase( OpIterator op )
00087         {
00088             return OpList::find_and_erase( op );
00089         }
00090 
00091         iterator insert( iterator pos, const OpIterator& op )
00092         {
00093             CheckAndDumpStallBegin( op );
00094             return OpList::insert( pos, op );
00095         }
00096 
00097         void push_inorder( OpIterator op )
00098         {
00099             CheckAndDumpStallBegin( op );
00100             OpList::push_inorder( op );
00101         }
00102 
00103         void push_front( const OpIterator& op )
00104         {
00105             CheckAndDumpStallBegin( op );
00106             OpList::push_front( op );
00107         }
00108 
00109         void push_back( const OpIterator& op )
00110         {
00111             CheckAndDumpStallBegin( op );
00112             OpList::push_back( op );
00113         }
00114 
00115         iterator begin()
00116         {
00117             return OpList::begin();
00118         }
00119 
00120         iterator end()
00121         {
00122             return OpList::end();
00123         }
00124     };
00125 }; // namespace Onikiri
00126 
00127 #endif // __OpHASHLIST_H__
00128 

Onikiri2に対してTue Jun 18 14:34:24 2013に生成されました。  doxygen 1.4.7