Quick Links: |
#include <bdld_datum.h>
Public Types | |
typedef Datum::SizeType | SizeType |
Public Member Functions | |
BSLMF_NESTED_TRAIT_DECLARATION (DatumArrayRef, bsl::is_trivially_copyable) | |
BSLMF_NESTED_TRAIT_DECLARATION (DatumArrayRef, bdlb::HasPrintMethod) | |
DatumArrayRef () | |
DatumArrayRef (const Datum *data, SizeType length) | |
DatumArrayRef (const DatumArrayRef &other) | |
~DatumArrayRef () | |
DatumArrayRef & | operator= (const DatumArrayRef &rhs) |
const Datum & | operator[] (SizeType index) const |
const Datum * | data () const |
SizeType | length () const |
bsl::ostream & | print (bsl::ostream &stream, int level=0, int spacesPerLevel=4) const |
This class
provides a read-only view to an array of datums. It holds the array by a const
pointer and an integral length value. It acts as return value for accessors inside the Datum
class that return an array of datums. Note that zero-length arrays are valid.
bdld::DatumArrayRef::DatumArrayRef | ( | ) |
Create a DatumArrayRef
object representing an empty array.
Create a DatumArrayRef
object having the specified data
and length
. The behavior is undefined unless 0 != data
or '0 == length'. Note that the pointer to the array is just copied.
bdld::DatumArrayRef::DatumArrayRef | ( | const DatumArrayRef & | other | ) |
Create a DatumArrayRef
object having the value of the specified original
object. Note that this method's definition is compiler generated.
bdld::DatumArrayRef::~DatumArrayRef | ( | ) |
Destroy this object. Note that this method's definition is compiler generated.
bdld::DatumArrayRef::BSLMF_NESTED_TRAIT_DECLARATION | ( | DatumArrayRef | , | |
bsl::is_trivially_copyable | ||||
) |
bdld::DatumArrayRef::BSLMF_NESTED_TRAIT_DECLARATION | ( | DatumArrayRef | , | |
bdlb::HasPrintMethod | ||||
) |
DatumArrayRef& bdld::DatumArrayRef::operator= | ( | const DatumArrayRef & | rhs | ) |
Assign to this object the value of the specified rhs
object. Note that this method's definition is compiler generated.
Return the element stored at the specified index
position in this array.
const Datum* bdld::DatumArrayRef::data | ( | ) | const |
Return pointer to the first array element.
SizeType bdld::DatumArrayRef::length | ( | ) | const |
Return the length of the array.
bsl::ostream& bdld::DatumArrayRef::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.