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 45 of file IdDictMgr.cxx.

46  :
47  m_resolved_references(false),
49  m_do_checks(false),
50  m_do_neighbours(true) {
51 }

◆ ~IdDictMgr()

IdDictMgr::~IdDictMgr ( )

Definition at line 53 of file IdDictMgr.cxx.

53  {
54  clear();
55 }

Member Function Documentation

◆ add_dictionary()

void IdDictMgr::add_dictionary ( IdDictDictionary dictionary)

Fillers:

Definition at line 125 of file IdDictMgr.cxx.

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

◆ add_metadata()

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

Definition at line 100 of file IdDictMgr.cxx.

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

◆ add_subdictionary_name()

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

Definition at line 148 of file IdDictMgr.cxx.

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

◆ clear()

void IdDictMgr::clear ( )

Definition at line 212 of file IdDictMgr.cxx.

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

◆ do_checks()

bool IdDictMgr::do_checks ( ) const

Check whether or not to do checks for ids.

Definition at line 65 of file IdDictMgr.cxx.

65  {
66  return m_do_checks;
67 }

◆ do_neighbours()

bool IdDictMgr::do_neighbours ( ) const

Check whether or not to init neighbours.

Definition at line 78 of file IdDictMgr.cxx.

78  {
79  return m_do_neighbours;
80 }

◆ DTD_version()

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

DTD version.

Definition at line 61 of file IdDictMgr.cxx.

61  {
62  return m_DTD_version;
63 }

◆ find_dictionary()

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

Access dictionary by name.

Definition at line 115 of file IdDictMgr.cxx.

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

◆ find_metadata()

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

Access to meta data, name/value pairs.

Definition at line 92 of file IdDictMgr.cxx.

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

◆ find_subdicts()

void IdDictMgr::find_subdicts ( IdDictDictionary dict)
private

◆ generate_implementation()

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

Definition at line 163 of file IdDictMgr.cxx.

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

◆ get_dictionary_map()

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

Access to all dictionaries.

Definition at line 111 of file IdDictMgr.cxx.

111  {
112  return(m_dictionaries);
113 }

◆ reset_implementation()

void IdDictMgr::reset_implementation ( )

Reset of implementation.

Definition at line 185 of file IdDictMgr.cxx.

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

◆ resolve_references()

void IdDictMgr::resolve_references ( )

Construct dictionary after parsing.

Definition at line 152 of file IdDictMgr.cxx.

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

◆ set_do_checks()

void IdDictMgr::set_do_checks ( bool  do_checks)

Definition at line 70 of file IdDictMgr.cxx.

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

◆ set_do_neighbours()

void IdDictMgr::set_do_neighbours ( bool  do_neighbours)

Definition at line 83 of file IdDictMgr.cxx.

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

◆ set_DTD_version()

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

Definition at line 107 of file IdDictMgr.cxx.

107  {
109 }

◆ tag()

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

Version tag.

Definition at line 57 of file IdDictMgr.cxx.

57  {
58  return m_tag;
59 }

◆ verify()

bool IdDictMgr::verify ( ) const

Definition at line 201 of file IdDictMgr.cxx.

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

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
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
IdDictMgr::m_metadata
metadata_map m_metadata
Definition: IdDictMgr.h:70
hist_file_dump.d
d
Definition: hist_file_dump.py:137
skel.it
it
Definition: skel.GENtoEVGEN.py:396
athena.value
value
Definition: athena.py:124
IdDictMgr::m_dictionaries
dictionary_map m_dictionaries
Definition: IdDictMgr.h:69
empty
bool empty(TH1 *h)
Definition: computils.cxx:295
IdDictMgr::m_DTD_version
std::string m_DTD_version
Definition: IdDictMgr.h:67
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
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:78
IdDictMgr::m_do_checks
bool m_do_checks
Definition: IdDictMgr.h:74
IdDictMgr::reset_implementation
void reset_implementation()
Reset of implementation.
Definition: IdDictMgr.cxx:185
master.dictionary
dictionary
Definition: master.py:47
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
IdDictDictionary
Definition: IdDictDictionary.h:30
IdDictMgr::m_do_neighbours
bool m_do_neighbours
Definition: IdDictMgr.h:75
IdDictMgr::clear
void clear()
Definition: IdDictMgr.cxx:212
IdDictMgr::do_checks
bool do_checks() const
Check whether or not to do checks for ids.
Definition: IdDictMgr.cxx:65
IdDictMgr::DTD_version
const std::string & DTD_version() const
DTD version.
Definition: IdDictMgr.cxx:61
IdDictMgr::tag
const std::string & tag() const
Version tag.
Definition: IdDictMgr.cxx:57
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