|
BDE 4.14.0 Production release
|
#include <bdld_datum.h>
Public Types | |
| typedef const bdld::DatumMapEntry | element_type |
| typedef bdld::DatumMapEntry | value_type |
| typedef bsl::size_t | size_type |
| typedef bsl::ptrdiff_t | difference_type |
| typedef element_type * | pointer |
| typedef const element_type * | const_pointer |
| typedef element_type & | reference |
| typedef const element_type & | const_reference |
| typedef pointer | iterator |
| typedef const_pointer | const_iterator |
| typedef bsl::reverse_iterator< iterator > | reverse_iterator |
| typedef bsl::reverse_iterator< const_iterator > | const_reverse_iterator |
| typedef Datum::SizeType | SizeType |
This class provides a read-only view to a map of datums (an array of DatumMapEntry 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.
See bdld_datum
| typedef const element_type* bdld::DatumMapRef::const_pointer |
| typedef const element_type& bdld::DatumMapRef::const_reference |
| typedef bsl::reverse_iterator<const_iterator> bdld::DatumMapRef::const_reverse_iterator |
| typedef bsl::ptrdiff_t bdld::DatumMapRef::difference_type |
| typedef const bdld::DatumMapEntry bdld::DatumMapRef::element_type |
| typedef pointer bdld::DatumMapRef::iterator |
| typedef element_type* bdld::DatumMapRef::pointer |
| typedef element_type& bdld::DatumMapRef::reference |
| typedef bsl::reverse_iterator<iterator> bdld::DatumMapRef::reverse_iterator |
| typedef bsl::size_t bdld::DatumMapRef::size_type |
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.
|
inline |
Create a DatumMapRef object having the specified data of the specified size and the specified sorted and ownsKeys flags. The behavior is undefined unless 0 != data or 0 == size. Note that the pointer to the array is just copied.
|
default |
|
inline |
Return a reference providing non-modifiable access to the last element of the map this reference object represents. The behavior is undefined unless size() > 0.
|
inline |
| bdld::DatumMapRef::BSLMF_NESTED_TRAIT_DECLARATION | ( | DatumMapRef | , |
| bdlb::HasPrintMethod | |||
| ) |
| bdld::DatumMapRef::BSLMF_NESTED_TRAIT_DECLARATION | ( | DatumMapRef | , |
| bsl::is_trivially_copyable | |||
| ) |
|
inline |
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.
|
inline |
Return an iterator providing non-modifiable access pointing past-the-end of the array this reference object represents.
|
inline |
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.
|
inline |
Return a reverse iterator providing non-modifiable access pointing past-the-end of the array this reference object represents.
|
inline |
Return the address providing non-modifiable access to the first element of the map this reference object represents. Return a valid pointer which cannot be dereferenced if the size() == 0.
|
inline |
|
inline |
| const Datum * bdld::DatumMapRef::find | ( | const bslstl::StringRef & | key | ) | const |
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.
|
inline |
Return a reference providing non-modifiable access to the first element of the map this reference object represents. The behavior is undefined unless size() > 0.
|
inline |
|
inline |
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().
|
inline |
Return true if underlying map owns the keys and false otherwise. Note that false is always returned for zero-sized DatumMapRef.
| bsl::ostream & bdld::DatumMapRef::print | ( | bsl::ostream & | stream, |
| int | level = 0, |
||
| int | spacesPerLevel = 4 |
||
| ) | const |
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.
|
inline |
|
inline |
|
inline |
Return a const-pointer to the number of elements of the map this reference object represents.