This is the individual specification for the range of one ExpandedIdentifier IdentifierField.
More...
#include <IdentifierField.h>
This is the individual specification for the range of one ExpandedIdentifier IdentifierField.
Definition at line 20 of file IdentifierField.h.
◆ BoundedRange
◆ element_type
◆ element_vector
◆ index_vector
◆ size_type
◆ continuation_mode
Enumerator |
---|
none | |
has_next | |
has_previous | |
has_both | |
has_wrap_around | |
Definition at line 32 of file IdentifierField.h.
◆ IdentifierField() [1/4]
IdentifierField::IdentifierField |
( |
| ) |
|
|
default |
Create a wild-card value.
◆ IdentifierField() [2/4]
Create a unique value (understood as : low bound = high bound = value)
Definition at line 82 of file IdentifierField.cxx.
◆ IdentifierField() [3/4]
Create a full range specification (with explicit min and max)
Definition at line 92 of file IdentifierField.cxx.
93 set(minimum, maximum);
◆ IdentifierField() [4/4]
◆ add_value()
Definition at line 249 of file IdentifierField.cxx.
250 if (
auto *
p = dataPtr<element_vector>(); !
p) {
256 if (std::ranges::binary_search(*
p,
value))
return;
258 std::ranges::sort(*
p);
◆ check_for_both_bounded()
bool IdentifierField::check_for_both_bounded |
( |
| ) |
|
Check mode - switch from enumerated to both_bounded if possible.
Definition at line 429 of file IdentifierField.cxx.
◆ clear()
void IdentifierField::clear |
( |
| ) |
|
◆ create_index_table()
void IdentifierField::create_index_table |
( |
| ) |
|
|
private |
Create index table from value table.
Create index table from value table
Definition at line 443 of file IdentifierField.cxx.
457 auto &
v = std::get<element_vector>(
m_data);
458 for (
const auto & thisValue:
v) {
463 std::cout <<
"size, value, index, i "
464 <<
size <<
" " << thisValue <<
" "
465 <<
index <<
" " <<
i++ <<
" min, max "
◆ dataPtr()
template<class T >
T* IdentifierField::dataPtr |
( |
| ) |
|
|
inlineprivate |
◆ empty()
bool IdentifierField::empty |
( |
| ) |
const |
|
inline |
◆ get_bits()
◆ get_indexes()
◆ get_indices()
size_type IdentifierField::get_indices |
( |
| ) |
const |
|
inline |
◆ get_maximum()
◆ get_minimum()
◆ get_minmax()
◆ get_next()
◆ get_previous()
Returns false if previous/next is at end of range, or not possible.
Definition at line 105 of file IdentifierField.cxx.
◆ get_value_at()
Definition at line 141 of file IdentifierField.h.
146 if (
const auto *
p{std::get_if<BoundedRange>(&
m_data)};
p) {
148 throw std::out_of_range(
"IdentifierField::get_value_at");
150 return (
p->first +
index);
152 return ((std::get<element_vector>(
m_data)).at(
index));
◆ get_value_index()
◆ get_values()
◆ isBounded()
bool IdentifierField::isBounded |
( |
| ) |
const |
|
inline |
◆ isEnumerated()
bool IdentifierField::isEnumerated |
( |
| ) |
const |
|
inline |
◆ match()
◆ operator std::string()
IdentifierField::operator std::string |
( |
| ) |
const |
◆ operator==()
◆ operator[]()
◆ operator|=()
If there is no overlap we should build a multi-segment specification. The current algorithm is only correct if the overlap in not empty !! A multi-segment specification might also be implemented as an expanded enumerated set (not very optimized !!)
Definition at line 318 of file IdentifierField.cxx.
◆ optimize()
void IdentifierField::optimize |
( |
| ) |
|
Optimize - try to switch mode to both_bounded, set up lookup table for finding index from value.
Check mode - switch from enumerated to both_bounded if possible
Definition at line 421 of file IdentifierField.cxx.
◆ overlaps_with()
Check whether two IdentifierFields overlap.
Definition at line 193 of file IdentifierField.cxx.
202 for (
const auto &
v:
ev) {
208 for (
const auto &
v:
ev){
209 if ((
v >=
other.m_minimum) and (
v <=
other.m_maximum))
return (
true);
◆ set() [1/3]
void IdentifierField::set |
( |
bool |
wraparound | ) |
|
◆ set() [2/3]
◆ set() [3/3]
◆ set_maximum()
◆ set_minimum()
◆ set_next()
void IdentifierField::set_next |
( |
int |
next | ) |
|
◆ set_previous()
void IdentifierField::set_previous |
( |
int |
previous | ) |
|
◆ show()
void IdentifierField::show |
( |
| ) |
const |
Definition at line 375 of file IdentifierField.cxx.
377 std::cout <<
"values ";
379 std::cout <<
v <<
" ";
381 std::cout <<
"indexes ";
383 std::cout <<
idx <<
" ";
385 std::cout <<
"indices " <<
m_size <<
" ";
387 std::cout <<
"next " <<
m_next <<
" ";
388 std::cout <<
"mode ";
390 std::cout <<
"unbounded ";
392 std::cout <<
"both_bounded ";
394 std::cout <<
"enumerated ";
396 std::cout <<
"cont mode ";
399 std::cout <<
"none ";
402 std::cout <<
"has_next ";
405 std::cout <<
"has_previous ";
408 std::cout <<
"has_both ";
411 std::cout <<
"has_wrap_around ";
414 std::cout << std::endl;
◆ wrap_around()
bool IdentifierField::wrap_around |
( |
| ) |
const |
|
inline |
◆ invalidValues
◆ m_continuation_mode
◆ m_data
◆ m_empty
bool IdentifierField::m_empty {true} |
|
private |
◆ m_indexes
◆ m_maximum
◆ m_maxNumberOfIndices
constexpr int IdentifierField::m_maxNumberOfIndices = 100 |
|
staticconstexprprivate |
◆ m_minimum
◆ m_next
◆ m_previous
◆ m_size
◆ maximum_possible
constexpr auto IdentifierField::maximum_possible = std::numeric_limits<element_type>::max() |
|
staticconstexpr |
◆ minimum_possible
constexpr auto IdentifierField::minimum_possible = std::numeric_limits<element_type>::min() |
|
staticconstexpr |
The documentation for this class was generated from the following files: