ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
DetectorDescription
Identifier
Identifier
DetectorDescription/Identifier/Identifier/Range.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#ifndef IDENTIFIER_RANGE_H
6
#define IDENTIFIER_RANGE_H
7
8
9
#include <
Identifier/ExpandedIdentifier.h
>
10
#include "
Identifier/IdentifierField.h
"
11
#include <vector>
12
#include <cassert>
13
#include <stdexcept>
14
#include <bit>
15
#include <iosfwd>
16
class
MsgStream;
17
31
class
Range
{
32
public
:
33
34
using
element_type
=
ExpandedIdentifier::element_type
;
35
using
size_type
=
ExpandedIdentifier::size_type
;
36
using
field
=
IdentifierField
;
37
using
field_vector
= std::vector<field>;
38
39
40
Range
() =
default
;
41
42
48
Range
(
const
Range
& other,
size_type
start);
49
50
51
56
Range
(
const
ExpandedIdentifier
& root);
57
58
explicit
Range
(
const
std::string & text);
59
77
void
build
(
const
std::string& text);
78
83
void
build
(
const
ExpandedIdentifier
& root);
84
86
87
void
clear
();
88
90
void
add
(
element_type
value);
91
93
void
add
(
element_type
minimum
,
element_type
maximum
);
94
96
void
add
(
const
field
& f);
97
99
void
add
(
field
&& f);
100
102
void
add
(
const
Range
& subrange);
103
105
void
add
(
Range
&& subrange);
106
108
int
match
(
const
ExpandedIdentifier
&
id
)
const
;
109
111
const
field
&
operator []
(
size_type
index
)
const
;
112
size_type
fields
()
const
;
113
bool
is_empty
()
const
;
114
120
ExpandedIdentifier
minimum
()
const
;
121
ExpandedIdentifier
maximum
()
const
;
122
128
size_type
cardinality
()
const
;
129
// Up to a given id
130
size_type
cardinalityUpTo
(
const
ExpandedIdentifier
&
id
)
const
;
131
133
bool
overlaps_with
(
const
Range
& other)
const
;
134
135
void
show
(std::ostream& s)
const
;
136
void
show
(MsgStream & s)
const
;
137
139
operator
std::string ()
const
;
140
141
bool
operator ==
(
const
Range
& other)
const
;
142
143
private
:
144
field_vector
m_fields
;
145
};
146
147
148
149
//-----------------------------------------------
150
inline
Range::size_type
Range::fields
()
const
{
151
return
(
m_fields
.size ());
152
}
153
154
155
156
//-----------------------------------------------
157
inline
bool
Range::is_empty
()
const
{
158
if
(
m_fields
.size () == 0)
return
(
true
);
159
return
(
false
);
160
}
161
162
163
std::ostream &
164
operator <<
(std::ostream &out,
const
Range
&
r
);
165
166
std::istream &
167
operator >>
(std::istream &in,
Range
&
r
);
168
169
170
#endif
ExpandedIdentifier.h
operator<<
std::ostream & operator<<(std::ostream &out, const Range &r)
Definition
DetectorDescription/Identifier/src/Range.cxx:337
operator>>
std::istream & operator>>(std::istream &in, Range &r)
Definition
DetectorDescription/Identifier/src/Range.cxx:343
IdentifierField.h
ExpandedIdentifier
Definition
DetectorDescription/Identifier/Identifier/ExpandedIdentifier.h:105
ExpandedIdentifier::size_type
element_vector::size_type size_type
Definition
DetectorDescription/Identifier/Identifier/ExpandedIdentifier.h:115
ExpandedIdentifier::element_type
int element_type
Definition
DetectorDescription/Identifier/Identifier/ExpandedIdentifier.h:109
IdentifierField
This is the individual specification for the range of one ExpandedIdentifier IdentifierField.
Definition
IdentifierField.h:85
Range
A Range describes the possible ranges for the field values of an ExpandedIdentifier.
Definition
DetectorDescription/Identifier/Identifier/Range.h:31
Range::maximum
ExpandedIdentifier maximum() const
Definition
DetectorDescription/Identifier/src/Range.cxx:164
Range::match
int match(const ExpandedIdentifier &id) const
Match an identifier.
Definition
DetectorDescription/Identifier/src/Range.cxx:128
Range::Range
Range()=default
Range::minimum
ExpandedIdentifier minimum() const
min and max ExpandedIdentifiers (if they exist, ie.
Definition
DetectorDescription/Identifier/src/Range.cxx:151
Range::show
void show(std::ostream &s) const
Definition
DetectorDescription/Identifier/src/Range.cxx:274
Range::operator==
bool operator==(const Range &other) const
Definition
DetectorDescription/Identifier/src/Range.cxx:320
Range::m_fields
field_vector m_fields
Definition
DetectorDescription/Identifier/Identifier/Range.h:144
Range::add
void add(element_type value)
Add a required value. (ie. low = high = value).
Definition
DetectorDescription/Identifier/src/Range.cxx:78
Range::element_type
ExpandedIdentifier::element_type element_type
Definition
DetectorDescription/Identifier/Identifier/Range.h:34
Range::cardinalityUpTo
size_type cardinalityUpTo(const ExpandedIdentifier &id) const
Get the cardinality from the beginning up to the given ExpandedIdentifier.
Definition
DetectorDescription/Identifier/src/Range.cxx:190
Range::size_type
ExpandedIdentifier::size_type size_type
Definition
DetectorDescription/Identifier/Identifier/Range.h:35
Range::field
IdentifierField field
Definition
DetectorDescription/Identifier/Identifier/Range.h:36
Range::build
void build(const std::string &text)
Build Range from a textual description.
Definition
DetectorDescription/Identifier/src/Range.cxx:60
Range::fields
size_type fields() const
Definition
DetectorDescription/Identifier/Identifier/Range.h:150
Range::operator[]
const field & operator[](size_type index) const
Access the field elements.
Definition
DetectorDescription/Identifier/src/Range.cxx:30
Range::is_empty
bool is_empty() const
Definition
DetectorDescription/Identifier/Identifier/Range.h:157
Range::overlaps_with
bool overlaps_with(const Range &other) const
Check if two Ranges overlap.
Definition
DetectorDescription/Identifier/src/Range.cxx:260
Range::field_vector
std::vector< field > field_vector
Definition
DetectorDescription/Identifier/Identifier/Range.h:37
Range::cardinality
size_type cardinality() const
Computes a possible cardinality :
Definition
DetectorDescription/Identifier/src/Range.cxx:176
Range::clear
void clear()
Modifications.
Definition
DetectorDescription/Identifier/src/Range.cxx:123
r
int r
Definition
globals.cxx:22
index
Definition
index.py:1
Generated on
for ATLAS Offline Software by
1.17.0