 |
ATLAS Offline Software
|
Go to the documentation of this file.
9 # pragma GCC diagnostic ignored "-Wstringop-overread"
39 field_vector::const_iterator
it =
other.m_fields.begin ();
46 if (
text.empty())
return;
47 std::istringstream in(
text);
59 if (
text.empty())
return;
60 std::istringstream in(
text);
99 for (
size_t i = 0;
i < subrange.
fields (); ++
i) {
109 size_t sz = subrange.m_fields.size();
111 for (
size_t i = 0;
i <
sz; ++
i) {
112 m_fields.emplace_back (std::move(subrange.m_fields[
i]));
129 const size_type id_fields =
id.fields ();
140 if (!
f.match (
id[field_number]))
return (0);
153 for (
size_type field_number = 0; field_number < my_fields; field_number++) {
166 for (
size_type field_number = 0; field_number < my_fields; field_number++) {
176 const Range& me = *
this;
191 const Range& me = *
this;
197 bool is_match =
true;
202 if (
f.empty())
return 0;
203 if (
f.isEnumerated()) {
212 if (
id[
level] <=
f.get_values()[j]) {
213 if (
id[
level] !=
f.get_values()[j]) {
223 if (
f.get_maximum() <
id[
level]) {
227 }
else if (
id[
level] <
f.get_minimum()) {
235 if (!is_match)
break;
244 card *=
f.get_indices();
259 const Range& me = *
this;
260 if ((
fields () == 0) || (
other.fields () == 0))
return (
false);
264 if (!
f1.overlaps_with (
f2))
return (
false);
275 const Range& me = *
this;
276 s << (std::string) me <<
" (";
294 s <<
"=" << allbits <<
") ";
298 Range::operator std::string ()
const {
301 if (my_fields == 0)
return (
result);
303 for (
size_type field_number = 0; field_number < my_fields; field_number++) {
304 const field&
f = m_fields[field_number];
305 if (field_number > 0)
result +=
"/";
315 field_vector::const_iterator
it1 =
m_fields.begin();
316 field_vector::const_iterator it2 =
other.m_fields.begin();
317 field_vector::const_iterator last =
m_fields.end();
318 for (;
it1 != last; ++
it1, ++it2) {
319 if ((*
it1) != (*it2))
return false;
338 for (
int c{};
c!=EOF;
c=in.peek()){
342 if (
int c = in.peek();(
c ==
'/') or (
c ==
' ')){
void clear()
Modifications.
bool operator==(const Range &other) const
ExpandedIdentifier::size_type size_type
int match(const ExpandedIdentifier &id) const
Match an identifier.
std::pair< long int, long int > indices
ExpandedIdentifier maximum() const
ExpandedIdentifier minimum() const
min and max ExpandedIdentifiers (if they exist, ie.
std::ostream & operator<<(std::ostream &out, const Range &r)
std::vector< HWIdentifier >::iterator it1
std::istream & operator>>(std::istream &in, Range &r)
const field & operator[](size_type index) const
Access the field elements.
A Range describes the possible ranges for the field values of an ExpandedIdentifier.
This is the individual specification for the range of one ExpandedIdentifier IdentifierField.
bool overlaps_with(const Range &other) const
Check if two Ranges overlap.
void add(element_type value)
Add a required value. (ie. low = high = value)
size_type cardinality() const
Computes a possible cardinality :
void build(const std::string &text)
Build Range from a textual description.
ExpandedIdentifier::element_type element_type
size_type cardinalityUpTo(const ExpandedIdentifier &id) const
Get the cardinality from the beginning up to the given ExpandedIdentifier.