BDE 4.14.0 Production release
|
#include <bdlb_indexspan.h>
Public Types | |
typedef bsl::size_t | size_type |
The type of the position and length attributes. | |
Public Member Functions | |
BSLMF_NESTED_TRAIT_DECLARATION (IndexSpan, bsl::is_trivially_copyable) | |
BSLMF_NESTED_TRAIT_DECLARATION (IndexSpan, bdlb::HasPrintMethod) | |
IndexSpan () | |
Create an IndexSpan object with position and length of 0. | |
IndexSpan (size_type position, size_type length) | |
IndexSpan (const IndexSpan &original)=default | |
~IndexSpan ()=default | |
IndexSpan & | operator= (const IndexSpan &rhs)=default |
bool | isEmpty () const |
size_type | length () const |
Return the length attribute. | |
size_type | position () const |
Return the position attribute. | |
bsl::ostream & | print (bsl::ostream &stream, int level=0, int spacesPerLevel=4) const |
A constrained attribute type that represents a position and a length. The constraint is that the sum of the position and length attributes must be representable by the bsl::size_t
type.
See bdlb_indexspan
typedef bsl::size_t bdlb::IndexSpan::size_type |
|
inline |
Create an IndexSpan
object with the specified position
and length
. The behavior is undefined unless position <= bsl::numeric_limits<size_t>::max() - length
.
|
default |
Create an index span having the value of the specified original
index span. Note that this trivial copy constructor is generated by the compiler.
|
default |
Destroy this index span object. Note that this trivial destructor is generated by the compiler.
bdlb::IndexSpan::BSLMF_NESTED_TRAIT_DECLARATION | ( | IndexSpan | , |
bdlb::HasPrintMethod | |||
) |
bdlb::IndexSpan::BSLMF_NESTED_TRAIT_DECLARATION | ( | IndexSpan | , |
bsl::is_trivially_copyable | |||
) |
|
inline |
Return true
if the length attribute is 0; and return false
otherwise.
|
inline |
Assign to this index span the value of the specified rhs
index span, and return a reference providing modifiable access to this object. Note that this trivial assignment operation is generated by the compiler.
|
inline |
bsl::ostream & bdlb::IndexSpan::print | ( | bsl::ostream & | stream, |
int | level = 0 , |
||
int | spacesPerLevel = 4 |
||
) | const |
Format this object to the specified output stream
at the (absolute value of) the optionally specified indentation level
and return a reference to stream
. If level
is specified, optionally specify spacesPerLevel
, 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.