Geant4 9.6.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 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()

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 37 of file DefaultHepRepDefinition.cc.

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

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 43 of file DefaultHepRepDefinition.cc.

43 {
44 addAttDef(new DefaultHepRepAttDef(name, desc, type, extra));
45}
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 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}

◆ 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 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}

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: