Open CASCADE Technology  6.8.0
Public Member Functions | Data Fields | Protected Attributes
BOPCol_MemBlock< Type > Class Template Reference

#include <BOPCol_Array1.hxx>

Public Member Functions

 BOPCol_MemBlock (const Handle< NCollection_BaseAllocator > &theAllocator)
 
 ~BOPCol_MemBlock ()
 
void Clear ()
 
void Allocate (const Standard_Size theSize)
 
void SetRange (const Standard_Integer theI1, const Standard_Integer theI2)
 
void Range (Standard_Integer &theI1, Standard_Integer &theI2) const
 
Standard_Boolean Contains (const Standard_Integer theIndex) const
 
void SetValue (const Standard_Integer theIndex, const Type &theValue)
 
const Type & Value (const Standard_Integer theIndex) const
 
Type & ChangeValue (const Standard_Integer theIndex)
 
void SetNext (BOPCol_MemBlock< Type > *pNext)
 
BOPCol_MemBlock< Type > * Next ()
 

Data Fields

BOPCol_MemBlock< Type > * myNext
 

Protected Attributes

Standard_Integer myI1
 
Standard_Integer myI2
 
Standard_Size mySize
 
Type * myData
 
Handle< NCollection_BaseAllocatormyAllocator
 

Detailed Description

template<class Type>
class BOPCol_MemBlock< Type >

Class BOPCol_Array1 (dynamic array of objects)

  1. The Array1 uses the allocator (in terms of NCollection_BaseAllocator) to allocate the memory.
  2. The memory is allocated as a list of memory blocks. The size of the first block is myStartSize. The size of the other blocks is myIncrement 3 The Array1 is created with 0 length.
  3. The Array1 must be initiated by invoke the method Init(). Init() allocates the memory block for initial myStartSize elements.
  4. The elements can be added by the method Append(theElement). the method Append(theElement) arranges theElement in a) previously allocated memory block (if it is possible) b) new allocated memory block (otherwise). The size of new blocks to allocate can be set [once only] by the method SetIncrement(theSize).
  5. The contents of the element with index "i" can be queried or modified by the methods SetValue(i, theElement), Value(i), ChangeValue(i), operator()(i)

Constructor & Destructor Documentation

template<class Type>
BOPCol_MemBlock< Type >::BOPCol_MemBlock ( const Handle< NCollection_BaseAllocator > &  theAllocator)
inline
template<class Type>
BOPCol_MemBlock< Type >::~BOPCol_MemBlock ( )
inline

Member Function Documentation

template<class Type>
void BOPCol_MemBlock< Type >::Allocate ( const Standard_Size  theSize)
inline
template<class Type>
Type& BOPCol_MemBlock< Type >::ChangeValue ( const Standard_Integer  theIndex)
inline
template<class Type>
void BOPCol_MemBlock< Type >::Clear ( )
inline
template<class Type>
Standard_Boolean BOPCol_MemBlock< Type >::Contains ( const Standard_Integer  theIndex) const
inline
template<class Type>
BOPCol_MemBlock<Type>* BOPCol_MemBlock< Type >::Next ( void  )
inline
template<class Type>
void BOPCol_MemBlock< Type >::Range ( Standard_Integer theI1,
Standard_Integer theI2 
) const
inline
template<class Type>
void BOPCol_MemBlock< Type >::SetNext ( BOPCol_MemBlock< Type > *  pNext)
inline
template<class Type>
void BOPCol_MemBlock< Type >::SetRange ( const Standard_Integer  theI1,
const Standard_Integer  theI2 
)
inline
template<class Type>
void BOPCol_MemBlock< Type >::SetValue ( const Standard_Integer  theIndex,
const Type &  theValue 
)
inline
template<class Type>
const Type& BOPCol_MemBlock< Type >::Value ( const Standard_Integer  theIndex) const
inline

Field Documentation

template<class Type>
Handle< NCollection_BaseAllocator > BOPCol_MemBlock< Type >::myAllocator
protected
template<class Type>
Type* BOPCol_MemBlock< Type >::myData
protected
template<class Type>
Standard_Integer BOPCol_MemBlock< Type >::myI1
protected
template<class Type>
Standard_Integer BOPCol_MemBlock< Type >::myI2
protected
template<class Type>
BOPCol_MemBlock<Type>* BOPCol_MemBlock< Type >::myNext
template<class Type>
Standard_Size BOPCol_MemBlock< Type >::mySize
protected

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