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

#include <IdDictDefs.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 31 of file IdDictDefs.h.

Member Typedef Documentation

◆ dictionary_map

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

Definition at line 34 of file IdDictDefs.h.

◆ metadata_map

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

Definition at line 35 of file IdDictDefs.h.

Constructor & Destructor Documentation

◆ IdDictMgr()

IdDictMgr::IdDictMgr ( )

Definition at line 80 of file IdDictMgr.cxx.

81  :
82  m_resolved_references(false),
84  m_do_checks(false),
85  m_do_neighbours(true)
86 {
87 }

◆ ~IdDictMgr()

IdDictMgr::~IdDictMgr ( )

Definition at line 89 of file IdDictMgr.cxx.

90 {
91  clear();
92 }

Member Function Documentation

◆ add_dictionary()

void IdDictMgr::add_dictionary ( IdDictDictionary dictionary)

Fillers:

Definition at line 174 of file IdDictMgr.cxx.

175 {
176  if (dictionary == 0) return;
177 
178  std::string& name = dictionary->m_name;
179 
180  // Delete entry if already there
182  if (it != m_dictionaries.end()) delete (*it).second;
183 
185 
186  if (Debugger::debug ())
187  {
189 
190  for (it = m_dictionaries.begin (); it != m_dictionaries.end (); ++it)
191  {
192  std::string s = (*it).first;
193  IdDictDictionary* d = (*it).second;
194 
195  std::cout << "IdDictMgr::add_dictionary> d[" << s << "]=" << d << std::endl;
196  }
197  }
198 }

◆ add_metadata()

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

Definition at line 144 of file IdDictMgr.cxx.

145 {
146  if(!m_metadata.insert(metadata_map::value_type(name, value)).second) {
147  std::cout << "IdDictMgr::add_metadata> unable to add name/value " << name << "/" << value << std::endl;
148  }
149 }

◆ add_subdictionary_name()

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

Definition at line 200 of file IdDictMgr.cxx.

201 {
202  m_subdictionary_names.insert(name);
203 }

◆ clear()

void IdDictMgr::clear ( )

Definition at line 278 of file IdDictMgr.cxx.

279 {
281 
282  for (it = m_dictionaries.begin (); it != m_dictionaries.end (); ++it)
283  {
284  IdDictDictionary* dictionary = (*it).second;
285  dictionary->clear ();
286  delete dictionary;
287  }
288 
289  m_dictionaries.clear ();
290  m_resolved_references = false;
292 
293 }

◆ do_checks()

bool IdDictMgr::do_checks ( ) const

Check whether or not to do checks for ids.

Definition at line 104 of file IdDictMgr.cxx.

105 {
106  return m_do_checks;
107 }

◆ do_neighbours()

bool IdDictMgr::do_neighbours ( ) const

Check whether or not to init neighbours.

Definition at line 119 of file IdDictMgr.cxx.

120 {
121  return m_do_neighbours;
122 }

◆ DTD_version()

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

DTD version.

Definition at line 99 of file IdDictMgr.cxx.

100 {
101  return m_DTD_version;
102 }

◆ find_dictionary()

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

Access dictionary by name.

Definition at line 163 of file IdDictMgr.cxx.

164 {
165  dictionary_map::const_iterator it;
166 
167  it = m_dictionaries.find (name);
168 
169  if (it == m_dictionaries.end ()) return (0);
170 
171  return ((*it).second);
172 }

◆ find_metadata()

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

Access to meta data, name/value pairs.

Definition at line 135 of file IdDictMgr.cxx.

136 {
137  metadata_map::const_iterator it = m_metadata.find(name);
138  static const std::string empty;
139  if (it != m_metadata.end()) return (it->second);
140  else return empty;
141 }

◆ find_subdicts()

void IdDictMgr::find_subdicts ( IdDictDictionary dict)
private

◆ generate_implementation()

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

Definition at line 219 of file IdDictMgr.cxx.

220 {
221 
222  if (Debugger::debug ())
223  {
224  std::cout << "IdDictMgr::generate_implementation>" << std::endl;
225  }
226 
227  // Must reset the implementation for multiple passes, this resets
228  // the generated flags
230 
232 
233  m_tag = tag;
235  for (it = m_dictionaries.begin (); it != m_dictionaries.end (); ++it) {
236  // From mgr, only generate impl for top-level dictionaries
237  IdDictDictionary* dictionary = (*it).second;
238  if (m_subdictionary_names.find(dictionary->m_name) != m_subdictionary_names.end()) continue;
239  dictionary->generate_implementation (*this, tag);
240  }
242  }
243 }

◆ get_dictionary_map()

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

Access to all dictionaries.

Definition at line 158 of file IdDictMgr.cxx.

159 {
160  return (m_dictionaries);
161 }

◆ reset_implementation()

void IdDictMgr::reset_implementation ( )

Reset of implementation.

Definition at line 245 of file IdDictMgr.cxx.

246 {
247 
248  std::cout << "IdDictMgr::reset_implementation" << std::endl;
249 
250 
252 
254  for (it = m_dictionaries.begin (); it != m_dictionaries.end (); ++it) {
255  // From mgr, only generate impl for top-level dictionaries
256  IdDictDictionary* dictionary = (*it).second;
257  if (m_subdictionary_names.find(dictionary->m_name) != m_subdictionary_names.end()) continue;
258  dictionary->reset_implementation ();
259  }
261  }
262 }

◆ resolve_references()

void IdDictMgr::resolve_references ( )

Construct dictionary after parsing.

Definition at line 206 of file IdDictMgr.cxx.

207 {
209 
210  for (it = m_dictionaries.begin (); it != m_dictionaries.end (); ++it)
211  {
212  // From mgr, only resolve refs for top-level dictionaries
213  IdDictDictionary* dictionary = (*it).second;
214  if (m_subdictionary_names.find(dictionary->m_name) != m_subdictionary_names.end()) continue;
215  dictionary->resolve_references (*this);
216  }
217 }

◆ set_do_checks()

void IdDictMgr::set_do_checks ( bool  do_checks)

Definition at line 110 of file IdDictMgr.cxx.

111 {
113  for (const auto& p : m_dictionaries) {
114  IdDictDictionary* d = p.second;
115  d->set_do_checks(do_checks);
116  }
117 }

◆ set_do_neighbours()

void IdDictMgr::set_do_neighbours ( bool  do_neighbours)

Definition at line 125 of file IdDictMgr.cxx.

126 {
128  for (const auto& p : m_dictionaries) {
129  IdDictDictionary* d = p.second;
130  d->set_do_neighbours(do_neighbours);
131  }
132 }

◆ set_DTD_version()

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

Definition at line 152 of file IdDictMgr.cxx.

153 {
155 }

◆ tag()

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

Version tag.

Definition at line 94 of file IdDictMgr.cxx.

95 {
96  return m_tag;
97 }

◆ verify()

bool IdDictMgr::verify ( ) const

Definition at line 265 of file IdDictMgr.cxx.

266 {
267  dictionary_map::const_iterator it;
268 
269  for (it = m_dictionaries.begin (); it != m_dictionaries.end (); ++it)
270  {
271  const IdDictDictionary* dictionary = (*it).second;
272  if (!dictionary->verify ()) return (false);
273  }
274 
275  return (true);
276 }

Member Data Documentation

◆ m_dictionaries

dictionary_map IdDictMgr::m_dictionaries
private

Definition at line 87 of file IdDictDefs.h.

◆ m_do_checks

bool IdDictMgr::m_do_checks
private

Definition at line 92 of file IdDictDefs.h.

◆ m_do_neighbours

bool IdDictMgr::m_do_neighbours
private

Definition at line 93 of file IdDictDefs.h.

◆ m_DTD_version

std::string IdDictMgr::m_DTD_version
private

Definition at line 85 of file IdDictDefs.h.

◆ m_generated_implementation

bool IdDictMgr::m_generated_implementation
private

Definition at line 91 of file IdDictDefs.h.

◆ m_metadata

metadata_map IdDictMgr::m_metadata
private

Definition at line 88 of file IdDictDefs.h.

◆ m_resolved_references

bool IdDictMgr::m_resolved_references
private

Definition at line 90 of file IdDictDefs.h.

◆ m_subdictionary_names

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

Definition at line 89 of file IdDictDefs.h.

◆ m_tag

std::string IdDictMgr::m_tag
private

Definition at line 86 of file IdDictDefs.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: IdDictDefs.h:88
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: IdDictDefs.h:87
empty
bool empty(TH1 *h)
Definition: computils.cxx:294
IdDictMgr::m_DTD_version
std::string m_DTD_version
Definition: IdDictDefs.h:85
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
IdDictMgr::m_resolved_references
bool m_resolved_references
Definition: IdDictDefs.h:90
Debugger::debug
static bool debug()
Definition: IdDictMgr.cxx:28
IdDictMgr::do_neighbours
bool do_neighbours() const
Check whether or not to init neighbours.
Definition: IdDictMgr.cxx:119
IdDictMgr::m_do_checks
bool m_do_checks
Definition: IdDictDefs.h:92
IdDictMgr::reset_implementation
void reset_implementation()
Reset of implementation.
Definition: IdDictMgr.cxx:245
master.dictionary
dictionary
Definition: master.py:47
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
IdDictDictionary
Definition: IdDictDefs.h:97
IdDictMgr::m_do_neighbours
bool m_do_neighbours
Definition: IdDictDefs.h:93
IdDictMgr::clear
void clear()
Definition: IdDictMgr.cxx:278
IdDictMgr::do_checks
bool do_checks() const
Check whether or not to do checks for ids.
Definition: IdDictMgr.cxx:104
IdDictMgr::DTD_version
const std::string & DTD_version() const
DTD version.
Definition: IdDictMgr.cxx:99
IdDictMgr::tag
const std::string & tag() const
Version tag.
Definition: IdDictMgr.cxx:94
IdDictMgr::m_generated_implementation
bool m_generated_implementation
Definition: IdDictDefs.h:91
IdDictMgr::m_subdictionary_names
std::set< std::string > m_subdictionary_names
Definition: IdDictDefs.h:89
IdDictMgr::m_tag
std::string m_tag
Definition: IdDictDefs.h:86