Geant4  10.02.p03
cheprep::DefaultHepRepDefinition Class Referenceabstract

#include <DefaultHepRepDefinition.h>

Inheritance diagram for cheprep::DefaultHepRepDefinition:
Collaboration diagram for cheprep::DefaultHepRepDefinition:

Public Member Functions

 DefaultHepRepDefinition ()
 
 ~DefaultHepRepDefinition ()
 
void addAttDef (HEPREP::HepRepAttDef *hepRepAttDef)
 
void addAttDef (std::string name, std::string desc, std::string type, std::string extra)
 
std::set< HEPREP::HepRepAttDef * > getAttDefsFromNode ()
 
HEPREP::HepRepAttDefgetAttDefFromNode (std::string lowerCaseName)
 
HEPREP::HepRepAttDefgetAttDef (std::string name)=0
 
HEPREP::HepRepAttValuegetAttValue (std::string name)=0
 
- Public Member Functions inherited from cheprep::DefaultHepRepAttribute
 DefaultHepRepAttribute ()
 
 ~DefaultHepRepAttribute ()
 
std::set< HEPREP::HepRepAttValue * > getAttValuesFromNode ()
 
void addAttValue (HEPREP::HepRepAttValue *hepRepAttValue)
 
void addAttValue (std::string key, char *value, int showLabel)
 
void addAttValue (std::string key, std::string value, int showLabel)
 
void addAttValue (std::string key, int value, int showLabel)
 
void addAttValue (std::string key, int64 value, int showLabel)
 
void addAttValue (std::string key, double value, int showLabel)
 
void addAttValue (std::string key, bool value, int showLabel)
 
void addAttValue (std::string key, std::vector< double > value, int showLabel)
 
void addAttValue (std::string key, double red, double green, double blue, double alpha, int showLabel)
 
HEPREP::HepRepAttValuegetAttValueFromNode (std::string lowerCaseName)
 
HEPREP::HepRepAttValueremoveAttValue (std::string key)
 
- Public Member Functions inherited from HEPREP::HepRepAttribute
virtual ~HepRepAttribute ()
 Destructor. More...
 
- Public Member Functions inherited from HEPREP::HepRepDefinition
virtual ~HepRepDefinition ()
 Destructor. More...
 

Private Attributes

std::map< std::string, HEPREP::HepRepAttDef * > attDefs
 

Detailed Description

Definition at line 22 of file DefaultHepRepDefinition.h.

Constructor & Destructor Documentation

◆ DefaultHepRepDefinition()

cheprep::DefaultHepRepDefinition::DefaultHepRepDefinition ( )

◆ ~DefaultHepRepDefinition()

cheprep::DefaultHepRepDefinition::~DefaultHepRepDefinition ( )

Definition at line 22 of file DefaultHepRepDefinition.cc.

22  {
23  set<HepRepAttDef *> list = getAttDefsFromNode();
24  for (set<HepRepAttDef*>::iterator i1 = list.begin(); i1 != list.end(); i1++) {
25  delete (*i1);
26  }
27 }
std::set< HEPREP::HepRepAttDef * > getAttDefsFromNode()
Here is the call graph for this function:

Member Function Documentation

◆ addAttDef() [1/2]

void cheprep::DefaultHepRepDefinition::addAttDef ( HEPREP::HepRepAttDef hepRepAttDef)
virtual

Implements HEPREP::HepRepDefinition.

Definition at line 37 of file DefaultHepRepDefinition.cc.

37  {
38  string lowerCaseName = hepRepAttDef->getLowerCaseName();
39  if (attDefs[lowerCaseName] != NULL) delete attDefs[lowerCaseName];
40  attDefs[lowerCaseName] = hepRepAttDef;
41 }
std::map< std::string, HEPREP::HepRepAttDef * > attDefs
virtual std::string getLowerCaseName()=0
Here is the call graph for this function:
Here is the caller graph for this function:

◆ addAttDef() [2/2]

void cheprep::DefaultHepRepDefinition::addAttDef ( std::string  name,
std::string  desc,
std::string  type,
std::string  extra 
)
virtual

Implements HEPREP::HepRepDefinition.

Definition at line 43 of file DefaultHepRepDefinition.cc.

43  {
44  addAttDef(new DefaultHepRepAttDef(name, desc, type, extra));
45 }
G4String name
Definition: TRTMaterials.hh:40
void addAttDef(HEPREP::HepRepAttDef *hepRepAttDef)
Here is the call graph for this function:

◆ getAttDef()

HEPREP::HepRepAttDef* cheprep::DefaultHepRepDefinition::getAttDef ( std::string  name)
pure virtual

◆ getAttDefFromNode()

HepRepAttDef * cheprep::DefaultHepRepDefinition::getAttDefFromNode ( std::string  lowerCaseName)
virtual

Implements HEPREP::HepRepDefinition.

Definition at line 47 of file DefaultHepRepDefinition.cc.

47  {
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 }
G4String name
Definition: TRTMaterials.hh:40
std::map< std::string, HEPREP::HepRepAttDef * > attDefs
static const double s
Definition: G4SIunits.hh:168

◆ getAttDefsFromNode()

set< HepRepAttDef * > cheprep::DefaultHepRepDefinition::getAttDefsFromNode ( )
virtual

Implements HEPREP::HepRepDefinition.

Definition at line 29 of file DefaultHepRepDefinition.cc.

29  {
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 }
std::map< std::string, HEPREP::HepRepAttDef * > attDefs
Here is the caller graph for this function:

◆ getAttValue()

HEPREP::HepRepAttValue* cheprep::DefaultHepRepDefinition::getAttValue ( std::string  name)
pure virtual

Member Data Documentation

◆ attDefs

std::map<std::string, HEPREP::HepRepAttDef*> cheprep::DefaultHepRepDefinition::attDefs
private

Definition at line 25 of file DefaultHepRepDefinition.h.


The documentation for this class was generated from the following files: