Efficient, value‐semantic manager of reusable, non‐negative integer indices.

Synopsis

Declared in <bdlc_indexclerk.h>

class IndexClerk;

Description

This class defines an efficient, value‐semantic manager type for reusable, non‐negative integer indices. The class invariants are that the all decommissioned indices must be non‐negative, less than the next new index, and unique.

Member Functions

Name

Description

IndexClerk [constructor]

Constructors

~IndexClerk [destructor]

Destroy this index clerk.

operator=

Assign to this index clerk the value of the specified rhs index clerk, and return a reference to this modifiable index clerk.

bdexStreamIn

Assign to this object the value read from the specified input stream.

bdexStreamOut

Write the value of this object to the specified output stream.

begin

Return an iterator to the first decommissioned index, or end().

end

Return a IndexClerkIter referring to an invalid index, indicating the end of the sequence of decommissioned index.

getIndex

Return the next available unused integer index. Existing decommissioned indices are reissued before new ones are created.

isInUse

Return true if the specified index is currently in use.

nextNewIndex

Return the smallest index that has not yet been issued.

numCommissionedIndices

Return the number of indices currently in use.

numDecommissionedIndices

Return the number of indices that are currently decommissioned.

print

Format this index clerk to the specified output stream.

putIndex

Return the specified index to this index clerk for reuse.

removeAll

Remove all indices from this index clerk.

operator BloombergLP::bslmf::NestedTraitDeclaration<IndexClerk, UsesBslmaAllocator>

Declare that this type uses a bslma allocator.

Static Member Functions

Name

Description

maxSupportedBdexVersion

maxSupportedBdexVersion overloads

Friends

Name

Description

BloombergLP::bdlc::operator!=

Return true if the specified lhs and rhs index clerks do not have the same value, and false otherwise.

BloombergLP::bdlc::operator==

Return true if the specified lhs and rhs index clerks have the same value, and false otherwise.

Created with MrDocs