Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
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 * @version $Id: DefaultHepRepDefinition.cc,v 1.8 2005-06-02 21:28:45 duns Exp $
15 */
16namespace cheprep {
17
20}
21
23 set<HepRepAttDef *> list = getAttDefsFromNode();
24 for (set<HepRepAttDef*>::iterator i1 = list.begin(); i1 != list.end(); i1++) {
25 delete (*i1);
26 }
27}
28
30 set<HepRepAttDef*> attSet;
31 for (map<string, HepRepAttDef*>::iterator i = attDefs.begin(); i != attDefs.end(); i++) {
32 attSet.insert((*i).second);
33 }
34 return attSet;
35}
36
38 string lowerCaseName = hepRepAttDef->getLowerCaseName();
39 if (attDefs[lowerCaseName] != NULL) delete attDefs[lowerCaseName];
40 attDefs[lowerCaseName] = hepRepAttDef;
41}
42
43void DefaultHepRepDefinition::addAttDef(string name, string desc, string type, string extra) {
44 addAttDef(new DefaultHepRepAttDef(name, desc, type, extra));
45}
46
48 string s = name;
49 transform(s.begin(), s.end(), s.begin(), (int(*)(int)) tolower);
50 return (attDefs.count(s) > 0) ? attDefs[s] : NULL;
51}
52
53} // cheprep
virtual std::string getLowerCaseName()=0
std::set< HEPREP::HepRepAttDef * > getAttDefsFromNode()
HEPREP::HepRepAttDef * getAttDefFromNode(std::string lowerCaseName)
void addAttDef(HEPREP::HepRepAttDef *hepRepAttDef)