COPASI API  4.16.103
Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
CMath::CAllocationStack Class Reference

#include <CMathEnum.h>

Collaboration diagram for CMath::CAllocationStack:
Collaboration graph
[legend]

Classes

class  CAllocation
 

Public Types

typedef std::vector< StackElementBuffer
 
enum  Context { Variable, Body }
 
typedef std::vector< CAllocationStackElement
 

Public Member Functions

 CAllocationStack (Buffer &stack)
 
 CAllocationStack (const CAllocationStack &src)
 
const CAllocationoperator[] (const size_t &index) const
 
void pop ()
 
void push (const StackElement &stackElement)
 
size_t size () const
 
 ~CAllocationStack ()
 

Private Member Functions

 CAllocationStack ()
 

Private Attributes

size_t mBodyLevel
 
Context mContext
 
BuffermpStack
 
size_t mVariableLevel
 

Detailed Description

Definition at line 268 of file CMathEnum.h.

Member Typedef Documentation

Definition at line 294 of file CMathEnum.h.

Definition at line 293 of file CMathEnum.h.

Member Enumeration Documentation

Enumerator
Variable 
Body 

Definition at line 296 of file CMathEnum.h.

Constructor & Destructor Documentation

CMath::CAllocationStack::CAllocationStack ( )
private

Definition at line 136 of file CMathEnum.cpp.

136  :
137  mpStack(NULL),
138  mContext(Body),
141 {}
#define C_INVALID_INDEX
Definition: copasi.h:222
CMath::CAllocationStack::CAllocationStack ( Buffer stack)

Definition at line 143 of file CMathEnum.cpp.

143  :
144  mpStack(&stack),
145  mContext(Body),
148 {}
#define C_INVALID_INDEX
Definition: copasi.h:222
CMath::CAllocationStack::CAllocationStack ( const CAllocationStack src)

Definition at line 150 of file CMathEnum.cpp.

150  :
151  mpStack(src.mpStack),
152  mContext(src.mContext),
153  mVariableLevel(src.mVariableLevel),
154  mBodyLevel(src.mBodyLevel)
155 {}
CMath::CAllocationStack::~CAllocationStack ( )

Definition at line 157 of file CMathEnum.cpp.

158 {}

Member Function Documentation

const CMath::CAllocationStack::CAllocation & CMath::CAllocationStack::operator[] ( const size_t &  index) const

Definition at line 178 of file CMathEnum.cpp.

References C_INVALID_INDEX.

179 {
180  size_t Level = C_INVALID_INDEX;
181 
182  switch (mContext)
183  {
184  case Variable:
185  Level = mVariableLevel;
186  break;
187 
188  case Body:
189  Level = mBodyLevel;
190 
191  break;
192  }
193 
194  assert(Level < mpStack->size());
195  assert(index < mpStack->at(Level).size());
196 
197  return mpStack->at(Level)[index];
198 }
#define C_INVALID_INDEX
Definition: copasi.h:222
size_t size() const
Definition: CMathEnum.cpp:172
void CMath::CAllocationStack::pop ( )

Definition at line 166 of file CMathEnum.cpp.

167 {
168  mpStack->pop_back();
169  mBodyLevel--;
170 }
void CMath::CAllocationStack::push ( const StackElement stackElement)

Definition at line 160 of file CMathEnum.cpp.

161 {
162  mpStack->push_back(stackElement);
163  mBodyLevel++;
164 }
size_t CMath::CAllocationStack::size ( ) const

Definition at line 172 of file CMathEnum.cpp.

173 {
174  return mpStack->size();
175 }

Member Data Documentation

size_t CMath::CAllocationStack::mBodyLevel
private

Definition at line 328 of file CMathEnum.h.

Context CMath::CAllocationStack::mContext
private

Definition at line 324 of file CMathEnum.h.

Buffer* CMath::CAllocationStack::mpStack
private

Definition at line 321 of file CMathEnum.h.

size_t CMath::CAllocationStack::mVariableLevel
private

Definition at line 326 of file CMathEnum.h.


The documentation for this class was generated from the following files: