Inheritance diagram for CdbBdbNTupleSimpleImplP_ooVString:

Public Member Functions | |
| CdbBdbNTupleSimpleImplP_ooVString (d_ULong theNumberOfColumns, const std::string &theName, const std::string &theDescription, const std::vector< std::string > &theColumnNames) | |
| Constructor. | |
| virtual | ~CdbBdbNTupleSimpleImplP_ooVString () |
| Destructor. | |
| virtual d_ULong | rows () const |
| Get the number of rows in the tuple. | |
| virtual CdbStatus | get_row (std::vector< ooVString > &theRow, const d_ULong theNumber) const |
| Get a row at a specified position. | |
| virtual CdbStatus | append_row (const std::vector< ooVString > &theRow) |
| Append a row by the end of an existing list. | |
| virtual CdbStatus | repack () |
| Repack the internal storage of the tuple. | |
Q: WHY NOT TO GO FOR TEMPLATE SPECIALIZATION INSTEAD OF PROVIDING A SEPARATE CLASS FOR STRINGS?
A: BECAUSE IT"S NOT POSSIBLE TO MAKE IT WORKING ON BOTH LINUX AND SOLARIS PLATFORM UNDER OBJY 7.1.
Unlike the generic n-tuple template this particular implementation uses a regular "v-array" to store "address"-es of strings in teh internal storage, and it uses a regular "v-array" of characters (ooChar) as a storage for the actual contents of strings.
Similarily to the generic n-tuple the rows in the current implementation 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 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.
Strings get stored as null ('') terminated sequences of characters (ooChar). A regular v-array represents the structure of the n-tuple. Each element of this structure provides an index of the first character of the string in the second array where the actual contents of the string gets stored.
The string storage is a plain ooVArray of ooChar. The use of this storage is also optimized in the same way as in case of the metadata array.
Definition at line 61 of file CdbBdbNTupleSimpleImplP_ooVString.ddl.
|
||||||||||||||||||||
|
Constructor.
Definition at line 20 of file CdbBdbNTupleSimpleImplP_ooVString.cc. |
|
|
Destructor.
Definition at line 34 of file CdbBdbNTupleSimpleImplP_ooVString.cc. |
|
|
Append a row by the end of an existing list. Implements a virtual method defined in the base class.
Definition at line 95 of file CdbBdbNTupleSimpleImplP_ooVString.cc. References CdbBdbNTupleBaseP::columns(), CdbStatus::Error, CdbStatus::IllegalParameters, and CdbStatus::Success. |
|
||||||||||||
|
Get a row at a specified position. Implements a virtual method defined in the base class.
Definition at line 44 of file CdbBdbNTupleSimpleImplP_ooVString.cc. References CdbBdbNTupleBaseP::columns(), CdbStatus::Error, CdbStatus::NotFound, and CdbStatus::Success. |
|
|
Repack the internal storage of the tuple. Implements a virtual method defined in the base class.
Implements CdbBdbNTupleP< ooVString >. Definition at line 189 of file CdbBdbNTupleSimpleImplP_ooVString.cc. References CdbBdbNTupleBaseP::columns(), CdbStatus::Error, and CdbStatus::Success. |
|
|
Get the number of rows in the tuple. Implements a virtual method defined in the base class.
Implements CdbBdbNTupleP< ooVString >. Definition at line 38 of file CdbBdbNTupleSimpleImplP_ooVString.cc. |
1.3-rc3