 |
ATLAS Offline Software
|
Go to the documentation of this file.
5 #ifndef IDENTIFIER_IDENTIFIERFIELD_H
6 #define IDENTIFIER_IDENTIFIERFIELD_H
124 inline std::pair<element_type, element_type>
135 return std::get<element_vector>(
m_data);
160 void set (
bool wraparound);
168 operator std::string ()
const;
199 std::variant<element_vector, BoundedRange>
m_data{};
214 if (
const auto *
p{std::get_if<BoundedRange>(&
m_data)};
p) {
216 throw std::out_of_range(
"IdentifierField::get_value_at");
218 return (
p->first +
index);
220 return ((std::get<element_vector>(
m_data)).at(
index));
size_type get_bits() const
Return the number of bits needed to store a value of this field.
ExpandedIdentifier::element_type element_type
std::pair< element_type, element_type > get_minmax() const
bool overlaps_with(const IdentifierField &other) const
Check whether two IdentifierFields overlap (Are there any values which satisfy the constraints of bot...
element_type get_minimum() const
Query the values.
static constexpr int m_maxNumberOfIndices
const element_vector & get_values() const
element_type get_maximum() const
void set(element_type minimum, element_type maximum)
continuation_mode m_continuation_mode
void create_index_table()
Create index table from value table.
void set_minimum(element_type value)
bool match(element_type value) const
The basic match operation Given a value, test to see if it satisfies the constraints for this field.
const index_vector & get_indexes() const
size_type get_value_index(element_type value) const
bool operator==(const IdentifierField &other) const
bool empty() const
If true, this field does not have any constraints, and may hold any value representable by element_ty...
static constexpr auto minimum_possible
void set_maximum(element_type value)
std::variant< element_vector, BoundedRange > m_data
bool get_next(element_type current, element_type &next) const
bool isEnumerated() const
boost::container::small_vector< element_type, 12 >::size_type size_type
std::vector< element_type > element_vector
void set_previous(int previous)
bool check_for_both_bounded()
Check mode - switch from enumerated to both_bounded if possible.
ExpandedIdentifier::size_type size_type
static constexpr auto maximum_possible
std::vector< size_type > index_vector
void set(const element_vector &values)
void operator|=(const IdentifierField &other)
Find the union of two fields.
std::ostream & operator<<(std::ostream &out, const IdentifierField &c)
This is the individual specification for the range of one ExpandedIdentifier IdentifierField.
std::pair< element_type, element_type > BoundedRange
element_type get_value_at(size_type index) const
bool get_previous(element_type current, element_type &previous) const
Returns false if previous/next is at end of range, or not possible.
static constexpr auto invalidValues
void optimize()
Optimize - try to switch mode to both_bounded, set up lookup table for finding index from value.
std::istream & operator>>(std::istream &in, IdentifierField &c)
void add_value(element_type value)
size_type get_indices() const
IdentifierField()=default
Create a wild-card value.