ATLAS Offline Software
Loading...
Searching...
No Matches
IdDictRange.h
Go to the documentation of this file.
1 /*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef IDDICT_IdDictRange_H
6#define IDDICT_IdDictRange_H
7
9#include <string>
10#include <vector>
11
12class IdDictMgr;
14class IdDictRegion;
15class Range;
16class IdDictField;
17
19public:
35
36
37 // ==================================
38 //** @name Constructor/destructor
39 // @{
40
42 IdDictRange (const std::string& field_name);
43
45 IdDictRange (const std::string& field_name, const std::string& label);
46
48 IdDictRange (const std::string& field_name, int value);
49
51 IdDictRange (const std::string& field_name, int minvalue, int maxvalue);
52
54 IdDictRange (const std::string& field_name, const std::vector<int>& values);
55
57 IdDictRange (const std::string& field_name,
58 const std::vector<std::string>& labels);
59
60 virtual ~IdDictRange () = default;
61
62
64 // ==================================
65 //** @name Simple accessors.
66 // @{
67
68 const std::string& field_name() const;
69 const std::string& label() const;
70 const IdDictField* field() const;
72 const std::vector<int>& values() const;
73 const std::vector<std::string>& labels() const;
74
75
77 // ==================================
78 //** @name Methods used to initialize the object.
79 // @{
80
82 void set_range (const std::string& label);
83
85 void set_range (int value);
86
88 void set_range (int minvalue, int maxvalue);
89
91 void set_range (const std::vector<int>& values);
92
94 void set_range (const std::vector<std::string>& labels);
95
96
98 void set_prev(int prev);
99
100
102 void set_next(int next);
103
104
106 void set_wrap_around();
107
108 virtual void resolve_references (IdDictMgr& idd,
109 IdDictDictionary& dictionary,
110 IdDictRegion& region) override;
111 virtual void generate_implementation (const IdDictMgr& idd,
112 IdDictDictionary& dictionary,
113 IdDictRegion& region,
114 const std::string& tag = "") override;
115 virtual Range build_range () const override;
116
117
119
120
121private:
122 std::string m_field_name;
124
126 std::string m_tag;
127 std::string m_label;
128 int m_value{};
134 std::vector <std::string> m_labels;
135 std::vector <int> m_values;
136
138};
139
140
141inline
142const std::string& IdDictRange::field_name() const
143{
144 return m_field_name;
145}
146
147
148inline
149const std::string& IdDictRange::label() const
150{
151 return m_label;
152}
153
154
155inline
157{
158 return m_field;
159}
160
161
162inline
167
168
169inline
170const std::vector<int>& IdDictRange::values() const
171{
172 return m_values;
173}
174
175
176inline
177const std::vector<std::string>& IdDictRange::labels() const
178{
179 return m_labels;
180}
181
182
183#endif
184
std::vector< int > m_values
std::string m_tag
virtual ~IdDictRange()=default
const std::string & field_name() const
const std::string & label() const
const std::vector< int > & values() const
void set_range(const std::string &label)
By label.
virtual Range build_range() const override
std::string m_label
void set_next(int next)
Set next value and adjust continuation mode.
void set_prev(int prev)
Set previous value and adjust continuation mode.
std::vector< std::string > m_labels
specification_type specification() const
IdDictRange(const std::string &field_name)
Set name only; no range information.
std::string m_field_name
virtual void generate_implementation(const IdDictMgr &idd, IdDictDictionary &dictionary, IdDictRegion &region, const std::string &tag="") override
const IdDictField * field() const
virtual void resolve_references(IdDictMgr &idd, IdDictDictionary &dictionary, IdDictRegion &region) override
specification_type m_specification
void set_wrap_around()
Enable wraparound.
continuation_mode m_continuation_mode
const std::vector< std::string > & labels() const
bool m_resolved_references
IdDictField * m_field
A Range describes the possible ranges for the field values of an ExpandedIdentifier.
std::string label(const std::string &format, int i)
Definition label.h:19