Thread‐safe iterator over an ObjectCatalog of TYPE objects.

Synopsis

Declared in <bdlcc_objectcatalog.h>

template<class TYPE>
class ObjectCatalogIter;

Description

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).

Member Functions

Name

Description

ObjectCatalogIter [constructor]

Constructors

~ObjectCatalogIter [destructor]

Destroy this iterator and unlock the catalog associated with it.

handle

Return the handle referred to by the iterator. The behavior is undefined unless the iterator is valid.

operator()

Return the handle and object associated with this iterator.

operator++

Advance this iterator to the next object in the associated catalog.

value

Return a const reference to the value referred to by the iterator. The behavior is undefined unless the iterator is valid.

operator void const*

Return non‐zero if the iterator is valid, and 0 otherwise.

Created with MrDocs