BloombergLP::bdld::DatumIntMapRef

This class provides a read-only view to a map of datums (an array of DatumIntMapEntry objects). It holds the array by a const pointer and an integral size value. It acts as return value for accessors inside the Datum class that return a map of Datum objects. Note that zero-size maps are valid.

Synopsis

Declared in <bdld_datum.h>

class DatumIntMapRef;

Type Aliases

NameDescription
SizeType SizeType is an alias for an unsigned integral value, representing the capacity of a datum array, the capacity of a datum map, the capacity of the keys-capacity of a datum-key-owning map or the length of a string.
const_iterator Const iterator for this integer map reference.
const_pointer Const pointer to an element.
const_reference Const reference to an element.
const_reverse_iterator Const reverse iterator for this integer map reference.
difference_type Iterator difference type for this integer map reference.
element_type Element type for this integer map reference.
iterator Iterator for this array reference.
pointer Pointer to a map entry.
reference Reference to an element.
reverse_iterator Reverse iterator for this integer map reference.
size_type Size type for this integer map reference.
value_type Value type for this integer map reference.

Member Functions

NameDescription
DatumIntMapRef [constructor]Create a DatumIntMapRef object having the specified data of the specified size and the specified sorted flag. The behavior is undefined unless 0 != data or 0 == size. Note that the pointer to the array is just copied.
back Return a reference providing non-modifiable access to the last element of the array this reference object represents. The behavior is undefined unless size() > 0.
begin Return an iterator to the first map entry.
cbegin Return an iterator providing non-modifiable access to the first element of the array of map entries this reference object represents; return a past-the-end iterator if size() == 0.
cend Return an iterator providing non-modifiable access pointing past-the-end of the array this reference object represents.
crbegin Return a reverse iterator providing non-modifiable access to the last element of the array this reference object represents, and the past-the-end reverse iterator if size() == 0.
crend Return a reverse iterator providing non-modifiable access pointing past-the-end of the array this reference object represents.
data Return the address providing non-modifiable access to the first element of the array this reference object represents. Return a valid pointer which cannot be dereferenced if the size() == 0.
empty Return size() == 0.
end Return a past-the-end iterator for this map reference.
find Return a const pointer to the datum having the specified key, if it exists and 0 otherwise. Note that the find has order of O(n) if the data is not sorted based on the keys; if the data is sorted, it has order of O(log(n)). Also note that if multiple entries with matching keys are present, which matching record is found is unspecified.
front Return a reference providing non-modifiable access to the first element of the array this reference object represents. The behavior is undefined unless size() > 0.
isSorted Return true if underlying map is sorted and false otherwise.
operator[] Return a reference providing non-modifiable access to the element at the specified position in the array of map entries this reference object represents. The behavior is undefined unless position < size().
print Write the value of this object to the specified output stream in a human-readable format, and return a reference to the modifiable stream. Optionally specify an initial indentation level, whose absolute value is incremented recursively for nested objects. If level is specified, optionally specify spacesPerLevel, whose absolute value indicates the number of spaces per indentation level for this and all of its nested objects. If level is negative, suppress indentation of the first line. If spacesPerLevel is negative, format the entire output on one line, suppressing all but the initial indentation (as governed by level). If stream is not valid on entry, this operation has no effect. Note that this human-readable format is not fully specified, and can change without notice.
rbegin Return a reverse iterator to the last map entry.
rend Return a past-the-end reverse iterator for this map reference.
size Return a const-pointer to the number of elements of the array this reference object represents.
operator BloombergLP::bslmf::NestedTraitDeclaration<DatumIntMapRef, HasPrintMethod> DatumIntMapRef is trivially copyable.

Non-Member Functions

NameDescription
operator!=Return true if the specified lhs and rhs have different values, and false otherwise. Two DatumIntMapRef objects have different values if they hold maps of different sizes or operator == returns false for at least one of the corresponding elements in the maps.
operator==Return true if the specified lhs and rhs have the same value, and false otherwise. Two DatumIntMapRef objects have the same value if they hold maps of the same size and all the corresponding DatumIntMapEntry elements in the two maps also compare equal.