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

#include <IdDictMgr.h>

Collaboration diagram for IdDictMgr:

Public Types

typedef std::map< std::string, IdDictDictionary * > dictionary_map
 
typedef std::map< std::string, std::string > metadata_map
 

Public Member Functions

 IdDictMgr ()
 
 ~IdDictMgr ()
 
const std::string & tag () const
 Version tag. More...
 
IdDictDictionaryfind_dictionary (const std::string &name) const
 Access dictionary by name. More...
 
const dictionary_mapget_dictionary_map () const
 Access to all dictionaries. More...
 
const std::string & DTD_version () const
 DTD version. More...
 
bool do_checks () const
 Check whether or not to do checks for ids. More...
 
bool do_neighbours () const
 Check whether or not to init neighbours. More...
 
const std::string & find_metadata (const std::string &name) const
 Access to meta data, name/value pairs. More...
 
void add_dictionary (IdDictDictionary *dictionary)
 Fillers: More...
 
void add_subdictionary_name (const std::string &name)
 
void add_metadata (const std::string &name, const std::string &value)
 
void set_DTD_version (const std::string &DTD_version)
 
void set_do_checks (bool do_checks)
 
void set_do_neighbours (bool do_neighbours)
 
void resolve_references ()
 Construct dictionary after parsing. More...
 
void generate_implementation (const std::string &tag="")
 
void reset_implementation ()
 Reset of implementation. More...
 
void clear ()
 
bool verify () const
 

Private Member Functions

void find_subdicts (IdDictDictionary *dict)
 

Private Attributes

std::string m_DTD_version
 
std::string m_tag
 
dictionary_map m_dictionaries
 
metadata_map m_metadata
 
std::set< std::string > m_subdictionary_names
 
bool m_resolved_references
 
bool m_generated_implementation
 
bool m_do_checks
 
bool m_do_neighbours
 

Detailed Description

Definition at line 14 of file IdDictMgr.h.

Member Typedef Documentation

◆ dictionary_map

typedef std::map<std::string, IdDictDictionary*> IdDictMgr::dictionary_map

Definition at line 16 of file IdDictMgr.h.

◆ metadata_map

typedef std::map<std::string, std::string> IdDictMgr::metadata_map

Definition at line 17 of file IdDictMgr.h.

Constructor & Destructor Documentation

◆ IdDictMgr()

IdDictMgr::IdDictMgr ( )

Definition at line 44 of file IdDictMgr.cxx.

45  :
46  m_resolved_references(false),
48  m_do_checks(false),
49  m_do_neighbours(true) {
50 }

◆ ~IdDictMgr()

IdDictMgr::~IdDictMgr ( )

Definition at line 52 of file IdDictMgr.cxx.

52  {
53  clear();
54 }

Member Function Documentation

◆ add_dictionary()

void IdDictMgr::add_dictionary ( IdDictDictionary dictionary)

Fillers:

Definition at line 124 of file IdDictMgr.cxx.

124  {
125  if (dictionary == 0) return;
126 
127  const std::string& name = dictionary->name();
128 
129  // Delete entry if already there
131  if (it != m_dictionaries.end()) delete (*it).second;
132 
134 
135  if (Debugger::debug()) {
137 
138  for (it = m_dictionaries.begin(); it != m_dictionaries.end(); ++it) {
139  std::string s = (*it).first;
140  IdDictDictionary* d = (*it).second;
141 
142  std::cout << "IdDictMgr::add_dictionary> d[" << s << "]=" << d << std::endl;
143  }
144  }
145 }

◆ add_metadata()

void IdDictMgr::add_metadata ( const std::string &  name,
const std::string &  value 
)

Definition at line 99 of file IdDictMgr.cxx.

99  {
100  if (!m_metadata.insert(metadata_map::value_type(name, value)).second) {
101  std::cout << "IdDictMgr::add_metadata> unable to add name/value " << name << "/" << value << std::endl;
102  }
103 }

◆ add_subdictionary_name()

void IdDictMgr::add_subdictionary_name ( const std::string &  name)

Definition at line 147 of file IdDictMgr.cxx.

147  {
148  m_subdictionary_names.insert(name);
149 }

◆ clear()

void IdDictMgr::clear ( )

Definition at line 211 of file IdDictMgr.cxx.

211  {
213 
214  for (it = m_dictionaries.begin(); it != m_dictionaries.end(); ++it) {
215  IdDictDictionary* dictionary = (*it).second;
216  dictionary->clear();
217  delete dictionary;
218  }
219 
220  m_dictionaries.clear();
221  m_resolved_references = false;
223 }

◆ do_checks()

bool IdDictMgr::do_checks ( ) const

Check whether or not to do checks for ids.

Definition at line 64 of file IdDictMgr.cxx.

64  {
65  return m_do_checks;
66 }

◆ do_neighbours()

bool IdDictMgr::do_neighbours ( ) const

Check whether or not to init neighbours.

Definition at line 77 of file IdDictMgr.cxx.

77  {
78  return m_do_neighbours;
79 }

◆ DTD_version()

const std::string & IdDictMgr::DTD_version ( ) const

DTD version.

Definition at line 60 of file IdDictMgr.cxx.

60  {
61  return m_DTD_version;
62 }

◆ find_dictionary()

IdDictDictionary * IdDictMgr::find_dictionary ( const std::string &  name) const

Access dictionary by name.

Definition at line 114 of file IdDictMgr.cxx.

114  {
115  dictionary_map::const_iterator it;
116 
117  it = m_dictionaries.find(name);
118 
119  if (it == m_dictionaries.end()) return(0);
120 
121  return((*it).second);
122 }

◆ find_metadata()

const std::string & IdDictMgr::find_metadata ( const std::string &  name) const

Access to meta data, name/value pairs.

Definition at line 91 of file IdDictMgr.cxx.

91  {
92  metadata_map::const_iterator it = m_metadata.find(name);
93  static const std::string empty;
94  if (it != m_metadata.end()) return(it->second);
95  else return empty;
96 }

◆ find_subdicts()

void IdDictMgr::find_subdicts ( IdDictDictionary dict)
private

◆ generate_implementation()

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

Definition at line 162 of file IdDictMgr.cxx.

162  {
163  if (Debugger::debug()) {
164  std::cout << "IdDictMgr::generate_implementation>" << std::endl;
165  }
166 
167  // Must reset the implementation for multiple passes, this resets
168  // the generated flags
170 
172  m_tag = tag;
174  for (it = m_dictionaries.begin(); it != m_dictionaries.end(); ++it) {
175  // From mgr, only generate impl for top-level dictionaries
176  IdDictDictionary* dictionary = (*it).second;
177  if (m_subdictionary_names.find(dictionary->name()) != m_subdictionary_names.end()) continue;
178  dictionary->generate_implementation(*this, tag);
179  }
181  }
182 }

◆ get_dictionary_map()

const IdDictMgr::dictionary_map & IdDictMgr::get_dictionary_map ( ) const

Access to all dictionaries.

Definition at line 110 of file IdDictMgr.cxx.

110  {
111  return(m_dictionaries);
112 }

◆ reset_implementation()

void IdDictMgr::reset_implementation ( )

Reset of implementation.

Definition at line 184 of file IdDictMgr.cxx.

184  {
185  std::cout << "IdDictMgr::reset_implementation" << std::endl;
186 
187 
190  for (it = m_dictionaries.begin(); it != m_dictionaries.end(); ++it) {
191  // From mgr, only generate impl for top-level dictionaries
192  IdDictDictionary* dictionary = (*it).second;
193  if (m_subdictionary_names.find(dictionary->name()) != m_subdictionary_names.end()) continue;
194  dictionary->reset_implementation();
195  }
197  }
198 }

◆ resolve_references()

void IdDictMgr::resolve_references ( )

Construct dictionary after parsing.

Definition at line 151 of file IdDictMgr.cxx.

151  {
153 
154  for (it = m_dictionaries.begin(); it != m_dictionaries.end(); ++it) {
155  // From mgr, only resolve refs for top-level dictionaries
156  IdDictDictionary* dictionary = (*it).second;
157  if (m_subdictionary_names.find(dictionary->name()) != m_subdictionary_names.end()) continue;
158  dictionary->resolve_references(*this);
159  }
160 }

◆ set_do_checks()

void IdDictMgr::set_do_checks ( bool  do_checks)

Definition at line 69 of file IdDictMgr.cxx.

69  {
71  for (const auto& p : m_dictionaries) {
72  IdDictDictionary* d = p.second;
73  d->set_do_checks(do_checks);
74  }
75 }

◆ set_do_neighbours()

void IdDictMgr::set_do_neighbours ( bool  do_neighbours)

Definition at line 82 of file IdDictMgr.cxx.

82  {
84  for (const auto& p : m_dictionaries) {
85  IdDictDictionary* d = p.second;
86  d->set_do_neighbours(do_neighbours);
87  }
88 }

◆ set_DTD_version()

void IdDictMgr::set_DTD_version ( const std::string &  DTD_version)

Definition at line 106 of file IdDictMgr.cxx.

106  {
108 }

◆ tag()

const std::string & IdDictMgr::tag ( ) const

Version tag.

Definition at line 56 of file IdDictMgr.cxx.

56  {
57  return m_tag;
58 }

◆ verify()

bool IdDictMgr::verify ( ) const

Definition at line 200 of file IdDictMgr.cxx.

200  {
201  dictionary_map::const_iterator it;
202 
203  for (it = m_dictionaries.begin(); it != m_dictionaries.end(); ++it) {
204  const IdDictDictionary* dictionary = (*it).second;
205  if (!dictionary->verify()) return(false);
206  }
207 
208  return(true);
209 }

Member Data Documentation

◆ m_dictionaries

dictionary_map IdDictMgr::m_dictionaries
private

Definition at line 69 of file IdDictMgr.h.

◆ m_do_checks

bool IdDictMgr::m_do_checks
private

Definition at line 74 of file IdDictMgr.h.

◆ m_do_neighbours

bool IdDictMgr::m_do_neighbours
private

Definition at line 75 of file IdDictMgr.h.

◆ m_DTD_version

std::string IdDictMgr::m_DTD_version
private

Definition at line 67 of file IdDictMgr.h.

◆ m_generated_implementation

bool IdDictMgr::m_generated_implementation
private

Definition at line 73 of file IdDictMgr.h.

◆ m_metadata

metadata_map IdDictMgr::m_metadata
private

Definition at line 70 of file IdDictMgr.h.

◆ m_resolved_references

bool IdDictMgr::m_resolved_references
private

Definition at line 72 of file IdDictMgr.h.

◆ m_subdictionary_names

std::set<std::string> IdDictMgr::m_subdictionary_names
private

Definition at line 71 of file IdDictMgr.h.

◆ m_tag

std::string IdDictMgr::m_tag
private

Definition at line 68 of file IdDictMgr.h.


The documentation for this class was generated from the following files:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
IdDictMgr::m_metadata
metadata_map m_metadata
Definition: IdDictMgr.h:70
hist_file_dump.d
d
Definition: hist_file_dump.py:142
skel.it
it
Definition: skel.GENtoEVGEN.py:407
athena.value
value
Definition: athena.py:124
IdDictMgr::m_dictionaries
dictionary_map m_dictionaries
Definition: IdDictMgr.h:69
IdDictMgr::m_DTD_version
std::string m_DTD_version
Definition: IdDictMgr.h:67
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:209
IdDictMgr::m_resolved_references
bool m_resolved_references
Definition: IdDictMgr.h:72
Debugger::debug
static bool debug()
Definition: Debugger.h:18
IdDictMgr::do_neighbours
bool do_neighbours() const
Check whether or not to init neighbours.
Definition: IdDictMgr.cxx:77
IdDictMgr::m_do_checks
bool m_do_checks
Definition: IdDictMgr.h:74
IdDictMgr::reset_implementation
void reset_implementation()
Reset of implementation.
Definition: IdDictMgr.cxx:184
master.dictionary
dictionary
Definition: master.py:47
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
IdDictDictionary
Definition: IdDictDictionary.h:30
columnar::empty
bool empty() const noexcept
Definition: ObjectRange.h:167
IdDictMgr::m_do_neighbours
bool m_do_neighbours
Definition: IdDictMgr.h:75
python.SystemOfUnits.s
float s
Definition: SystemOfUnits.py:147
IdDictMgr::clear
void clear()
Definition: IdDictMgr.cxx:211
IdDictMgr::do_checks
bool do_checks() const
Check whether or not to do checks for ids.
Definition: IdDictMgr.cxx:64
IdDictMgr::DTD_version
const std::string & DTD_version() const
DTD version.
Definition: IdDictMgr.cxx:60
IdDictMgr::tag
const std::string & tag() const
Version tag.
Definition: IdDictMgr.cxx:56
IdDictMgr::m_generated_implementation
bool m_generated_implementation
Definition: IdDictMgr.h:73
IdDictMgr::m_subdictionary_names
std::set< std::string > m_subdictionary_names
Definition: IdDictMgr.h:71
IdDictMgr::m_tag
std::string m_tag
Definition: IdDictMgr.h:68