| The Gaudi Framework v28r2-patches (bc4ad17a)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

NamedRange.h
Go to the documentation of this file.
1 #ifndef GAUDI_NAMEDRANGE_H
2 #define GAUDI_NAMEDRANGE_H 1
3 // ============================================================================
4 // Include files
5 // ============================================================================
6 // STD & STL
7 // ============================================================================
8 #include <string>
9 // ============================================================================
10 // GaudiUtils
11 // ============================================================================
12 #include "GaudiKernel/Range.h"
13 // ============================================================================
29 // ============================================================================
30 namespace Gaudi
31 {
32 // ==========================================================================
42 template <class CONTAINER, class ITERATOR= typename Gaudi::details::container<CONTAINER>::Iterator>
43 class NamedRange_ : public Gaudi::Range_<CONTAINER,ITERATOR>
44 {
45 protected:
46 // ========================================================================
48 typedef Gaudi::Range_<CONTAINER,ITERATOR> Base ;
50 typedef NamedRange_<CONTAINER,ITERATOR> Self ;
51 // ========================================================================
52 public:
53 // ========================================================================
55 NamedRange_() = default;
61 NamedRange_( typename Base::iterator ibegin ,
62 typename Base::iterator iend ,
63 std::string name = "" )
64 : Base ( ibegin , iend ) , m_name ( std::move(name) ) {} ;
69 NamedRange_( const Base& base ,
70 std::string name = "" )
71 : Base ( base ) , m_name ( std::move(name) ) {};
76 NamedRange_( const typename Base::Base& base ,
77 std::string name = "" )
78 : Base ( base ) , m_name ( std::move(name) ) {};
83 NamedRange_( const typename Base::Container& base ,
84 std::string name = "" )
85 : Base ( base ) , m_name ( std::move(name) ) {};
86 /* constructor of empty range/sequence
87 * @param ibegin iterator to begin of empty sequence
88 * @param name name of the range
89 */
90 NamedRange_( typename Base::iterator ibegin ,
91 std::string name = "" )
92 : Base ( ibegin , ibegin ) , m_name ( std::move(name) ) {};
94 ~NamedRange_() = default;
95 // ========================================================================
96 public:
97 // ========================================================================
99 inline NamedRange_ slice( long index1 , long index2 ) const
100 { return NamedRange_( Base::slice ( index1 , index2 ) , m_name ) ; }
101 // ========================================================================
102 public:
103 // ========================================================================
105 const std::string& name() const { return m_name ; }
107 void setName( const std::string& value ) { m_name = value ; }
108 // ========================================================================
109 private:
110 // ========================================================================
112 std::string m_name ; // the name associated to the range
113 // ========================================================================
114 };
115 // ==========================================================================
126 template <class CONTAINER>
127 inline
128 NamedRange_<CONTAINER>
129 range ( const CONTAINER& cnt ,
130 std::string name )
131 { return NamedRange_<CONTAINER>( cnt.begin() , cnt.end() , std::move(name) ) ; }
132 // ==========================================================================
133 } // end of namespace Gaudi
134 // ============================================================================
135 // The END
136 // ============================================================================
137 #endif // GAUDI_NAMEDRANGE_H
138 // ============================================================================
Gaudi::NamedRange_::name
const std::string & name() const
get the name of the range
Definition: NamedRange.h:105
Gaudi::NamedRange_::Self
NamedRange_< CONTAINER, ITERATOR > Self
"self"-type
Definition: NamedRange.h:50
Gaudi::NamedRange_::Base
Gaudi::Range_< CONTAINER, ITERATOR > Base
the base class
Definition: NamedRange.h:48
std
STL namespace.
Gaudi::NamedRange_::NamedRange_
NamedRange_(const Base &base, std::string name="")
constructor from the base class
Definition: NamedRange.h:69
Gaudi::NamedRange_::NamedRange_
NamedRange_(const typename Base::Base &base, std::string name="")
constructor from the base class
Definition: NamedRange.h:76
Gaudi::NamedRange_::setName
void setName(const std::string &value)
set the name of the range
Definition: NamedRange.h:107
std::string
STL class.
Gaudi::NamedRange_::NamedRange_
NamedRange_(const typename Base::Container &base, std::string name="")
constructor from the base class
Definition: NamedRange.h:83
Gaudi::range
NamedRange_< CONTAINER > range(const CONTAINER &cnt, std::string name)
simple function to create the named range from arbitrary container
Definition: NamedRange.h:129
Gaudi::NamedRange_::slice
NamedRange_ slice(long index1, long index2) const
get a "slice" of a range, in Python style
Definition: NamedRange.h:99
Range.h
This file has been imported from LoKi project "C++ ToolKit for Smart and Friendly Physics Analysis" ...
Gaudi::NamedRange_::NamedRange_
NamedRange_()=default
default constructor
std::move
T move(T...args)
Gaudi::NamedRange_::m_name
std::string m_name
the name, associated to the range
Definition: NamedRange.h:112
Iterator
boost::spirit::classic::position_iterator2< ForwardIterator > Iterator
Definition: Iterator.h:18
Gaudi::NamedRange_::NamedRange_
NamedRange_(typename Base::iterator ibegin, std::string name="")
Definition: NamedRange.h:90
Gaudi::Range_::base
const Base & base() const
conversion operator to the std::pair
Definition: Range.h:273
Gaudi::NamedRange_::NamedRange_
NamedRange_(typename Base::iterator ibegin, typename Base::iterator iend, std::string name="")
Constructor.
Definition: NamedRange.h:61
Gaudi::Range_
Useful class for representation of "sequence" of the objects through the range of valid iterators...
Definition: Range.h:102
Gaudi::NamedRange_
Definition: NamedRange.h:43
Gaudi
Helper functions to set/get the application return code.
Definition: __init__.py:1
Gaudi::NamedRange_::~NamedRange_
~NamedRange_()=default
destructor