ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
DetectorDescription
IdDict
IdDict
IdDictRange.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 IDDICT_IdDictRange_H
6
#define IDDICT_IdDictRange_H
7
8
#include "
IdDict/IdDictRegionEntry.h
"
9
#include <string>
10
#include <string_view>
11
#include <vector>
12
13
class
IdDictMgr
;
14
class
IdDictDictionary
;
15
class
IdDictRegion
;
16
class
Range
;
17
class
IdDictField
;
18
19
class
IdDictRange
:
public
IdDictRegionEntry
{
20
public
:
21
enum
specification_type
{
22
unknown
,
23
by_value
,
24
by_values
,
25
by_label
,
26
by_labels
,
27
by_minmax
28
};
29
enum
continuation_mode
{
30
none
,
31
has_next
,
32
has_previous
,
33
has_both
,
34
wrap_around
35
};
36
37
38
// ==================================
39
//** @name Constructor/destructor
40
// @{
41
43
IdDictRange
(
const
std::string&
field_name
);
44
46
IdDictRange
(
const
std::string&
field_name
,
const
std::string&
label
);
47
49
IdDictRange
(
const
std::string&
field_name
,
int
value);
50
52
IdDictRange
(
const
std::string&
field_name
,
int
minvalue,
int
maxvalue);
53
55
IdDictRange
(
const
std::string&
field_name
,
const
std::vector<int>&
values
);
56
58
IdDictRange
(
const
std::string&
field_name
,
59
const
std::vector<std::string>&
labels
);
60
61
virtual
~IdDictRange
() =
default
;
62
63
65
// ==================================
66
//** @name Simple accessors.
67
// @{
68
69
const
std::string&
field_name
()
const
;
70
const
std::string&
label
()
const
;
71
const
IdDictField
*
field
()
const
;
72
specification_type
specification
()
const
;
73
const
std::vector<int>&
values
()
const
;
74
const
std::vector<std::string>&
labels
()
const
;
75
76
78
// ==================================
79
//** @name Methods used to initialize the object.
80
// @{
81
83
void
set_range
(
const
std::string&
label
);
84
86
void
set_range
(
int
value);
87
89
void
set_range
(
int
minvalue,
int
maxvalue);
90
92
void
set_range
(
const
std::vector<int>&
values
);
93
95
void
set_range
(
const
std::vector<std::string>&
labels
);
96
97
99
void
set_prev
(
int
prev);
100
101
103
void
set_next
(
int
next);
104
105
107
void
set_wrap_around
();
108
109
virtual
void
resolve_references
(
IdDictMgr
& idd,
110
IdDictDictionary
& dictionary,
111
IdDictRegion
& region)
override
;
112
virtual
void
generate_implementation
(
const
IdDictMgr
& idd,
113
IdDictDictionary
& dictionary,
114
IdDictRegion
& region,
115
std::string_view tag =
""
)
override
;
116
virtual
Range
build_range
()
const override
;
117
118
120
121
122
private
:
123
std::string
m_field_name
;
124
IdDictField
*
m_field
{};
125
126
specification_type
m_specification
{
unknown
};
127
std::string
m_tag
;
128
std::string
m_label
;
129
int
m_value
{};
130
int
m_minvalue
{};
131
int
m_maxvalue
{};
132
int
m_prev_value
{};
133
int
m_next_value
{};
134
continuation_mode
m_continuation_mode
{
none
};
135
std::vector <std::string>
m_labels
;
136
std::vector <int>
m_values
;
137
138
bool
m_resolved_references
{};
139
};
140
141
142
inline
143
const
std::string&
IdDictRange::field_name
()
const
144
{
145
return
m_field_name
;
146
}
147
148
149
inline
150
const
std::string&
IdDictRange::label
()
const
151
{
152
return
m_label
;
153
}
154
155
156
inline
157
const
IdDictField
*
IdDictRange::field
()
const
158
{
159
return
m_field
;
160
}
161
162
163
inline
164
IdDictRange::specification_type
IdDictRange::specification
()
const
165
{
166
return
m_specification
;
167
}
168
169
170
inline
171
const
std::vector<int>&
IdDictRange::values
()
const
172
{
173
return
m_values
;
174
}
175
176
177
inline
178
const
std::vector<std::string>&
IdDictRange::labels
()
const
179
{
180
return
m_labels
;
181
}
182
183
184
#endif
185
IdDictRegionEntry.h
IdDictDictionary
Definition
IdDictDictionary.h:33
IdDictField
Definition
IdDictField.h:16
IdDictMgr
Definition
IdDictMgr.h:17
IdDictRange::m_value
int m_value
Definition
IdDictRange.h:129
IdDictRange::m_values
std::vector< int > m_values
Definition
IdDictRange.h:136
IdDictRange::m_tag
std::string m_tag
Definition
IdDictRange.h:127
IdDictRange::m_prev_value
int m_prev_value
Definition
IdDictRange.h:132
IdDictRange::~IdDictRange
virtual ~IdDictRange()=default
IdDictRange::m_maxvalue
int m_maxvalue
Definition
IdDictRange.h:131
IdDictRange::m_next_value
int m_next_value
Definition
IdDictRange.h:133
IdDictRange::field_name
const std::string & field_name() const
Definition
IdDictRange.h:143
IdDictRange::label
const std::string & label() const
Definition
IdDictRange.h:150
IdDictRange::values
const std::vector< int > & values() const
Definition
IdDictRange.h:171
IdDictRange::continuation_mode
continuation_mode
Definition
IdDictRange.h:29
IdDictRange::wrap_around
@ wrap_around
Definition
IdDictRange.h:34
IdDictRange::has_previous
@ has_previous
Definition
IdDictRange.h:32
IdDictRange::has_next
@ has_next
Definition
IdDictRange.h:31
IdDictRange::none
@ none
Definition
IdDictRange.h:30
IdDictRange::has_both
@ has_both
Definition
IdDictRange.h:33
IdDictRange::set_range
void set_range(const std::string &label)
By label.
Definition
IdDictRange.cxx:68
IdDictRange::build_range
virtual Range build_range() const override
Definition
IdDictRange.cxx:237
IdDictRange::m_label
std::string m_label
Definition
IdDictRange.h:128
IdDictRange::m_minvalue
int m_minvalue
Definition
IdDictRange.h:130
IdDictRange::set_next
void set_next(int next)
Set next value and adjust continuation mode.
Definition
IdDictRange.cxx:117
IdDictRange::set_prev
void set_prev(int prev)
Set previous value and adjust continuation mode.
Definition
IdDictRange.cxx:109
IdDictRange::m_labels
std::vector< std::string > m_labels
Definition
IdDictRange.h:135
IdDictRange::generate_implementation
virtual void generate_implementation(const IdDictMgr &idd, IdDictDictionary &dictionary, IdDictRegion ®ion, std::string_view tag="") override
Definition
IdDictRange.cxx:177
IdDictRange::specification
specification_type specification() const
Definition
IdDictRange.h:164
IdDictRange::IdDictRange
IdDictRange(const std::string &field_name)
Set name only; no range information.
Definition
IdDictRange.cxx:16
IdDictRange::m_field_name
std::string m_field_name
Definition
IdDictRange.h:123
IdDictRange::specification_type
specification_type
Definition
IdDictRange.h:21
IdDictRange::by_labels
@ by_labels
Definition
IdDictRange.h:26
IdDictRange::by_value
@ by_value
Definition
IdDictRange.h:23
IdDictRange::by_label
@ by_label
Definition
IdDictRange.h:25
IdDictRange::by_minmax
@ by_minmax
Definition
IdDictRange.h:27
IdDictRange::by_values
@ by_values
Definition
IdDictRange.h:24
IdDictRange::unknown
@ unknown
Definition
IdDictRange.h:22
IdDictRange::field
const IdDictField * field() const
Definition
IdDictRange.h:157
IdDictRange::resolve_references
virtual void resolve_references(IdDictMgr &idd, IdDictDictionary &dictionary, IdDictRegion ®ion) override
Definition
IdDictRange.cxx:132
IdDictRange::m_specification
specification_type m_specification
Definition
IdDictRange.h:126
IdDictRange::set_wrap_around
void set_wrap_around()
Enable wraparound.
Definition
IdDictRange.cxx:125
IdDictRange::m_continuation_mode
continuation_mode m_continuation_mode
Definition
IdDictRange.h:134
IdDictRange::labels
const std::vector< std::string > & labels() const
Definition
IdDictRange.h:178
IdDictRange::m_resolved_references
bool m_resolved_references
Definition
IdDictRange.h:138
IdDictRange::m_field
IdDictField * m_field
Definition
IdDictRange.h:124
IdDictRegionEntry::IdDictRegionEntry
IdDictRegionEntry()
IdDictRegion
Definition
IdDictRegion.h:22
Range
A Range describes the possible ranges for the field values of an ExpandedIdentifier.
Definition
DetectorDescription/Identifier/Identifier/Range.h:31
label
std::string label(const std::string &format, int i)
Definition
label.h:19
Generated on
for ATLAS Offline Software by
1.17.0