Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
DefaultHepRepDefinition.cc
Go to the documentation of this file.
1// Copyright FreeHEP, 2005.
2
5
6#include <iostream>
7#include <algorithm>
8
9using namespace std;
10using namespace HEPREP;
11
12/**
13 * @author Mark Donszelmann
14 */
15namespace cheprep {
16
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
42void 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
virtual std::string getLowerCaseName()=0
std::set< HEPREP::HepRepAttDef * > getAttDefsFromNode()
HEPREP::HepRepAttDef * getAttDefFromNode(std::string lowerCaseName)
void addAttDef(HEPREP::HepRepAttDef *hepRepAttDef)