#include <OpArray.h>
Public 型 | |
typedef int | ID |
Public メソッド | |
OpIterator | CreateOp () |
int | GetCapacity () const |
int | GetSize () const |
bool | IsAlive (ID id) const |
bool | IsAlive (const OpIterator &opIterator) const |
bool | IsEmpty () const |
bool | IsFull () const |
OpArray (const OpArray &opArray) | |
OpArray (int capacity) | |
void | ReleaseAll (const OpIterator &opIterator) |
void | ReleaseOp (const OpIterator &opIterator) |
virtual | ~OpArray () |
Protected 変数 | |
boost::dynamic_bitset | m_alive |
std::vector< OpArray::ArrayID * > | m_body |
int | m_capacity |
pool_vector< ID > | m_freeList |
構成 | |
class | ArrayID |
typedef int Onikiri::OpArray::ID |
OpArray::OpArray | ( | int | capacity | ) |
OpArray.cpp の 48 行で定義されています。
参照先 m_alive・m_body・m_capacity・m_freeList.
00048 : 00049 m_capacity(capacity) 00050 { 00051 // Op m 00052 for(int k = 0; k < m_capacity; ++k) { 00053 // ArrayID (_Op0) 00054 ArrayID* arrayID = new ArrayID(0, this, k); 00055 // arrayID p op 00056 Op* op = new Op( OpIterator(arrayID) ); 00057 // arrayID op Zbg 00058 arrayID->SetOp(op); 00059 00060 m_body.push_back(arrayID); 00061 } 00062 00063 // gptO 00064 m_alive.resize(m_capacity, false); 00065 00066 // free list 00067 m_freeList.reserve(m_capacity); 00068 for(int k = 0; k < m_capacity; ++k) { 00069 m_freeList.push_back(k); 00070 } 00071 }
OpArray::~OpArray | ( | ) | [virtual] |
OpArray.cpp の 73 行で定義されています。
参照先 m_body・m_capacity.
00074 { 00075 for(int k = 0; k < m_capacity; ++k) { 00076 delete m_body[k]; 00077 } 00078 m_body.clear(); 00079 }
Onikiri::OpArray::OpArray | ( | const OpArray & | opArray | ) | [inline] |
OpIterator OpArray::CreateOp | ( | ) |
OpArray.cpp の 81 行で定義されています。
参照先 ASSERT・IsAlive()・IsFull()・m_alive・m_body・m_freeList・THROW_RUNTIME_ERROR.
参照元 Onikiri::InorderList::ConstructOp().
00082 { 00083 if( IsFull() ) { 00084 THROW_RUNTIME_ERROR("OpArray is full.(increase Core/@OpArrayCapacity)"); 00085 } 00086 // free list 00087 ID id = m_freeList.back(); 00088 00089 // free list pop 00090 m_freeList.pop_back(); 00091 00092 // gptO 00093 ASSERT( 00094 !IsAlive(id), 00095 "alive id reused.(id = %d)", 00096 id 00097 ); 00098 m_alive[id] = true; 00099 00100 // idIWiOpIterator 00101 return OpIterator(m_body[id]); 00102 }
関数の呼び出しグラフ:
Here is the caller graph for this function:
int Onikiri::OpArray::GetCapacity | ( | ) | const [inline] |
参照先 m_capacity.
参照元 GetSize()・Onikiri::OpList::resize()・Onikiri::OpExtraStateTable< Onikiri::VisualizationDumper::OpState >::Resize().
00143 { 00144 return m_capacity; 00145 }
Here is the caller graph for this function:
int Onikiri::OpArray::GetSize | ( | ) | const [inline] |
参照先 GetCapacity()・m_freeList.
参照元 IsEmpty().
00138 { 00139 return GetCapacity() - static_cast<int>(m_freeList.size()); 00140 }
関数の呼び出しグラフ:
Here is the caller graph for this function:
bool Onikiri::OpArray::IsAlive | ( | ID | id | ) | const [inline] |
参照先 ASSERT・m_alive・m_capacity.
00116 { 00117 ASSERT( 00118 id >= 0 && id < m_capacity, 00119 "id range error(id = %d, capacity = %d)", 00120 id, 00121 m_capacity 00122 ); 00123 00124 return m_alive[id]; 00125 }
bool OpArray::IsAlive | ( | const OpIterator & | opIterator | ) | const |
OpArray.cpp の 118 行で定義されています。
参照先 Onikiri::OpIterator::GetID().
参照元 CreateOp()・Onikiri::OpIterator::IsAlive()・ReleaseOp().
関数の呼び出しグラフ:
Here is the caller graph for this function:
bool Onikiri::OpArray::IsEmpty | ( | ) | const [inline] |
bool Onikiri::OpArray::IsFull | ( | ) | const [inline] |
参照先 m_freeList.
参照元 CreateOp().
00128 { 00129 return m_freeList.size() == 0; 00130 }
Here is the caller graph for this function:
void Onikiri::OpArray::ReleaseAll | ( | const OpIterator & | opIterator | ) |
void OpArray::ReleaseOp | ( | const OpIterator & | opIterator | ) |
OpArray.cpp の 104 行で定義されています。
参照先 ASSERT・Onikiri::OpIterator::GetID()・IsAlive()・m_alive・m_freeList.
参照元 Onikiri::InorderList::DestroyOp().
00105 { 00106 ID id = opIterator.GetID(); 00107 00108 ASSERT( 00109 IsAlive(opIterator), 00110 "not alive op released.(id = %d)", 00111 id 00112 ); 00113 // tO 00114 m_alive[id] = false; 00115 m_freeList.push_back(id); 00116 }
関数の呼び出しグラフ:
Here is the caller graph for this function:
boost::dynamic_bitset Onikiri::OpArray::m_alive [protected] |
std::vector<OpArray::ArrayID*> Onikiri::OpArray::m_body [protected] |
int Onikiri::OpArray::m_capacity [protected] |
pool_vector<ID> Onikiri::OpArray::m_freeList [protected] |