[#BloombergLP-bdlcc-ObjectCatalog] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlcc.adoc[bdlcc]::ObjectCatalog :relfileprefix: ../../ :mrdocs: 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. == Synopsis Declared in `<bdlcc_objectcatalog.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class TYPE> class ObjectCatalog; ---- == Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdlcc/ObjectCatalog/2constructor.adoc[`ObjectCatalog`] [.small]#[constructor]# | Create an empty object catalog, using the optionally specified `allocator` to supply any memory. | xref:BloombergLP/bdlcc/ObjectCatalog/2destructor.adoc[`~ObjectCatalog`] [.small]#[destructor]# | Destroy this object catalog. | xref:BloombergLP/bdlcc/ObjectCatalog/add-07.adoc[`add`] | `add` overloads | xref:BloombergLP/bdlcc/ObjectCatalog/allocator.adoc[`allocator`] | Return the allocator used by this object. | xref:BloombergLP/bdlcc/ObjectCatalog/find-06.adoc[`find`] | `find` overloads | xref:BloombergLP/bdlcc/ObjectCatalog/isMember.adoc[`isMember`] | Return `true` if the catalog contains an item that compares equal to the specified `object` and `false` otherwise. | xref:BloombergLP/bdlcc/ObjectCatalog/length.adoc[`length`] | Return a "snapshot" of the number of items currently contained in this catalog. | xref:BloombergLP/bdlcc/ObjectCatalog/remove.adoc[`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. | xref:BloombergLP/bdlcc/ObjectCatalog/removeAll-0b.adoc[`removeAll`] | `removeAll` overloads | xref:BloombergLP/bdlcc/ObjectCatalog/replace-0c.adoc[`replace`] | `replace` overloads | xref:BloombergLP/bdlcc/ObjectCatalog/value.adoc[`value`] | Return a `const` reference to the object having the specified `handle`. The behavior is undefined unless `handle` is contained in this catalog. | xref:BloombergLP/bdlcc/ObjectCatalog/verifyState.adoc[`verifyState`] | Verify that this catalog is in a consistent state. This function is introduced for testing purposes only. | xref:BloombergLP/bdlcc/ObjectCatalog/2conversion.adoc[`operator BloombergLP::bslmf::NestedTraitDeclaration<ObjectCatalog, UsesBslmaAllocator>`] | Declare that this type uses a `bslma` allocator. |=== == Friends [cols="1,4"] |=== | Name| Description | `xref:BloombergLP/bdlcc/ObjectCatalogIter.adoc[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). | `xref:BloombergLP/bdlcc/ObjectCatalog_AutoCleanup.adoc[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. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#