ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DefaultHepRepDefinition.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file DefaultHepRepDefinition.cc
1 // Copyright FreeHEP, 2005.
2 
5 
6 #include <iostream>
7 #include <algorithm>
8 
9 using namespace std;
10 using namespace HEPREP;
11 
15 namespace cheprep {
16 
17 DefaultHepRepDefinition::DefaultHepRepDefinition()
19 }
20 
22  set<HepRepAttDef *> list = getAttDefsFromNode();
23  for (set<HepRepAttDef*>::iterator i1 = list.begin(); i1 != list.end(); i1++) {
24  delete (*i1);
25  }
26 }
27 
29  set<HepRepAttDef*> attSet;
30  for (map<string, HepRepAttDef*>::iterator i = attDefs.begin(); i != attDefs.end(); i++) {
31  attSet.insert((*i).second);
32  }
33  return attSet;
34 }
35 
37  string lowerCaseName = hepRepAttDef->getLowerCaseName();
38  if (attDefs[lowerCaseName] != NULL) delete attDefs[lowerCaseName];
39  attDefs[lowerCaseName] = hepRepAttDef;
40 }
41 
42 void DefaultHepRepDefinition::addAttDef(string name, string desc, string type, string extra) {
43  addAttDef(new DefaultHepRepAttDef(name, desc, type, extra));
44 }
45 
47  string s = name;
48  transform(s.begin(), s.end(), s.begin(), (int(*)(int)) tolower);
49  return (attDefs.count(s) > 0) ? attDefs[s] : NULL;
50 }
51 
52 } // cheprep