ATLAS Offline Software
|
A Range describes the possible ranges for the field values of an ExpandedIdentifier. More...
#include <Range.h>
Public Types | |
using | element_type = ExpandedIdentifier::element_type |
using | size_type = ExpandedIdentifier::size_type |
using | field = IdentifierField |
using | field_vector = std::vector< field > |
Public Member Functions | |
Range ()=default | |
Range (const Range &other, size_type start) | |
This is a sub-range copy constructor. More... | |
Range (const ExpandedIdentifier &root) | |
Construct from a simple ExpandedIdentifier. More... | |
Range (const std::string &text) | |
void | build (const std::string &text) |
Build Range from a textual description. More... | |
void | build (const ExpandedIdentifier &root) |
Build a range from a single ExpandedIdentifier (see similar constructor for comment) More... | |
void | clear () |
Modifications. More... | |
void | add () |
Add a wild card field. More... | |
void | add (element_type value) |
Add a required value. (ie. low = high = value) More... | |
void | add (element_type minimum, element_type maximum) |
Add a bounded value. More... | |
void | add (const field &f) |
Add a range specified using a field More... | |
void | add (field &&f) |
Add a range specified using a field, with move semantics. More... | |
void | add (const Range &subrange) |
Append a subrange. More... | |
void | add (Range &&subrange) |
Append a subrange, with move semantics. More... | |
int | match (const ExpandedIdentifier &id) const |
Match an identifier. More... | |
const field & | operator[] (size_type index) const |
Access the field elements. More... | |
size_type | fields () const |
bool | is_empty () const |
ExpandedIdentifier | minimum () const |
min and max ExpandedIdentifiers (if they exist, ie. More... | |
ExpandedIdentifier | maximum () const |
size_type | cardinality () const |
Computes a possible cardinality : More... | |
size_type | cardinalityUpTo (const ExpandedIdentifier &id) const |
Get the cardinality from the beginning up to the given ExpandedIdentifier. More... | |
bool | overlaps_with (const Range &other) const |
Check if two Ranges overlap. More... | |
void | show () const |
void | show (std::ostream &s) const |
operator std::string () const | |
Produce a textual representation of the range using the input format. More... | |
bool | operator== (const Range &other) const |
Private Attributes | |
field_vector | m_fields |
A Range describes the possible ranges for the field values of an ExpandedIdentifier.
Specifications can be : No bound * Low bound n: High bound :m Both bounds n:m Enumeration v1, v2, v3, ... , vn
Trailing * are implicit for all trailing fields
Definition at line 29 of file DetectorDescription/Identifier/Identifier/Range.h.
Definition at line 32 of file DetectorDescription/Identifier/Identifier/Range.h.
using Range::field = IdentifierField |
Definition at line 34 of file DetectorDescription/Identifier/Identifier/Range.h.
using Range::field_vector = std::vector<field> |
Definition at line 35 of file DetectorDescription/Identifier/Identifier/Range.h.
Definition at line 33 of file DetectorDescription/Identifier/Identifier/Range.h.
|
default |
This is a sub-range copy constructor.
It copies the portion of the other Range, starting from the
specified starting index up to its last field.
Definition at line 37 of file DetectorDescription/Identifier/src/Range.cxx.
Range::Range | ( | const ExpandedIdentifier & | root | ) |
Construct from a simple ExpandedIdentifier.
This implies that all fields will have their min=max=id[i]
Definition at line 52 of file DetectorDescription/Identifier/src/Range.cxx.
|
explicit |
Definition at line 45 of file DetectorDescription/Identifier/src/Range.cxx.
void Range::add | ( | ) |
Add a wild card field.
Definition at line 75 of file DetectorDescription/Identifier/src/Range.cxx.
Add a range specified using a field
Definition at line 92 of file DetectorDescription/Identifier/src/Range.cxx.
void Range::add | ( | element_type | minimum, |
element_type | maximum | ||
) |
Add a bounded value.
Definition at line 85 of file DetectorDescription/Identifier/src/Range.cxx.
void Range::add | ( | element_type | value | ) |
Add a required value. (ie. low = high = value)
Definition at line 80 of file DetectorDescription/Identifier/src/Range.cxx.
void Range::add | ( | field && | f | ) |
Add a range specified using a field, with move semantics.
Add a range specified using a field, using move semantics.
Definition at line 97 of file DetectorDescription/Identifier/src/Range.cxx.
void Range::add | ( | Range && | subrange | ) |
Append a subrange, with move semantics.
Definition at line 109 of file DetectorDescription/Identifier/src/Range.cxx.
void Range::build | ( | const ExpandedIdentifier & | root | ) |
Build a range from a single ExpandedIdentifier (see similar constructor for comment)
Definition at line 65 of file DetectorDescription/Identifier/src/Range.cxx.
void Range::build | ( | const std::string & | text | ) |
Build Range from a textual description.
The syntax is :
range : <value-range> [ "/" <value-range> ... ]
value-range : "*" | <value> | ":" <max> | <min> ":" | <min> ":" <max> | <value> "," <value> "," ... "," <value>
Definition at line 58 of file DetectorDescription/Identifier/src/Range.cxx.
Range::size_type Range::cardinality | ( | ) | const |
Computes a possible cardinality :
Definition at line 239 of file DetectorDescription/Identifier/src/Range.cxx.
Range::size_type Range::cardinalityUpTo | ( | const ExpandedIdentifier & | id | ) | const |
Get the cardinality from the beginning up to the given ExpandedIdentifier.
Definition at line 253 of file DetectorDescription/Identifier/src/Range.cxx.
void Range::clear | ( | ) |
Modifications.
Definition at line 125 of file DetectorDescription/Identifier/src/Range.cxx.
|
inline |
Definition at line 151 of file DetectorDescription/Identifier/Identifier/Range.h.
|
inline |
Definition at line 158 of file DetectorDescription/Identifier/Identifier/Range.h.
int Range::match | ( | const ExpandedIdentifier & | id | ) | const |
ExpandedIdentifier Range::maximum | ( | ) | const |
Definition at line 187 of file DetectorDescription/Identifier/src/Range.cxx.
ExpandedIdentifier Range::minimum | ( | ) | const |
min and max ExpandedIdentifiers
(if they exist, ie.
for fully bounded Ranges) Question : what if the Range has wild cards ??
Definition at line 158 of file DetectorDescription/Identifier/src/Range.cxx.
Range::operator std::string | ( | ) | const |
Produce a textual representation of the range using the input format.
Definition at line 363 of file DetectorDescription/Identifier/src/Range.cxx.
Definition at line 383 of file DetectorDescription/Identifier/src/Range.cxx.
const Range::field & Range::operator[] | ( | Range::size_type | index | ) | const |
Check if two Ranges overlap.
Check overlap between two Ranges :
As soon as one pair of corresponding fields do not match, the global overlap is empty.
Definition at line 323 of file DetectorDescription/Identifier/src/Range.cxx.
void Range::show | ( | ) | const |
Definition at line 335 of file DetectorDescription/Identifier/src/Range.cxx.
void Range::show | ( | std::ostream & | s | ) | const |
Definition at line 339 of file DetectorDescription/Identifier/src/Range.cxx.
|
private |
Definition at line 145 of file DetectorDescription/Identifier/Identifier/Range.h.