This class defines an efficient indexed object catalog of TYPE objects. This container is exception neutral with no guarantee of rollback: if an exception is thrown during the invocation of a method on a pre-existing instance, the object is left in a valid but undefined state. In no event is memory leaked or a mutex left in a locked state.
Declared in <bdlcc_objectcatalog.h>
template<class TYPE>
class ObjectCatalog;
| Name | Description |
|---|---|
ObjectCatalog [constructor] | Create an empty object catalog, using the optionally specified allocator to supply any memory. |
~ObjectCatalog [destructor] | Destroy this object catalog. |
add | add overloads |
allocator | Return the allocator used by this object. |
find | find overloads |
isMember | Return true if the catalog contains an item that compares equal to the specified object and false otherwise. |
length | Return a "snapshot" of the number of items currently contained in this catalog. |
remove | Optionally load into the optionally specified valueBuffer the value of the object having the specified handle and remove it from this catalog. Return zero on success, and a non-zero value if the handle is not contained in this catalog. Note that valueBuffer is assigned into, and thus must point to a valid TYPE instance. |
removeAll | removeAll overloads |
replace | replace overloads |
value | Return a const reference to the object having the specified handle. The behavior is undefined unless handle is contained in this catalog. |
verifyState | Verify that this catalog is in a consistent state. This function is introduced for testing purposes only. |
operator BloombergLP::bslmf::NestedTraitDeclaration<ObjectCatalog, UsesBslmaAllocator> | Declare that this type uses a bslma allocator. |
| Name | Description |
|---|---|
BloombergLP::bdlcc::ObjectCatalogIter | Provide thread safe iteration through all the objects of an object catalog of parameterized TYPE. The order of the iteration is implementation defined. An iterator is valid if it is associated with an object in the catalog, otherwise it is invalid. Thread-safe iteration is provided by (read)locking the object catalog during the iterator's construction and unlocking it at the iterator's destruction. This guarantees that during the life time of an iterator, the object catalog can't be modified (nevertheless, multiple threads can concurrently read the object catalog). |
BloombergLP::bdlcc::ObjectCatalog_AutoCleanup | This class provides a specialized proctor object that, upon destruction and unless the release method is called (1) removes a managed node from the ObjectCatalog, and (2) deallocates all associated memory as necessary. |