The Gaudi Framework  master (3c045658)
Loading...
Searching...
No Matches
Gaudi::NamedRange_< CONTAINER > Class Template Reference

#include </builds/gaudi/Gaudi/GaudiKernel/include/GaudiKernel/NamedRange.h>

Inheritance diagram for Gaudi::NamedRange_< CONTAINER >:
Collaboration diagram for Gaudi::NamedRange_< CONTAINER >:

Public Member Functions

 NamedRange_ ()=default
 default constructor
 NamedRange_ (typename Base::iterator ibegin, typename Base::iterator iend, std::string name="")
 Constructor.
 NamedRange_ (const Base &base, std::string name="")
 constructor from the base class
 NamedRange_ (const typename Base::Base &base, std::string name="")
 constructor from the base class
 NamedRange_ (const typename Base::Container &base, std::string name="")
 constructor from the base class
 NamedRange_ (typename Base::iterator ibegin, std::string name="")
 ~NamedRange_ ()=default
NamedRange_ slice (long index1, long index2) const
 get a "slice" of a range, in Python style
const std::string & name () const
 get the name of the range
void setName (std::string value)
 set the name of the range
bool operator== (const Range_ &right) const
 equality with another range
template<class ANOTHERCONTAINER>
bool operator== (const ANOTHERCONTAINER &right) const
 compare with another container
Public Member Functions inherited from Gaudi::Range_< CONTAINER >
 Range_ ()=default
 default constructor
template<typename InputIterator>
 Range_ (InputIterator first, InputIterator last)
 Constructor.
 Range_ (const Base &base)
 constructor from the pair of iterators
 Range_ (const Container &cont)
 constructor from the container
 Range_ (iterator ibegin)
 ~Range_ ()=default
bool empty () const
 empty sequence ?
size_t size () const
 size of the sequence (number of elements)
iterator begin () const
 access to begin of the sequence (const version )
iterator end () const
 access to end of the sequence (const version)
iterator cbegin () const
 access to begin of the sequence (const version )
iterator cend () const
 access to end of the sequence (const version)
reverse_iterator rbegin () const
 access to begin of the reversed sequence (const)
reverse_iterator rend () const
 access to begin of the reversed sequence (const)
const_reference front () const
 access for the first element (only for non-empty ranges!)
const_reference back () const
 access for the back element (only for non-empty ranges!)
Range_ slice (long index1, long index2) const
 get a "slice" of a range, in Python style
const_reference operator() (const size_t index) const
 non-checked access to the elements by index (valid only for non-empty sequences)
const_reference operator[] (const long index) const
 non-checked access to the elements by index (valid only for non-empty sequences)
const_reference at (const long index) const
 Checked access to the elements by index (valid for all sequences).
template<class C>
bool operator< (const Range_< C > &right) const
 compare with another range
template<class ANOTHERCONTAINER>
bool operator< (const ANOTHERCONTAINER &right) const
 compare with another container
bool operator== (const Range_ &right) const
 equality with another range
template<class ANOTHERCONTAINER>
bool operator== (const ANOTHERCONTAINER &right) const
 compare with another container
bool operator! () const
 empty sequence?
 operator bool () const
 non-empty sequence?
 operator const Base & () const
 conversion operator to the std::pair
const Basebase () const
 conversion operator to the std::pair

Protected Types

typedef Gaudi::Range_< CONTAINER > Base
 the base class
typedef NamedRange_< CONTAINER > Self
 "self"-type

Private Attributes

std::string m_name
 the name, associated to the range

Additional Inherited Members

Public Types inherited from Gaudi::Range_< CONTAINER >
using Container = typename Gaudi::details::container<CONTAINER>::Container
 type for actual contained iterator
using const_iterator = typename CONTAINER::const_iterator
using iterator = const_iterator
using Base = std::pair<iterator, iterator>
typedef iter_traits::value_type value_type
typedef iter_traits::reference reference
typedef iter_traits::reference const_reference
typedef std::reverse_iterator< iteratorreverse_iterator
typedef std::reverse_iterator< iteratorconst_reverse_iterator

Detailed Description

template<class CONTAINER>
class Gaudi::NamedRange_< CONTAINER >

Definition at line 42 of file NamedRange.h.

Member Typedef Documentation

◆ Base

template<class CONTAINER>
typedef Gaudi::Range_<CONTAINER> Gaudi::NamedRange_< CONTAINER >::Base
protected

the base class

Definition at line 45 of file NamedRange.h.

◆ Self

template<class CONTAINER>
typedef NamedRange_<CONTAINER> Gaudi::NamedRange_< CONTAINER >::Self
protected

"self"-type

Definition at line 47 of file NamedRange.h.

Constructor & Destructor Documentation

◆ NamedRange_() [1/6]

template<class CONTAINER>
Gaudi::NamedRange_< CONTAINER >::NamedRange_ ( )
default

default constructor

◆ NamedRange_() [2/6]

template<class CONTAINER>
Gaudi::NamedRange_< CONTAINER >::NamedRange_ ( typename Base::iterator ibegin,
typename Base::iterator iend,
std::string name = "" )
inline

Constructor.

Parameters
ibeginiterator to begin of the sequence
ienditerator to end of the sequence
namename of the range

Definition at line 57 of file NamedRange.h.

58 : Base( ibegin, iend ), m_name( std::move( name ) ) {}
const std::string & name() const
get the name of the range
Definition NamedRange.h:90
Gaudi::Range_< CONTAINER > Base
the base class
Definition NamedRange.h:45
std::string m_name
the name, associated to the range
Definition NamedRange.h:97

◆ NamedRange_() [3/6]

template<class CONTAINER>
Gaudi::NamedRange_< CONTAINER >::NamedRange_ ( const Base & base,
std::string name = "" )
inline

constructor from the base class

Parameters
basebase objects
namename of the range

Definition at line 63 of file NamedRange.h.

63: Base( base ), m_name( std::move( name ) ) {}
const Base & base() const
conversion operator to the std::pair
Definition Range.h:213

◆ NamedRange_() [4/6]

template<class CONTAINER>
Gaudi::NamedRange_< CONTAINER >::NamedRange_ ( const typename Base::Base & base,
std::string name = "" )
inline

constructor from the base class

Parameters
basebase objects
namename of the range

Definition at line 68 of file NamedRange.h.

68: Base( base ), m_name( std::move( name ) ) {}

◆ NamedRange_() [5/6]

template<class CONTAINER>
Gaudi::NamedRange_< CONTAINER >::NamedRange_ ( const typename Base::Container & base,
std::string name = "" )
inline

constructor from the base class

Parameters
basebase objects
namename of the range

Definition at line 73 of file NamedRange.h.

74 : Base( base ), m_name( std::move( name ) ) {}

◆ NamedRange_() [6/6]

template<class CONTAINER>
Gaudi::NamedRange_< CONTAINER >::NamedRange_ ( typename Base::iterator ibegin,
std::string name = "" )
inline

Definition at line 79 of file NamedRange.h.

80 : Base( ibegin, ibegin ), m_name( std::move( name ) ) {}

◆ ~NamedRange_()

template<class CONTAINER>
Gaudi::NamedRange_< CONTAINER >::~NamedRange_ ( )
default

Member Function Documentation

◆ name()

template<class CONTAINER>
const std::string & Gaudi::NamedRange_< CONTAINER >::name ( ) const
inline

get the name of the range

Definition at line 90 of file NamedRange.h.

90{ return m_name; }

◆ operator==() [1/2]

template<class CONTAINER>
template<class ANOTHERCONTAINER>
bool Gaudi::Range_< CONTAINER >::operator== ( const ANOTHERCONTAINER & right) const
inline

compare with another container

Definition at line 201 of file Range.h.

201 {
202 return right.size() == size() && std::equal( begin(), end(), right.begin() );
203 }
size_t size() const
size of the sequence (number of elements)
Definition Range.h:127
iterator begin() const
access to begin of the sequence (const version )
Definition Range.h:129
iterator end() const
access to end of the sequence (const version)
Definition Range.h:131

◆ operator==() [2/2]

template<class CONTAINER>
bool Gaudi::Range_< CONTAINER >::operator== ( const Range_ & right) const
inline

equality with another range

Definition at line 195 of file Range.h.

195 {
196 if ( &right == this ) { return true; }
197 return right.size() == size() && std::equal( begin(), end(), right.begin() );
198 }

◆ setName()

template<class CONTAINER>
void Gaudi::NamedRange_< CONTAINER >::setName ( std::string value)
inline

set the name of the range

Definition at line 92 of file NamedRange.h.

92{ m_name = std::move( value ); }

◆ slice()

template<class CONTAINER>
NamedRange_ Gaudi::NamedRange_< CONTAINER >::slice ( long index1,
long index2 ) const
inline

get a "slice" of a range, in Python style

Definition at line 86 of file NamedRange.h.

86{ return NamedRange_( Base::slice( index1, index2 ), m_name ); }
NamedRange_()=default
default constructor
Range_ slice(long index1, long index2) const
get a "slice" of a range, in Python style
Definition Range.h:146

Member Data Documentation

◆ m_name

template<class CONTAINER>
std::string Gaudi::NamedRange_< CONTAINER >::m_name
private

the name, associated to the range

Definition at line 97 of file NamedRange.h.


The documentation for this class was generated from the following file: