Inheritance diagram for CdbBdbSCollectionP:

Public Types | |
| typedef CdbItr< const char * > | IteratorOfNames |
| Type definitions for the collection's iterators. | |
| typedef CdbItr< d_UShort > | IteratorOfIdentifiers |
| typedef CdbBdbSCollectionBte | BTreeEntry |
| B-tree and its entries types definition. | |
| typedef CdbBdbSBtreeP< BTreeEntry > | BTreeP |
Public Member Functions | |
| CdbBdbSCollectionP (bool useIdFlag=true, bool useNameFlag=true) | |
| Default & normal constructor. | |
| virtual | ~CdbBdbSCollectionP () |
| Destructor. | |
| bool | useId () const |
| Check if elements identifiers are used to sort elements in the collection. | |
| bool | useName () const |
| Check if elements names are used to sort elements in the collection. | |
| d_ULong | elements () const |
| get the number of elements | |
| virtual CdbStatus | insert (const BdbRef(CdbBdbSCollectionElementP)&theRef) |
| Insert an element. | |
| virtual CdbStatus | find (const char *theName, BdbRef(CdbBdbSCollectionElementP)&theRef) const |
| Find an object by its name. | |
| virtual CdbStatus | find (d_UShort theId, BdbRef(CdbBdbSCollectionElementP)&theRef) const |
| Find an object by its identifier. | |
| virtual CdbStatus | remove (const char *theName) |
| Remove an element by its name. | |
| virtual CdbStatus | remove (d_UShort theId) |
| Remove an element by its name. | |
| IteratorOfNames | iterator_names () const |
| Get an instance of an iterator for names. | |
| IteratorOfIdentifiers | iterator_identifiers () const |
| Get an instance of an iterator for identifiers. | |
| virtual void | dump (std::ostream &o) const |
| Dump the contents of the collection. | |
This class represents persistent "collection" of objects each having an identifier and/or a name in the scope of the collection.
Elements stored in the collection must be of the "CdbBdbSCollectionElementP" class or derive from it.
This collection is "unique" in respect to the values of the keys (names and identifiers) of stored elements.
The constructor allows to decide of either or both keys (name and identifier) of the stored elements are used. At least one key is expected.
Definition at line 37 of file CdbBdbSCollectionP.ddl.
|
|
B-tree and its entries types definition. The only reason to have this definition is to avoid DDL compilation problem for the following definitions: ooRef( template_class< another_template_class< ... > > ) NOTE: That each specialization of the B-tree has to be explicitly instantiated by a user of this class for concrete values of of the d_UShort. Definition at line 61 of file CdbBdbSCollectionP.ddl. |
|
|
Definition at line 62 of file CdbBdbSCollectionP.ddl. Referenced by CdbBdbSCollectionP(). |
|
|
Definition at line 48 of file CdbBdbSCollectionP.ddl. Referenced by CdbBdbSSlaveRegistryP::create(), CdbBdbSOriginCollectionP::insert(), iterator_identifiers(), main(), CdbBdbSDatabase::physicalConditionIterator(), and CdbBdbSRegistryP::updateMainView(). |
|
|
Type definitions for the collection's iterators. These types are being introduced here to facilitate more flexible type parametrisation of the collection's clients (including its direct and indirect subclasses). Definition at line 47 of file CdbBdbSCollectionP.ddl. Referenced by iterator_names(). |
|
||||||||||||
|
Default & normal constructor. Initializes an empty collection. It's _REQUIRED_ that at least one of the flags passed as parameters must be true.
Definition at line 22 of file CdbBdbSCollectionP.cc. References BTreeP. |
|
|
Destructor. Will also destroy all the elements. Definition at line 35 of file CdbBdbSCollectionP.cc. References BdbRef(), CdbItr< T >::next(), and CdbItr< T >::value(). |
|
|
Dump the contents of the collection.
Definition at line 366 of file CdbBdbSCollectionP.cc. References BdbRef(), elements(), find(), iterator_identifiers(), iterator_names(), CdbItr< d_UShort >::next(), CdbItr< const char * >::next(), CdbStatus::Success, useId(), useName(), CdbItr< d_UShort >::value(), and CdbItr< const char * >::value(). |
|
|
get the number of elements
Definition at line 82 of file CdbBdbSCollectionP.cc. Referenced by dump(). |
|
||||||||||||
|
Find an object by its identifier. The method will return CdbStatus::NotFound if the condition was not found in the folder. Other possible completion statuses are as usual.
Definition at line 220 of file CdbBdbSCollectionP.cc. References BdbRef(), BTreeEntry, CdbStatus::Error, CdbStatus::NotFound, CdbStatus::Success, and useId(). |
|
||||||||||||
|
Find an object by its name. This method does not return the element's ownership The method will return CdbStatus::NotFound if the object was not found in the folder. Other possible completion statuses are as usual.
Definition at line 159 of file CdbBdbSCollectionP.cc. References BdbRef(), CdbStatus::Error, CdbStatus::NotFound, CdbStatus::Success, and useName(). Referenced by dump(), CdbBdbSOriginCollectionP::insert(), and remove(). |
|
|
Insert an element. Both the element's name and its identifier are obtained from the element. They both must be unique in the collection's scope. The collections taks over the ownership of the stored elements.
Reimplemented in CdbBdbSOriginCollectionP, and CdbBdbSViewCollectionP. Definition at line 88 of file CdbBdbSCollectionP.cc. References CdbStatus::Error, CdbBdbSCollectionElementP::id(), CdbBdbSCollectionBte::key, CdbStatus::Success, useId(), and useName(). Referenced by CdbBdbSViewCollectionP::insert(), and CdbBdbSOriginCollectionP::insert(). |
|
|
Get an instance of an iterator for identifiers. This kind of iterator provides "non-sorted" access to the keys. Definition at line 349 of file CdbBdbSCollectionP.cc. References IteratorOfIdentifiers, and useId(). Referenced by dump(), and CdbBdbSOriginCollectionP::insert(). |
|
|
Get an instance of an iterator for names. This kind of iterator provides "non-sorted" access to the keys. Definition at line 333 of file CdbBdbSCollectionP.cc. References IteratorOfNames, and useName(). Referenced by dump(). |
|
|
Remove an element by its name. The found element will be also destroyed. The method will return CdbStatus::NotFound if the object was not found in the folder. Other possible completion statuses are as usual.
Definition at line 303 of file CdbBdbSCollectionP.cc. References BdbRef(), BTreeEntry, CdbStatus::Error, find(), CdbStatus::Success, useId(), and useName(). |
|
|
Remove an element by its name. The found element will be also destroyed. The method will return CdbStatus::NotFound if the object was not found in the folder. Other possible completion statuses are as usual.
Definition at line 273 of file CdbBdbSCollectionP.cc. References BdbRef(), BTreeEntry, CdbStatus::Error, find(), CdbStatus::Success, useId(), and useName(). |
|
|
Check if elements identifiers are used to sort elements in the collection.
Definition at line 70 of file CdbBdbSCollectionP.cc. Referenced by dump(), find(), insert(), iterator_identifiers(), and remove(). |
|
|
Check if elements names are used to sort elements in the collection.
Definition at line 76 of file CdbBdbSCollectionP.cc. Referenced by dump(), find(), insert(), iterator_names(), and remove(). |
1.3-rc3