Open CASCADE Technology  7.5.0
Data Structures
NCollection_BaseVector Class Reference

Class NCollection_BaseVector - base for NCollection_Vector template. More...

#include <NCollection_BaseVector.hxx>

Inheritance diagram for NCollection_BaseVector:
Inheritance graph
[legend]

Data Structures

class  Iterator
 Base class for Iterator implementation. More...
 
struct  MemBlock
 Memory allocation. More...
 

Public Member Functions

public API
void Clear ()
 Empty the vector of its objects. More...
 
void SetIncrement (const Standard_Integer aIncrement)
 Empty the vector of its objects. More...
 
const Handle< NCollection_BaseAllocator > & Allocator () const
 Returns attached allocator. More...
 

Protected Member Functions

protected methods
 NCollection_BaseVector (const Handle< NCollection_BaseAllocator > &theAllocator, initMemBlocks_t theInitBlocks, const size_t theSize, const Standard_Integer theInc)
 Empty constructor. More...
 
 NCollection_BaseVector (const Handle< NCollection_BaseAllocator > &theAllocator, initMemBlocks_t theInitBlocks, const NCollection_BaseVector &theOther)
 Copy constructor. More...
 
virtual ~NCollection_BaseVector ()
 Destructor. More...
 
void * expandV (const Standard_Integer theIndex)
 
void * findV (const Standard_Integer theIndex) const
 Locate the memory holding the desired value. More...
 

Block initializer

typedef void(* initMemBlocks_t) (NCollection_BaseVector &theVector, MemBlock &theBlock, const Standard_Integer theFirst, const Standard_Integer theSize)
 Allocate memory for array of memory blocks. More...
 
MemBlockallocMemBlocks (const Standard_Integer theCapacity, MemBlock *theSource=NULL, const Standard_Integer theSourceSize=0)
 Allocate memory for array of memory blocks. More...
 

Protected fields

Handle< NCollection_BaseAllocatormyAllocator
 
size_t myItemSize
 
Standard_Integer myIncrement
 
Standard_Integer myLength
 
Standard_Integer myCapacity
 
Standard_Integer myNBlocks
 
MemBlockmyData
 
initMemBlocks_t myInitBlocks
 

Detailed Description

Class NCollection_BaseVector - base for NCollection_Vector template.

Member Typedef Documentation

◆ initMemBlocks_t

typedef void(* NCollection_BaseVector::initMemBlocks_t) (NCollection_BaseVector &theVector, MemBlock &theBlock, const Standard_Integer theFirst, const Standard_Integer theSize)
protected

Allocate memory for array of memory blocks.

Parameters
theCapacityNumber of memory blocks in array
theSourceOriginal array of memory blocks, will be automatically deallocated
theSourceSizeNumber of memory blocks in original array

Constructor & Destructor Documentation

◆ NCollection_BaseVector() [1/2]

NCollection_BaseVector::NCollection_BaseVector ( const Handle< NCollection_BaseAllocator > &  theAllocator,
initMemBlocks_t  theInitBlocks,
const size_t  theSize,
const Standard_Integer  theInc 
)
inlineprotected

Empty constructor.

◆ NCollection_BaseVector() [2/2]

NCollection_BaseVector::NCollection_BaseVector ( const Handle< NCollection_BaseAllocator > &  theAllocator,
initMemBlocks_t  theInitBlocks,
const NCollection_BaseVector theOther 
)
inlineprotected

Copy constructor.

◆ ~NCollection_BaseVector()

virtual NCollection_BaseVector::~NCollection_BaseVector ( )
inlineprotectedvirtual

Destructor.

Member Function Documentation

◆ Allocator()

const Handle< NCollection_BaseAllocator >& NCollection_BaseVector::Allocator ( ) const
inline

Returns attached allocator.

◆ allocMemBlocks()

MemBlock* NCollection_BaseVector::allocMemBlocks ( const Standard_Integer  theCapacity,
MemBlock theSource = NULL,
const Standard_Integer  theSourceSize = 0 
)
protected

Allocate memory for array of memory blocks.

Parameters
theCapacityNumber of memory blocks in array
theSourceOriginal array of memory blocks, will be automatically deallocated
theSourceSizeNumber of memory blocks in original array

◆ Clear()

void NCollection_BaseVector::Clear ( )

Empty the vector of its objects.

◆ expandV()

void* NCollection_BaseVector::expandV ( const Standard_Integer  theIndex)
protected
Returns
pointer to memory where to put the new item

◆ findV()

void* NCollection_BaseVector::findV ( const Standard_Integer  theIndex) const
inlineprotected

Locate the memory holding the desired value.

◆ SetIncrement()

void NCollection_BaseVector::SetIncrement ( const Standard_Integer  aIncrement)
inline

Empty the vector of its objects.

Field Documentation

◆ myAllocator

Handle< NCollection_BaseAllocator > NCollection_BaseVector::myAllocator
protected

◆ myCapacity

Standard_Integer NCollection_BaseVector::myCapacity
protected

◆ myData

MemBlock* NCollection_BaseVector::myData
protected

◆ myIncrement

Standard_Integer NCollection_BaseVector::myIncrement
protected

◆ myInitBlocks

initMemBlocks_t NCollection_BaseVector::myInitBlocks
protected

◆ myItemSize

size_t NCollection_BaseVector::myItemSize
protected

◆ myLength

Standard_Integer NCollection_BaseVector::myLength
protected

◆ myNBlocks

Standard_Integer NCollection_BaseVector::myNBlocks
protected

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