|
BDE 4.39.x Production Release
|
#include <bdlb_indexspan.h>
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
Public Types | |
| typedef bsl::size_t | size_type |
Public Member Functions | |
| BSLMF_NESTED_TRAIT_DECLARATION (IndexSpan, bsl::is_trivially_copyable) | |
| BSLMF_NESTED_TRAIT_DECLARATION (IndexSpan, bdlb::HasPrintMethod) | |
| IndexSpan () | |
| 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 |
| size_type | position () const |
| bsl::ostream & | print (bsl::ostream &stream, int level=0, int spacesPerLevel=4) const |
| typedef bsl::size_t bdlb::IndexSpan::size_type |
The type of the position and length attributes.
|
inline |
Create an IndexSpan object with position and length of 0.
Create an IndexSpan object with the specified position and length.
position <= bsl::numeric_limits<size_t>::max() - length.
|
default |
Create an index span having the value of the specified original index span.
|
default |
Destroy this index span object.
| 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 |
Return the length attribute.
Assign to this index span the value of the specified rhs index span, and return a reference providing modifiable access to this object.
|
inline |
Return the position attribute.
| 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.