The Gaudi Framework
v25r5
|
Useful class for representation of "sequence" of the objects through the range of valid iterators. More...
#include <GaudiUtils/Range.h>
Public Types | |
typedef std::pair< typename CONTAINER::const_iterator, typename CONTAINER::const_iterator > | Base |
typedef CONTAINER | Container |
type for actual contained iterator More... | |
typedef Container::value_type | value_type |
typedef Container::const_iterator | iterator |
typedef Container::const_iterator | const_iterator |
typedef Container::const_reverse_iterator | reverse_iterator |
typedef Container::const_reverse_iterator | const_reverse_iterator |
typedef Container::const_reference | reference |
typedef Container::const_reference | const_reference |
typedef std::pair< iterator, iterator > | _Base |
internal types More... | |
typedef Range_< Container > | _Self |
Public Member Functions | |||
Range_ () | |||
default constructor More... | |||
Range_ (iterator ibegin, iterator iend) | |||
Constructor. More... | |||
Range_ (const Base &base) | |||
constructor from the pair of iterators More... | |||
Range_ (const Container &cont) | |||
constructor from the container More... | |||
Range_ (iterator ibegin) | |||
~Range_ () | |||
destructor More... | |||
bool | empty () const | ||
empty sequence ? More... | |||
size_t | size () const | ||
size of the sequence (number of elements) More... | |||
iterator | begin () const | ||
access to begin of the sequence (const version ) More... | |||
iterator | end () const | ||
access to end of the sequence (const version) More... | |||
reverse_iterator | rbegin () const | ||
access to begin of the reversed sequence (const) More... | |||
reverse_iterator | rend () const | ||
access to begin of the reversed sequence (const) More... | |||
const_reference | front () const | ||
access for the first element (only for non-empty ranges!) More... | |||
const_reference | back () const | ||
access for the back element (only for non-empty ranges!) More... | |||
Range_ | slice (long index1, long index2) const | ||
get a "slice" of a range, in Python style More... | |||
const_reference | operator() (const size_t index) const | ||
non-checked access to the elements by index (valid only for non-empty sequences) More... | |||
const_reference | operator[] (const long index) const | ||
non-checked access to the elements by index (valid only for non-empty sequences) More... | |||
const_reference | at (const long index) const | ||
Checked access to the elements by index (valid for all sequences)
| |||
bool | operator< (const Range_ &right) const | ||
compare with another range More... | |||
bool | operator< (const Container &right) const | ||
compare with the base container More... | |||
bool | operator== (const Range_ &right) const | ||
equality with another range More... | |||
bool | operator== (const Container &right) const | ||
equality with the base container More... | |||
bool | operator! () const | ||
empty sequence? More... | |||
operator const Base & () const | |||
conversion operator to the std::pair More... | |||
const Base & | base () const | ||
conversion operator to the std::pair More... | |||
Private Attributes | |
Base | m_base |
the base itself More... | |
Useful class for representation of "sequence" of the objects through the range of valid iterators.
The range could be created over ALL container types which supports at least bidirectional iterators.
The minimum requirements from the container type:
typedef std::pair<iterator,iterator> Gaudi::Range_< CONTAINER >::_Base |
typedef Range_<Container> Gaudi::Range_< CONTAINER >::_Self |
typedef std::pair<typename CONTAINER::const_iterator, typename CONTAINER::const_iterator> Gaudi::Range_< CONTAINER >::Base |
typedef Container::const_iterator Gaudi::Range_< CONTAINER >::const_iterator |
typedef Container::const_reference Gaudi::Range_< CONTAINER >::const_reference |
typedef Container::const_reverse_iterator Gaudi::Range_< CONTAINER >::const_reverse_iterator |
typedef CONTAINER Gaudi::Range_< CONTAINER >::Container |
typedef Container::const_iterator Gaudi::Range_< CONTAINER >::iterator |
typedef Container::const_reference Gaudi::Range_< CONTAINER >::reference |
typedef Container::const_reverse_iterator Gaudi::Range_< CONTAINER >::reverse_iterator |
typedef Container::value_type Gaudi::Range_< CONTAINER >::value_type |
|
inline |
|
inline |
|
inline |
constructor from the pair of iterators
base | pair of the iterators |
Definition at line 111 of file Range.h.
|
inline |
|
inline |
|
inline |
|
inline |
Checked access to the elements by index (valid for all sequences)
GaudiException | for out-of-range access. |
index | the index of the element to be accessed |
Definition at line 190 of file Range.h.
|
inline |
access for the back element (only for non-empty ranges!)
Definition at line 139 of file Range.h.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
access for the first element (only for non-empty ranges!)
Definition at line 137 of file Range.h.
|
inline |
conversion operator to the std::pair
Definition at line 236 of file Range.h.
|
inline |
|
inline |
non-checked access to the elements by index (valid only for non-empty sequences)
index | the index of the lement to be accessed |
Definition at line 173 of file Range.h.
|
inline |
compare with another range
Definition at line 200 of file Range.h.
|
inline |
compare with the base container
Definition at line 206 of file Range.h.
|
inline |
equality with another range
Definition at line 215 of file Range.h.
|
inline |
equality with the base container
Definition at line 222 of file Range.h.
|
inline |
|
inline |
access to begin of the reversed sequence (const)
Definition at line 133 of file Range.h.
|
inline |
access to begin of the reversed sequence (const)
Definition at line 135 of file Range.h.
|
inline |
|
inline |
get a "slice" of a range, in Python style
Definition at line 147 of file Range.h.
|
private |