Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
cheprep::DefaultHepRepDefinition Class Referenceabstract

#include <DefaultHepRepDefinition.h>

+ Inheritance 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)
 
HEPREP::HepRepAttValuegetAttValue (std::string name)=0
 
- Public Member Functions inherited from HEPREP::HepRepAttribute
virtual ~HepRepAttribute ()
 Destructor.
 
virtual void addAttValue (HepRepAttValue *attValue)=0
 
virtual void addAttValue (std::string key, char *value, int showLabel=HepRepConstants::SHOW_NONE)=0
 
virtual void addAttValue (std::string key, std::string value, int showLabel=HepRepConstants::SHOW_NONE)=0
 
virtual void addAttValue (std::string key, int64 value, int showLabel=HepRepConstants::SHOW_NONE)=0
 
virtual void addAttValue (std::string key, int value, int showLabel=HepRepConstants::SHOW_NONE)=0
 
virtual void addAttValue (std::string key, double value, int showLabel=HepRepConstants::SHOW_NONE)=0
 
virtual void addAttValue (std::string key, bool value, int showLabel=HepRepConstants::SHOW_NONE)=0
 
virtual void addAttValue (std::string key, std::vector< double > value, int showLabel=HepRepConstants::SHOW_NONE)=0
 
virtual void addAttValue (std::string key, double red, double green, double blue, double alpha=1.0, int showLabel=HepRepConstants::SHOW_NONE)=0
 
virtual HepRepAttValueremoveAttValue (std::string key)=0
 
virtual HepRepAttValuegetAttValue (std::string name)=0
 
virtual std::set< HepRepAttValue * > getAttValuesFromNode ()=0
 
virtual HepRepAttValuegetAttValueFromNode (std::string lowerCaseName)=0
 
- Public Member Functions inherited from HEPREP::HepRepDefinition
virtual ~HepRepDefinition ()
 Destructor.
 
virtual void addAttDef (std::string name, std::string desc, std::string category, std::string extra)=0
 
virtual void addAttDef (HepRepAttDef *attDef)=0
 
virtual HepRepAttDefgetAttDef (std::string name)=0
 
virtual std::set< HepRepAttDef * > getAttDefsFromNode ()=0
 
virtual HepRepAttDefgetAttDefFromNode (std::string lowerCaseName)=0
 

Detailed Description

Definition at line 21 of file DefaultHepRepDefinition.h.

Constructor & Destructor Documentation

◆ DefaultHepRepDefinition()

cheprep::DefaultHepRepDefinition::DefaultHepRepDefinition ( )

◆ ~DefaultHepRepDefinition()

cheprep::DefaultHepRepDefinition::~DefaultHepRepDefinition ( )

Definition at line 21 of file DefaultHepRepDefinition.cc.

21 {
22 set<HepRepAttDef *> list = getAttDefsFromNode();
23 for (set<HepRepAttDef*>::iterator i1 = list.begin(); i1 != list.end(); i1++) {
24 delete (*i1);
25 }
26}
std::set< HEPREP::HepRepAttDef * > getAttDefsFromNode()

Member Function Documentation

◆ addAttDef() [1/2]

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

Adds an attdef.

Parameters
attDefto be added.

Implements HEPREP::HepRepDefinition.

Definition at line 36 of file DefaultHepRepDefinition.cc.

36 {
37 string lowerCaseName = hepRepAttDef->getLowerCaseName();
38 if (attDefs[lowerCaseName] != NULL) delete attDefs[lowerCaseName];
39 attDefs[lowerCaseName] = hepRepAttDef;
40}

Referenced by addAttDef().

◆ addAttDef() [2/2]

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

Adds an attdef.

Parameters
namename of the definition.
descdescription of the definition.
categorycategory of the definition.
extraextra info of the definition.

Implements HEPREP::HepRepDefinition.

Definition at line 42 of file DefaultHepRepDefinition.cc.

42 {
43 addAttDef(new DefaultHepRepAttDef(name, desc, type, extra));
44}
void addAttDef(HEPREP::HepRepAttDef *hepRepAttDef)

◆ getAttDef()

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

Return a named attribute definition searched on this node and any parent nodes.

Parameters
nameof attribute definition.
Returns
attribute definition.

Implements HEPREP::HepRepDefinition.

Implemented in cheprep::DefaultHepRepType.

◆ getAttDefFromNode()

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

Returns a named attribute definition defined on this node.

Parameters
lowerCaseNamename of the attribute in lower case.
Returns
attribute definition.

Implements HEPREP::HepRepDefinition.

Definition at line 46 of file DefaultHepRepDefinition.cc.

46 {
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}
const char * name(G4int ptype)

◆ getAttDefsFromNode()

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

Returns a collection of all attribute definitions defined on this node.

Returns
collection of attributes definitions.

Implements HEPREP::HepRepDefinition.

Definition at line 28 of file DefaultHepRepDefinition.cc.

28 {
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}

Referenced by ~DefaultHepRepDefinition().

◆ getAttValue()

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

Returns the attValue specified by name. This attValue is normally searched on the node itself and then on its type, moving up the typetree.

Parameters
nameof attribute value.
Returns
attribute value.

Implements cheprep::DefaultHepRepAttribute.

Implemented in cheprep::DefaultHepRepType.


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