クラス Onikiri::OpArray

#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< IDm_freeList

構成

class  ArrayID


説明

OpArray.h44 行で定義されています。


型定義

typedef int Onikiri::OpArray::ID

OpArray.h47 行で定義されています。


コンストラクタとデストラクタ

OpArray::OpArray ( int  capacity  ) 

OpArray.cpp48 行で定義されています。

参照先 m_alivem_bodym_capacitym_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.cpp73 行で定義されています。

参照先 m_bodym_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]

OpArray.h100 行で定義されています。

参照先 THROW_RUNTIME_ERROR.

00101         {
00102             THROW_RUNTIME_ERROR("cannot create OpArray copy");
00103         };


関数

OpIterator OpArray::CreateOp (  ) 

OpArray.cpp81 行で定義されています。

参照先 ASSERTIsAlive()IsFull()m_alivem_bodym_freeListTHROW_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]

OpArray.h142 行で定義されています。

参照先 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]

OpArray.h137 行で定義されています。

参照先 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]

OpArray.h115 行で定義されています。

参照先 ASSERTm_alivem_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.cpp118 行で定義されています。

参照先 Onikiri::OpIterator::GetID().

参照元 CreateOp()Onikiri::OpIterator::IsAlive()ReleaseOp().

00119 {
00120     return IsAlive( opIterator.GetID() ); 
00121 }

関数の呼び出しグラフ:

Here is the caller graph for this function:

bool Onikiri::OpArray::IsEmpty (  )  const [inline]

OpArray.h132 行で定義されています。

参照先 GetSize().

00133         {
00134             return GetSize() == 0;
00135         }

関数の呼び出しグラフ:

bool Onikiri::OpArray::IsFull (  )  const [inline]

OpArray.h127 行で定義されています。

参照先 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.cpp104 行で定義されています。

参照先 ASSERTOnikiri::OpIterator::GetID()IsAlive()m_alivem_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]

OpArray.h154 行で定義されています。

参照元 CreateOp()IsAlive()OpArray()ReleaseOp().

std::vector<OpArray::ArrayID*> Onikiri::OpArray::m_body [protected]

OpArray.h150 行で定義されています。

参照元 CreateOp()OpArray()~OpArray().

int Onikiri::OpArray::m_capacity [protected]

OpArray.h160 行で定義されています。

参照元 GetCapacity()IsAlive()OpArray()~OpArray().

pool_vector<ID> Onikiri::OpArray::m_freeList [protected]

OpArray.h157 行で定義されています。

参照元 CreateOp()GetSize()IsFull()OpArray()ReleaseOp().


このクラスの説明は次のファイルから生成されました:
Onikiri2に対してTue Jun 18 15:06:21 2013に生成されました。  doxygen 1.4.7