Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
DefaultHepRepDefinition.cc
이 파일의 문서화 페이지로 가기
1 // Copyright FreeHEP, 2005.
2 
5 
6 #include <iostream>
7 #include <algorithm>
8 
9 using namespace std;
10 using namespace HEPREP;
11 
16 namespace cheprep {
17 
18 DefaultHepRepDefinition::DefaultHepRepDefinition()
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 
43 void 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
const XML_Char * name
Definition: expat.h:151
std::map< std::string, HEPREP::HepRepAttDef * > attDefs
const XML_Char * s
Definition: expat.h:262
typedef int(XMLCALL *XML_NotStandaloneHandler)(void *userData)
virtual std::string getLowerCaseName()=0
HEPREP::HepRepAttDef * getAttDefFromNode(std::string lowerCaseName)
std::set< HEPREP::HepRepAttDef * > getAttDefsFromNode()
void addAttDef(HEPREP::HepRepAttDef *hepRepAttDef)