![]() |
The Gaudi Framework
master (da3d77e1)
|
#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) More... | |
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 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 |
|
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 200 of file Range.h.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineexplicit |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
private |