The Gaudi Framework
master (9f3f8895)
Toggle main menu visibility
Loading...
Searching...
No Matches
NamedRange.h
Go to the documentation of this file.
1
/***********************************************************************************\
2
* (c) Copyright 1998-2026 CERN for the benefit of the LHCb and ATLAS collaborations *
3
* *
4
* This software is distributed under the terms of the Apache version 2 licence, *
5
* copied verbatim in the file "LICENSE". *
6
* *
7
* In applying this licence, CERN does not waive the privileges and immunities *
8
* granted to it by virtue of its status as an Intergovernmental Organization *
9
* or submit itself to any jurisdiction. *
10
\***********************************************************************************/
11
#pragma once
12
13
#include <
GaudiKernel/Range.h
>
14
#include <string>
15
31
namespace
Gaudi
{
41
template
<
class
CONTAINER>
42
class
NamedRange_
:
public
Gaudi::Range_
<CONTAINER> {
43
protected
:
45
typedef
Gaudi::Range_<CONTAINER>
Base
;
47
typedef
NamedRange_<CONTAINER>
Self
;
48
49
public
:
51
NamedRange_
() =
default
;
57
NamedRange_
(
typename
Base::iterator
ibegin,
typename
Base::iterator
iend, std::string
name
=
""
)
58
:
Base
( ibegin, iend ),
m_name
(
std
::move(
name
) ) {}
59
63
NamedRange_
(
const
Base
&
base
, std::string
name
=
""
) :
Base
(
base
),
m_name
(
std
::move(
name
) ) {}
68
NamedRange_
(
const
typename
Base::Base
&
base
, std::string
name
=
""
) :
Base
(
base
),
m_name
(
std
::move(
name
) ) {}
73
NamedRange_
(
const
typename
Base::Container
&
base
, std::string
name
=
""
)
74
:
Base
(
base
),
m_name
(
std
::move(
name
) ) {}
75
/* constructor of empty range/sequence
76
* @param ibegin iterator to begin of empty sequence
77
* @param name name of the range
78
*/
79
NamedRange_
(
typename
Base::iterator
ibegin, std::string
name
=
""
)
80
:
Base
( ibegin, ibegin ),
m_name
(
std
::move(
name
) ) {}
81
82
~NamedRange_
() =
default
;
83
84
public
:
86
NamedRange_
slice
(
long
index1,
long
index2 )
const
{
return
NamedRange_
(
Base::slice
( index1, index2 ),
m_name
); }
87
88
public
:
90
const
std::string&
name
()
const
{
return
m_name
; }
92
void
setName
( std::string value ) {
m_name
= std::move( value ); }
93
using
Base::operator==;
94
95
private
:
97
std::string
m_name
;
// the name associated to the range
98
};
99
110
template
<
class
CONTAINER>
111
NamedRange_<CONTAINER>
range
(
const
CONTAINER& cnt, std::string name ) {
112
return
NamedRange_<CONTAINER>
( cnt.begin(), cnt.end(), std::move( name ) );
113
}
114
}
// namespace Gaudi
Range.h
This file has been imported from LoKi project "C++ ToolKit for Smart and Friendly Physics Analysis".
Gaudi::NamedRange_
Definition
NamedRange.h:42
Gaudi::NamedRange_< T >::name
const std::string & name() const
Definition
NamedRange.h:90
Gaudi::NamedRange_< T >::Self
NamedRange_< T > Self
Definition
NamedRange.h:47
Gaudi::NamedRange_::NamedRange_
NamedRange_(typename Base::iterator ibegin, std::string name="")
Definition
NamedRange.h:79
Gaudi::NamedRange_::setName
void setName(std::string value)
set the name of the range
Definition
NamedRange.h:92
Gaudi::NamedRange_::NamedRange_
NamedRange_(const Base &base, std::string name="")
constructor from the base class
Definition
NamedRange.h:63
Gaudi::NamedRange_< T >::Base
Gaudi::Range_< T > Base
Definition
NamedRange.h:45
Gaudi::NamedRange_::NamedRange_
NamedRange_()=default
default constructor
Gaudi::NamedRange_::NamedRange_
NamedRange_(const typename Base::Base &base, std::string name="")
constructor from the base class
Definition
NamedRange.h:68
Gaudi::NamedRange_::NamedRange_
NamedRange_(const typename Base::Container &base, std::string name="")
constructor from the base class
Definition
NamedRange.h:73
Gaudi::NamedRange_::~NamedRange_
~NamedRange_()=default
Gaudi::NamedRange_::slice
NamedRange_ slice(long index1, long index2) const
get a "slice" of a range, in Python style
Definition
NamedRange.h:86
Gaudi::NamedRange_< T >::m_name
std::string m_name
Definition
NamedRange.h:97
Gaudi::NamedRange_::NamedRange_
NamedRange_(typename Base::iterator ibegin, typename Base::iterator iend, std::string name="")
Constructor.
Definition
NamedRange.h:57
Gaudi::Range_
Useful class for representation of "sequence" of the objects through the range of valid iterators.
Definition
Range.h:81
Gaudi::Range_< T >::slice
Range_ slice(long index1, long index2) const
Definition
Range.h:146
Gaudi::Range_< T >::Container
typename Gaudi::details::container< T >::Container Container
Definition
Range.h:85
Gaudi::Range_< T >::base
const Base & base() const
Definition
Range.h:213
Gaudi::Range_< T >::iterator
const_iterator iterator
Definition
Range.h:87
Gaudi::Range_< T >::Base
std::pair< iterator, iterator > Base
Definition
Range.h:88
Gaudi
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...
Definition
__init__.py:1
Gaudi::range
NamedRange_< CONTAINER > range(const CONTAINER &cnt, std::string name)
simple function to create the named range from arbitrary container
Definition
NamedRange.h:111
std
STL namespace.
GaudiKernel
include
GaudiKernel
NamedRange.h
Generated on
for The Gaudi Framework by
1.17.0