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

CdbBdbNTupleSimpleImplP< E > Class Template Reference

An implementation of a base class for persistent n-tuples. More...

Inheritance diagram for CdbBdbNTupleSimpleImplP< E >:

CdbBdbNTupleP< E > CdbBdbNTupleBaseP List of all members.

Public Member Functions

 CdbBdbNTupleSimpleImplP (d_ULong theNumberOfColumns, const std::string &theName, const std::string &theDescription, const std::vector< std::string > &theColumnNames)
 Constructor.

virtual ~CdbBdbNTupleSimpleImplP ()
 Destructor.

virtual d_ULong rows () const
 Get the number of rows in the tuple.

virtual CdbStatus get_row (std::vector< E > &theRow, const d_ULong theNumber) const
 Get a row at a specified position.

virtual CdbStatus append_row (const std::vector< E > &theRow)
 Append a row by the end of an existing list.

virtual CdbStatus repack ()
 Repack the internal storage of the tuple.


Detailed Description

template<class E>
class CdbBdbNTupleSimpleImplP< E >

An implementation of a base class for persistent n-tuples.

This implementation uses a "paged v-array" for efficient storing of n-tuple elements. The rows are unwrapped into a sigle dimension array in the following order:

DESIGN NOTES:

This class has been designed for the performance of the insertion operations versus persistent space utilization efficiency. That's why the capacity of a "paged" v-array used to store the elements may be greater than the actual number of elements stored at a given instance of time.

The current resizing policy for the storage is "x2" meaning that every time a new row is to be inserted and if there is no free space in the storage the storage size gets increased by a factor of 2.

Since this policy would result with the 25 average in-efficiency in the use of the storage then there is a special "repack" method meant to truncate the storage to match the actual number of rows stored in the array. Normally the "repack" operation should be called when the construction of the tuple is finished.

See also:
CdbBdbNTupleBaseP

CdbBdbNTupleP

Definition at line 42 of file CdbBdbNTupleSimpleImplP.ddl.


Constructor & Destructor Documentation

template<class E>
CdbBdbNTupleSimpleImplP< E >::CdbBdbNTupleSimpleImplP d_ULong    theNumberOfColumns,
const std::string &    theName,
const std::string &    theDescription,
const std::vector< std::string > &    theColumnNames
 

Constructor.

See also:
CdbBdbNTupleBaseP::CdbBdbNTupleBaseP

CdbBdbNTupleP::CdbBdbNTupleP

Definition at line 21 of file CdbBdbNTupleSimpleImplP.cc.

template<class E>
CdbBdbNTupleSimpleImplP< E >::~CdbBdbNTupleSimpleImplP   [virtual]
 

Destructor.

Definition at line 42 of file CdbBdbNTupleSimpleImplP.cc.


Member Function Documentation

template<class E>
CdbStatus CdbBdbNTupleSimpleImplP< E >::append_row const std::vector< E > &    theRow [virtual]
 

Append a row by the end of an existing list.

Implements a virtual method defined in the base class.

See also:
CdbBdbNTupleP::append_row

Definition at line 87 of file CdbBdbNTupleSimpleImplP.cc.

References CdbBdbNTupleBaseP::columns(), CdbStatus::Error, CdbStatus::IllegalParameters, and CdbStatus::Success.

template<class E>
CdbStatus CdbBdbNTupleSimpleImplP< E >::get_row std::vector< E > &    theRow,
const d_ULong    theNumber
const [virtual]
 

Get a row at a specified position.

Implements a virtual method defined in the base class.

See also:
CdbBdbNTupleP::get_row

Definition at line 57 of file CdbBdbNTupleSimpleImplP.cc.

References CdbBdbNTupleBaseP::columns(), CdbStatus::Error, CdbStatus::NotFound, and CdbStatus::Success.

template<class E>
CdbStatus CdbBdbNTupleSimpleImplP< E >::repack   [virtual]
 

Repack the internal storage of the tuple.

Implements a virtual method defined in the base class.

See also:
CdbBdbNTupleP::repack

Implements CdbBdbNTupleP< E >.

Definition at line 130 of file CdbBdbNTupleSimpleImplP.cc.

References CdbBdbNTupleBaseP::columns(), CdbStatus::Error, and CdbStatus::Success.

template<class E>
d_ULong CdbBdbNTupleSimpleImplP< E >::rows   const [virtual]
 

Get the number of rows in the tuple.

Implements a virtual method defined in the base class.

See also:
CdbBdbNTupleP::rows

Implements CdbBdbNTupleP< E >.

Definition at line 50 of file CdbBdbNTupleSimpleImplP.cc.


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