Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

CdbBdbSPagedVarrayP< E > Class Template Reference

Paged variable size array. More...

Inheritance diagram for CdbBdbSPagedVarrayP< E >:

BdbPersObj List of all members.

Public Types

typedef E ElementType

Public Member Functions

 CdbBdbSPagedVarrayP (d_ULong theInitialSize=0, d_ULong theNumPerLeaf=0, d_ULong theNumPerDirectory=0)
 Constructors.

virtual ~CdbBdbSPagedVarrayP ()
 Destructor.

d_ULong size () const
 Get the current size of the array.

BdbStatus resize (d_ULong theNewSize)
 Resize the array.

void setElementAt (d_ULong theIndex, const E &value)
 Set a value of an element at specified location.

elementAt (d_ULong theIndex) const
 Get a reference onto an element (const).

void dump (std::ostream &o, bool dumpContentsFlag=false) const
 Dump the structure and (optionaly) the contents of the array.


Detailed Description

template<typename E>
class CdbBdbSPagedVarrayP< E >

Paged variable size array.

This is a persistent ordered collection of elements of the same type, which is specified through the template parameter..

ATTENTION: Objectivity/DB requires to use explicit template instamtiation for each actual type this collection is instantiated with. Use convenience macros at the end of thsi file.

Definition at line 24 of file CdbBdbSPagedVarrayP.ddl.


Member Typedef Documentation

template<typename E>
typedef E CdbBdbSPagedVarrayP< E >::ElementType
 

Definition at line 28 of file CdbBdbSPagedVarrayP.ddl.


Constructor & Destructor Documentation

template<typename E>
CdbBdbSPagedVarrayP< E >::CdbBdbSPagedVarrayP d_ULong    theInitialSize = 0,
d_ULong    theNumPerLeaf = 0,
d_ULong    theNumPerDirectory = 0
 

Constructors.

The optional parameters list of this constructr includes:

  • the initial number of elements to allocate
  • the number of elements (of type E) per leaf node.
  • the number of links to other nodes per directory node.

If default 0 is passed instead of any of last two paremeters then the corresponding default value will be used. The default value is calculated from the size of the Objectivity/DB page (see the BOOT file of the federation) and the size of elements stored on that page.

Definition at line 22 of file CdbBdbSPagedVarrayP.cc.

template<typename E>
CdbBdbSPagedVarrayP< E >::~CdbBdbSPagedVarrayP   [virtual]
 

Destructor.

Definition at line 52 of file CdbBdbSPagedVarrayP.cc.


Member Function Documentation

template<typename E>
void CdbBdbSPagedVarrayP< E >::dump std::ostream &    o,
bool    dumpContentsFlag = false
const
 

Dump the structure and (optionaly) the contents of the array.

The contents of the array is only dumped if specified glag is set up.

Definition at line 232 of file CdbBdbSPagedVarrayP.cc.

template<typename E>
E CdbBdbSPagedVarrayP< E >::elementAt d_ULong    theIndex const
 

Get a reference onto an element (const).

Returns a copy (!) of an element. The returned element is only available for read. The copy is returned because there is no guarantee that a page where the element is located at will be locked in the virtual memory.

WARNING: The result is unpredictable if the elements exceeds the array's bounds.

Definition at line 217 of file CdbBdbSPagedVarrayP.cc.

References BdbRef().

template<typename E>
BdbStatus CdbBdbSPagedVarrayP< E >::resize d_ULong    theNewSize
 

Resize the array.

As usually, if this number is less than the current size than the tail will be destroyed. If bigger - then default constructor for the remaining elements will be called.

Returns:
the completion status

Definition at line 69 of file CdbBdbSPagedVarrayP.cc.

References BdbRef().

template<typename E>
void CdbBdbSPagedVarrayP< E >::setElementAt d_ULong    theIndex,
const E &    value
 

Set a value of an element at specified location.

This method is meant to be used when the element at specified location is going to be modified/replaced.

WARNING: The result is unpredictable if the elements exceeds the array's bounds.

Definition at line 200 of file CdbBdbSPagedVarrayP.cc.

References BdbRef().

template<typename E>
d_ULong CdbBdbSPagedVarrayP< E >::size   const
 

Get the current size of the array.

Returns the actual size of the array as it was specified either through the parameter of the constructor or as a results of subsequent calles to "resize" method.

Definition at line 62 of file CdbBdbSPagedVarrayP.cc.


The documentation for this class was generated from the following files:
Generated on Mon Dec 5 18:22:19 2005 for CDB by doxygen1.3-rc3