The Gaudi Framework
v30r3 (a5ef0a68)
|
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< ITERATOR, ITERATOR > | Base |
typedef Gaudi::details::container< CONTAINER >::Container | Container |
type for actual contained iterator More... | |
typedef ITERATOR | iterator |
typedef ITERATOR | const_iterator |
typedef iter_traits::value_type | value_type |
typedef iter_traits::reference | reference |
typedef iter_traits::reference | const_reference |
typedef std::reverse_iterator< iterator > | reverse_iterator |
typedef std::reverse_iterator< iterator > | const_reverse_iterator |
Public Member Functions | |||
Range_ ()=default | |||
internal types More... | |||
template<typename InputIterator > | |||
Range_ (InputIterator first, InputIterator last) | |||
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_ ()=default | |||
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... | |||
iterator | cbegin () const | ||
access to begin of the sequence (const version ) More... | |||
iterator | cend () 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)
| |||
template<class C , class I > | |||
bool | operator< (const Range_< C, I > &right) const | ||
compare with another range More... | |||
template<class ANOTHERCONTAINER > | |||
bool | operator< (const ANOTHERCONTAINER &right) const | ||
compare with another container More... | |||
bool | operator== (const Range_ &right) const | ||
equality with another range More... | |||
template<class CNT , class IT > | |||
bool | operator== (const Range_< CNT, IT > &right) const | ||
equality with another range type More... | |||
template<class ANOTHERCONTAINER > | |||
bool | operator== (const ANOTHERCONTAINER &right) const | ||
compare with another container More... | |||
bool | operator! () const | ||
empty sequence? More... | |||
operator bool () const | |||
non-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 Types | |
typedef std::iterator_traits< iterator > | iter_traits |
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, ITERATOR >::Base |
typedef ITERATOR Gaudi::Range_< CONTAINER, ITERATOR >::const_iterator |
typedef iter_traits::reference Gaudi::Range_< CONTAINER, ITERATOR >::const_reference |
typedef std::reverse_iterator<iterator> Gaudi::Range_< CONTAINER, ITERATOR >::const_reverse_iterator |
typedef Gaudi::details::container<CONTAINER>::Container Gaudi::Range_< CONTAINER, ITERATOR >::Container |
|
private |
typedef ITERATOR Gaudi::Range_< CONTAINER, ITERATOR >::iterator |
typedef iter_traits::reference Gaudi::Range_< CONTAINER, ITERATOR >::reference |
typedef std::reverse_iterator<iterator> Gaudi::Range_< CONTAINER, ITERATOR >::reverse_iterator |
typedef iter_traits::value_type Gaudi::Range_< CONTAINER, ITERATOR >::value_type |
|
default |
internal types
default constructor
|
inline |
|
inline |
constructor from the pair of iterators
base | pair of the iterators |
Definition at line 131 of file Range.h.
|
inline |
|
inline |
|
default |
destructor
|
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 212 of file Range.h.
|
inline |
access for the back element (only for non-empty ranges!)
Definition at line 162 of file Range.h.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
access for the first element (only for non-empty ranges!)
Definition at line 160 of file Range.h.
|
inlineexplicit |
|
inline |
conversion operator to the std::pair
Definition at line 268 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 201 of file Range.h.
|
inline |
compare with another range
Definition at line 224 of file Range.h.
|
inline |
compare with another container
Definition at line 230 of file Range.h.
|
inline |
equality with another range
Definition at line 238 of file Range.h.
|
inline |
equality with another range type
Definition at line 247 of file Range.h.
|
inline |
compare with another container
Definition at line 253 of file Range.h.
|
inline |
|
inline |
access to begin of the reversed sequence (const)
Definition at line 156 of file Range.h.
|
inline |
access to begin of the reversed sequence (const)
Definition at line 158 of file Range.h.
|
inline |
|
inline |
get a "slice" of a range, in Python style
Definition at line 165 of file Range.h.
|
private |