ATLAS Offline Software
Public Member Functions | Public Attributes | List of all members
IdDictField Class Reference

#include <IdDictDefs.h>

Collaboration diagram for IdDictField:

Public Member Functions

IdDictLabelfind_label (const std::string &name) const
 
void add_label (IdDictLabel *label)
 
size_t get_label_number () const
 
const std::string & get_label (size_t index) const
 
ExpandedIdentifier::element_type get_label_value (const std::string &name) const
 
void resolve_references (const IdDictMgr &idd)
 
void generate_implementation (const IdDictMgr &idd, const std::string &tag="")
 
void reset_implementation ()
 
bool verify () const
 
void clear ()
 

Public Attributes

std::string m_name
 
std::vector< IdDictLabel * > m_labels
 
size_t m_index {}
 

Detailed Description

Definition at line 316 of file IdDictDefs.h.

Member Function Documentation

◆ add_label()

void IdDictField::add_label ( IdDictLabel label)

Definition at line 1921 of file IdDictMgr.cxx.

1921  {
1922  m_labels.push_back (label);
1923 }

◆ clear()

void IdDictField::clear ( )

Definition at line 1955 of file IdDictMgr.cxx.

1955  {
1956  for (size_t i = 0; i < m_labels.size (); ++i) {
1957  IdDictLabel* label = m_labels[i];
1958  delete label;
1959  }
1960  m_labels.clear ();
1961 }

◆ find_label()

IdDictLabel * IdDictField::find_label ( const std::string &  name) const

Definition at line 1909 of file IdDictMgr.cxx.

1910 {
1911  for (size_t i = 0; i < m_labels.size (); ++i)
1912  {
1913  IdDictLabel* label = m_labels[i];
1914  if ((label != 0) && (label->m_name == name)) return (label);
1915  }
1916 
1917  return (0);
1918 }

◆ generate_implementation()

void IdDictField::generate_implementation ( const IdDictMgr idd,
const std::string &  tag = "" 
)

Definition at line 1895 of file IdDictMgr.cxx.

1897 {
1898 }

◆ get_label()

const std::string & IdDictField::get_label ( size_t  index) const

Definition at line 1931 of file IdDictMgr.cxx.

1931  {
1932  return m_labels.at(index)->m_name;
1933 }

◆ get_label_number()

size_t IdDictField::get_label_number ( ) const

Definition at line 1926 of file IdDictMgr.cxx.

1926  {
1927  return m_labels.size ();
1928 }

◆ get_label_value()

ExpandedIdentifier::element_type IdDictField::get_label_value ( const std::string &  name) const

Definition at line 1936 of file IdDictMgr.cxx.

1936  {
1938  try{
1939  value = std::stoi(name);
1940  return value;
1941  } catch (std::invalid_argument & e){
1942  for (const auto *label:m_labels) {
1943  if (label == nullptr) continue;
1944  if (label->m_valued) value = label->m_value;
1945  if (label->m_name == name) {
1946  return (value);
1947  }
1948  value++;
1949  }
1950  }
1951  std::cerr << "Warning : label " << name << " not found" << std::endl;
1952  return (0);
1953 }

◆ reset_implementation()

void IdDictField::reset_implementation ( )

Definition at line 1900 of file IdDictMgr.cxx.

1901 {
1902 }

◆ resolve_references()

void IdDictField::resolve_references ( const IdDictMgr idd)

Definition at line 1891 of file IdDictMgr.cxx.

1892 {
1893 }

◆ verify()

bool IdDictField::verify ( ) const

Definition at line 1904 of file IdDictMgr.cxx.

1905 {
1906  return (true);
1907 }

Member Data Documentation

◆ m_index

size_t IdDictField::m_index {}

Definition at line 331 of file IdDictDefs.h.

◆ m_labels

std::vector<IdDictLabel*> IdDictField::m_labels

Definition at line 330 of file IdDictDefs.h.

◆ m_name

std::string IdDictField::m_name

Definition at line 329 of file IdDictDefs.h.


The documentation for this class was generated from the following files:
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
index
Definition: index.py:1
PlotCalibFromCool.label
label
Definition: PlotCalibFromCool.py:78
athena.value
value
Definition: athena.py:124
lumiFormat.i
int i
Definition: lumiFormat.py:85
IdDictLabel
Definition: IdDictDefs.h:334
IdDictField::m_labels
std::vector< IdDictLabel * > m_labels
Definition: IdDictDefs.h:330
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
ExpandedIdentifier::element_type
int element_type
Definition: DetectorDescription/Identifier/Identifier/ExpandedIdentifier.h:106