Open CASCADE Technology  7.6.0
Data Structures | Protected Member Functions | Protected Attributes

NCollection_SparseArrayBase Class Referenceabstract

#include <NCollection_SparseArrayBase.hxx>

Inheritance diagram for NCollection_SparseArrayBase:
Inheritance graph
[legend]

Data Structures

class  Iterator
 

Public Member Functions

Type-independent public interface
void Clear ()
 Clears all the data. More...
 
Standard_Size Size () const
 Returns number of currently contained items. More...
 
Standard_Boolean HasValue (const Standard_Size theIndex) const
 Check whether the value at given index is set. More...
 
Standard_Boolean UnsetValue (const Standard_Size theIndex)
 Deletes the item from the array; returns True if that item was defined. More...
 

Protected Member Functions

 NCollection_SparseArrayBase (Standard_Size theItemSize, Standard_Size theBlockSize)
 Constructor; initialized by size of item and of block (in items) More...
 
virtual ~NCollection_SparseArrayBase ()
 Destructor. More...
 
Block getBlock (const Standard_Address theAddr) const
 Creates Block structure for block pointed by theAddr. More...
 
Standard_Address getItem (const Block &theBlock, Standard_Size theInd) const
 Find address of the item in the block by index (in the block) More...
 
Standard_Address getValue (const Standard_Size theIndex) const
 Direct const access to the item. More...
 
Standard_Address setValue (const Standard_Size theIndex, const Standard_Address theValue)
 Set a value to the specified item; returns address of the set item. More...
 
void assign (const NCollection_SparseArrayBase &theOther)
 Copy contents of theOther to this; assumes that this and theOther have exactly the same type of arguments. More...
 
void exchange (NCollection_SparseArrayBase &theOther)
 Exchange contents of theOther and this; assumes that this and theOther have exactly the same type of arguments. More...
 
virtual void createItem (Standard_Address theAddress, Standard_Address theOther)=0
 Create new item at the specified address with default constructor. More...
 
virtual void destroyItem (Standard_Address theAddress)=0
 Call destructor to the item. More...
 
virtual void copyItem (Standard_Address theAddress, Standard_Address theOther)=0
 Call assignment operator to the item. More...
 

Protected Attributes

Standard_Size myItemSize
 size of item More...
 
Standard_Size myBlockSize
 block size (in items) More...
 
Standard_Size myNbBlocks
 allocated size of blocks table More...
 
Standard_Size mySize
 number of currently defined items More...
 
Standard_AddressmyData
 array of pointers to data blocks More...
 

Detailed Description

Base class for NCollection_SparseArray;
provides non-template implementation of general mechanics of block allocation, items creation / deletion etc.

Constructor & Destructor Documentation

◆ NCollection_SparseArrayBase()

NCollection_SparseArrayBase::NCollection_SparseArrayBase ( Standard_Size  theItemSize,
Standard_Size  theBlockSize 
)
inlineprotected

Constructor; initialized by size of item and of block (in items)

◆ ~NCollection_SparseArrayBase()

virtual NCollection_SparseArrayBase::~NCollection_SparseArrayBase ( )
inlineprotectedvirtual

Destructor.

Member Function Documentation

◆ assign()

void NCollection_SparseArrayBase::assign ( const NCollection_SparseArrayBase theOther)
protected

Copy contents of theOther to this; assumes that this and theOther have exactly the same type of arguments.

◆ Clear()

void NCollection_SparseArrayBase::Clear ( )

Clears all the data.

◆ copyItem()

virtual void NCollection_SparseArrayBase::copyItem ( Standard_Address  theAddress,
Standard_Address  theOther 
)
protectedpure virtual

Call assignment operator to the item.

◆ createItem()

virtual void NCollection_SparseArrayBase::createItem ( Standard_Address  theAddress,
Standard_Address  theOther 
)
protectedpure virtual

Create new item at the specified address with default constructor.

Create new item at the specified address with copy constructor from existing item

◆ destroyItem()

virtual void NCollection_SparseArrayBase::destroyItem ( Standard_Address  theAddress)
protectedpure virtual

Call destructor to the item.

◆ exchange()

void NCollection_SparseArrayBase::exchange ( NCollection_SparseArrayBase theOther)
protected

Exchange contents of theOther and this; assumes that this and theOther have exactly the same type of arguments.

◆ getBlock()

Block NCollection_SparseArrayBase::getBlock ( const Standard_Address  theAddr) const
inlineprotected

Creates Block structure for block pointed by theAddr.

◆ getItem()

Standard_Address NCollection_SparseArrayBase::getItem ( const Block &  theBlock,
Standard_Size  theInd 
) const
inlineprotected

Find address of the item in the block by index (in the block)

◆ getValue()

Standard_Address NCollection_SparseArrayBase::getValue ( const Standard_Size  theIndex) const
inlineprotected

Direct const access to the item.

◆ HasValue()

Standard_Boolean NCollection_SparseArrayBase::HasValue ( const Standard_Size  theIndex) const

Check whether the value at given index is set.

◆ setValue()

Standard_Address NCollection_SparseArrayBase::setValue ( const Standard_Size  theIndex,
const Standard_Address  theValue 
)
protected

Set a value to the specified item; returns address of the set item.

◆ Size()

Standard_Size NCollection_SparseArrayBase::Size ( void  ) const
inline

Returns number of currently contained items.

◆ UnsetValue()

Standard_Boolean NCollection_SparseArrayBase::UnsetValue ( const Standard_Size  theIndex)

Deletes the item from the array; returns True if that item was defined.

Field Documentation

◆ myBlockSize

Standard_Size NCollection_SparseArrayBase::myBlockSize
protected

block size (in items)

◆ myData

Standard_Address* NCollection_SparseArrayBase::myData
protected

array of pointers to data blocks

◆ myItemSize

Standard_Size NCollection_SparseArrayBase::myItemSize
protected

size of item

◆ myNbBlocks

Standard_Size NCollection_SparseArrayBase::myNbBlocks
protected

allocated size of blocks table

◆ mySize

Standard_Size NCollection_SparseArrayBase::mySize
protected

number of currently defined items


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