The Gaudi Framework  master (37c0b60a)
Gaudi::NamedRange_< CONTAINER, ITERATOR > Class Template Reference

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

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

Public Member Functions

 NamedRange_ ()=default
 default constructor More...
 
 NamedRange_ (typename Base::iterator ibegin, typename Base::iterator iend, std::string name="")
 Constructor. More...
 
 NamedRange_ (const Base &base, std::string name="")
 constructor from the base class More...
 
 NamedRange_ (const typename Base::Base &base, std::string name="")
 constructor from the base class More...
 
 NamedRange_ (const typename Base::Container &base, std::string name="")
 constructor from the base class More...
 
 NamedRange_ (typename Base::iterator ibegin, std::string name="")
 
 ~NamedRange_ ()=default
 destructor More...
 
NamedRange_ slice (long index1, long index2) const
 get a "slice" of a range, in Python style More...
 
const std::stringname () const
 get the name of the range More...
 
void setName (std::string value)
 set the name of the range 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...
 
- Public Member Functions inherited from Gaudi::Range_< CONTAINER, typename Gaudi::details::container< CONTAINER >::Iterator >
 Range_ ()=default
 internal types More...
 
 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...
 
bool operator< (const Range_< C, I > &right) const
 compare with another range More...
 
bool operator< (const ANOTHERCONTAINER &right) const
 compare with another container More...
 
bool operator== (const Range_ &right) const
 equality with another range More...
 
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 Basebase () const
 conversion operator to the std::pair More...
 

Protected Types

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

Private Attributes

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

Additional Inherited Members

- Public Types inherited from Gaudi::Range_< CONTAINER, typename Gaudi::details::container< CONTAINER >::Iterator >
typedef std::pair< typename Gaudi::details::container< CONTAINER >::Iterator, typename Gaudi::details::container< CONTAINER >::IteratorBase
 
typedef Gaudi::details::container< CONTAINER >::Container Container
 type for actual contained iterator More...
 
typedef typename Gaudi::details::container< CONTAINER >::Iterator iterator
 
typedef typename Gaudi::details::container< CONTAINER >::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< iteratorreverse_iterator
 
typedef std::reverse_iterator< iteratorconst_reverse_iterator
 

Detailed Description

template<class CONTAINER, class ITERATOR = typename Gaudi::details::container<CONTAINER>::Iterator>
class Gaudi::NamedRange_< CONTAINER, ITERATOR >

Definition at line 52 of file NamedRange.h.

Member Typedef Documentation

◆ Base

template<class CONTAINER , class ITERATOR = typename Gaudi::details::container<CONTAINER>::Iterator>
typedef Gaudi::Range_<CONTAINER, ITERATOR> Gaudi::NamedRange_< CONTAINER, ITERATOR >::Base
protected

the base class

Definition at line 56 of file NamedRange.h.

◆ Self

template<class CONTAINER , class ITERATOR = typename Gaudi::details::container<CONTAINER>::Iterator>
typedef NamedRange_<CONTAINER, ITERATOR> Gaudi::NamedRange_< CONTAINER, ITERATOR >::Self
protected

"self"-type

Definition at line 58 of file NamedRange.h.

Constructor & Destructor Documentation

◆ NamedRange_() [1/6]

template<class CONTAINER , class ITERATOR = typename Gaudi::details::container<CONTAINER>::Iterator>
Gaudi::NamedRange_< CONTAINER, ITERATOR >::NamedRange_ ( )
default

default constructor

◆ NamedRange_() [2/6]

template<class CONTAINER , class ITERATOR = typename Gaudi::details::container<CONTAINER>::Iterator>
Gaudi::NamedRange_< CONTAINER, ITERATOR >::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 69 of file NamedRange.h.

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

◆ NamedRange_() [3/6]

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

constructor from the base class

Parameters
basebase objects
namename of the range

Definition at line 75 of file NamedRange.h.

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

◆ NamedRange_() [4/6]

template<class CONTAINER , class ITERATOR = typename Gaudi::details::container<CONTAINER>::Iterator>
Gaudi::NamedRange_< CONTAINER, ITERATOR >::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 80 of file NamedRange.h.

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

◆ NamedRange_() [5/6]

template<class CONTAINER , class ITERATOR = typename Gaudi::details::container<CONTAINER>::Iterator>
Gaudi::NamedRange_< CONTAINER, ITERATOR >::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 85 of file NamedRange.h.

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

◆ NamedRange_() [6/6]

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

Definition at line 91 of file NamedRange.h.

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

◆ ~NamedRange_()

template<class CONTAINER , class ITERATOR = typename Gaudi::details::container<CONTAINER>::Iterator>
Gaudi::NamedRange_< CONTAINER, ITERATOR >::~NamedRange_ ( )
default

destructor

Member Function Documentation

◆ name()

template<class CONTAINER , class ITERATOR = typename Gaudi::details::container<CONTAINER>::Iterator>
const std::string& Gaudi::NamedRange_< CONTAINER, ITERATOR >::name ( ) const
inline

get the name of the range

Definition at line 104 of file NamedRange.h.

104 { return m_name; }

◆ operator==() [1/2]

template<class CONTAINER , class ITERATOR = typename Gaudi::details::container<CONTAINER>::Iterator>
template<class ANOTHERCONTAINER >
bool Gaudi::Range_< CONTAINER, ITERATOR >::operator== ( class ANOTHERCONTAINER  )
inline

compare with another container

Definition at line 227 of file Range.h.

227  {
228  return right.size() == size() && std::equal( begin(), end(), right.begin() );
229  }

◆ operator==() [2/2]

template<class CONTAINER , class ITERATOR = typename Gaudi::details::container<CONTAINER>::Iterator>
bool Gaudi::Range_< CONTAINER, ITERATOR >::operator==
inline

equality with another range

Definition at line 221 of file Range.h.

221  {
222  if ( &right == this ) { return true; } // RETURN
223  return right.size() == size() && std::equal( begin(), end(), right.begin() );
224  }

◆ setName()

template<class CONTAINER , class ITERATOR = typename Gaudi::details::container<CONTAINER>::Iterator>
void Gaudi::NamedRange_< CONTAINER, ITERATOR >::setName ( std::string  value)
inline

set the name of the range

Definition at line 106 of file NamedRange.h.

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

◆ slice()

template<class CONTAINER , class ITERATOR = typename Gaudi::details::container<CONTAINER>::Iterator>
NamedRange_ Gaudi::NamedRange_< CONTAINER, ITERATOR >::slice ( long  index1,
long  index2 
) const
inline

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

Definition at line 99 of file NamedRange.h.

99 { return NamedRange_( Base::slice( index1, index2 ), m_name ); }

Member Data Documentation

◆ m_name

template<class CONTAINER , class ITERATOR = typename Gaudi::details::container<CONTAINER>::Iterator>
std::string Gaudi::NamedRange_< CONTAINER, ITERATOR >::m_name
private

the name, associated to the range

Definition at line 113 of file NamedRange.h.


The documentation for this class was generated from the following file:
Gaudi::NamedRange_::name
const std::string & name() const
get the name of the range
Definition: NamedRange.h:104
std::equal
T equal(T... args)
std::move
T move(T... args)
Gaudi::Range_< CONTAINER, typename Gaudi::details::container< CONTAINER >::Iterator >::base
const Base & base() const
conversion operator to the std::pair
Definition: Range.h:243
Gaudi::NamedRange_::m_name
std::string m_name
the name, associated to the range
Definition: NamedRange.h:113
Gaudi::Range_< CONTAINER, typename Gaudi::details::container< CONTAINER >::Iterator >::begin
iterator begin() const
access to begin of the sequence (const version )
Definition: Range.h:151
Gaudi::Range_< CONTAINER, typename Gaudi::details::container< CONTAINER >::Iterator >::size
size_t size() const
size of the sequence (number of elements)
Definition: Range.h:149
Gaudi::NamedRange_::NamedRange_
NamedRange_()=default
default constructor
std::right
T right(T... args)
Gaudi::NamedRange_::Base
Gaudi::Range_< CONTAINER, ITERATOR > Base
the base class
Definition: NamedRange.h:56
Gaudi::Range_::slice
Range_ slice(long index1, long index2) const
get a "slice" of a range, in Python style
Definition: Range.h:168
Gaudi::Range_< CONTAINER, typename Gaudi::details::container< CONTAINER >::Iterator >::end
iterator end() const
access to end of the sequence (const version)
Definition: Range.h:153