ATLAS Offline Software
Public Types | Public Member Functions | Static Public Attributes | Private Attributes | List of all members
ExpandedIdentifier Class Reference

#include <ExpandedIdentifier.h>

Collaboration diagram for ExpandedIdentifier:

Public Types

using id_type = ExpandedIdentifier
 
using element_type = int
 
using element_vector = boost::container::small_vector< element_type, 12 >
 
using size_type = boost::container::small_vector< element_type, 12 >::size_type
 

Public Member Functions

 ExpandedIdentifier ()=default
 
 ExpandedIdentifier (const ExpandedIdentifier &other, size_type start)
 Constructor from a subset of another ExpandedIdentifier. More...
 
 ExpandedIdentifier (const std::string &text)
 Constructor from a textual description. More...
 
void add (element_type value)
 Append a value into a new field. More...
 
ExpandedIdentifieroperator<< (element_type value)
 
element_typeoperator[] (size_type index)
 
void set (const std::string &text)
 build from a textual description More...
 
void clear ()
 Erase all fields. More...
 
element_type operator[] (size_type index) const
 Get the value stored into the specified field. More...
 
size_type fields () const
 
auto operator (const ExpandedIdentifier &other) const
 Comparison operators. More...
 
bool operator== (const ExpandedIdentifier &other) const
 
bool match (const ExpandedIdentifier &other) const
 Test if the shorter of two ids is identical to the equivalent sub-id extracted from the longer. More...
 
 operator std::string () const
 String representation of the identifier using the input format. More...
 
void show () const
 Send to std::cout. More...
 

Static Public Attributes

static constexpr element_type max_value = 0x3FFFFFFF
 

Private Attributes

element_vector m_fields
 

Detailed Description

Definition at line 102 of file DetectorDescription/Identifier/Identifier/ExpandedIdentifier.h.

Member Typedef Documentation

◆ element_type

◆ element_vector

using ExpandedIdentifier::element_vector = boost::container::small_vector<element_type,12>

◆ id_type

◆ size_type

using ExpandedIdentifier::size_type = boost::container::small_vector<element_type,12>::size_type

Constructor & Destructor Documentation

◆ ExpandedIdentifier() [1/3]

ExpandedIdentifier::ExpandedIdentifier ( )
default

◆ ExpandedIdentifier() [2/3]

ExpandedIdentifier::ExpandedIdentifier ( const ExpandedIdentifier other,
size_type  start 
)

Constructor from a subset of another ExpandedIdentifier.

◆ ExpandedIdentifier() [3/3]

ExpandedIdentifier::ExpandedIdentifier ( const std::string &  text)

Constructor from a textual description.

Definition at line 26 of file DetectorDescription/Identifier/src/ExpandedIdentifier.cxx.

26  {
27  set (text);
28 }

Member Function Documentation

◆ add()

void ExpandedIdentifier::add ( element_type  value)

Append a value into a new field.

◆ clear()

void ExpandedIdentifier::clear ( )

Erase all fields.

◆ fields()

size_type ExpandedIdentifier::fields ( ) const

◆ match()

bool ExpandedIdentifier::match ( const ExpandedIdentifier other) const

Test if the shorter of two ids is identical to the equivalent sub-id extracted from the longer.

◆ operator()

auto ExpandedIdentifier::operator ( const ExpandedIdentifier other) const

Comparison operators.

◆ operator std::string()

ExpandedIdentifier::operator std::string ( ) const

String representation of the identifier using the input format.

Definition at line 55 of file DetectorDescription/Identifier/src/ExpandedIdentifier.cxx.

55  {
56  return show_vector(m_fields);
57 }

◆ operator<<()

◆ operator==()

◆ operator[]() [1/2]

◆ operator[]() [2/2]

Get the value stored into the specified field.

◆ set()

void ExpandedIdentifier::set ( const std::string &  text)

build from a textual description

Definition at line 32 of file DetectorDescription/Identifier/src/ExpandedIdentifier.cxx.

32  {
33  clear ();
34  if (text.empty()) return;
35  const char *start = text.c_str();
36  const char *last = start+text.size();
37  static constexpr auto ok=std::errc{};
38  int v{};
39  bool foundNumber{};
40  for (const char * p=start;p<last;++p){
41  auto [ptr,ec] = std::from_chars(p, last,v);
42  p=ptr;
43  if (ec != ok) continue;
44  add ((element_type) v);
45  foundNumber = true;
46  }
47  if (not foundNumber){
48  const std::string msg = "ExpandedIdentifier::set: '"+ text + "' is not a valid input string.";
49  throw std::invalid_argument(msg);
50  }
51 }

◆ show()

void ExpandedIdentifier::show ( ) const

Send to std::cout.

Definition at line 60 of file DetectorDescription/Identifier/src/ExpandedIdentifier.cxx.

60  {
61  std::cout<< "["<< show_vector (m_fields,".") <<"]";
62 }

Member Data Documentation

◆ m_fields

element_vector ExpandedIdentifier::m_fields
private

◆ max_value

constexpr element_type ExpandedIdentifier::max_value = 0x3FFFFFFF
staticconstexpr

The documentation for this class was generated from the following files:
mergePhysValFiles.start
start
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:14
ExpandedIdentifier::add
void add(element_type value)
Append a value into a new field.
dbg::ptr
void * ptr(T *p)
Definition: SGImplSvc.cxx:74
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
ExpandedIdentifier::set
void set(const std::string &text)
build from a textual description
Definition: DetectorDescription/Identifier/src/ExpandedIdentifier.cxx:32
ExpandedIdentifier::m_fields
element_vector m_fields
Definition: DetectorDescription/Identifier/Identifier/ExpandedIdentifier.h:161
python.PyAthena.v
v
Definition: PyAthena.py:154
ExpandedIdentifier::clear
void clear()
Erase all fields.
makeTransCanvas.text
text
Definition: makeTransCanvas.py:11
ExpandedIdentifier::element_type
int element_type
Definition: DetectorDescription/Identifier/Identifier/ExpandedIdentifier.h:106
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7