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

#include <DefaultHepRepType.h>

+ Inheritance diagram for cheprep::DefaultHepRepType:

Public Member Functions

 DefaultHepRepType (HEPREP::HepRepType *parent, std::string name)
 
 DefaultHepRepType (HEPREP::HepRepTypeTree *parent, std::string name)
 
 ~DefaultHepRepType ()
 
HEPREP::HepRepTypegetSuperType ()
 
HEPREP::HepRepAttDefgetAttDef (std::string name)
 
HEPREP::HepRepAttValuegetAttValue (std::string name)
 
HEPREP::HepRepTypecopy (HEPREP::HepRepType *parent)
 
std::string getName ()
 
std::string getFullName ()
 
std::string getDescription ()
 
void setDescription (std::string description)
 
std::string getInfoURL ()
 
void setInfoURL (std::string infoURL)
 
void addType (HEPREP::HepRepType *type)
 
std::vector< HEPREP::HepRepType * > getTypeList ()
 
- Public Member Functions inherited from cheprep::DefaultHepRepDefinition
 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
 
- Public Member Functions inherited from HEPREP::HepRepType
virtual ~HepRepType ()
 Destructor.
 
virtual void addType (HepRepType *type)=0
 
virtual std::string getName ()=0
 
virtual std::string getFullName ()=0
 
virtual std::string getDescription ()=0
 
virtual void setDescription (std::string description)=0
 
virtual std::string getInfoURL ()=0
 
virtual void setInfoURL (std::string infoURL)=0
 
virtual HepRepTypegetSuperType ()=0
 
virtual std::vector< HepRepType * > getTypeList ()=0
 
virtual HepRepTypecopy (HepRepType *parent)=0
 

Detailed Description

Definition at line 24 of file DefaultHepRepType.h.

Constructor & Destructor Documentation

◆ DefaultHepRepType() [1/2]

cheprep::DefaultHepRepType::DefaultHepRepType ( HEPREP::HepRepType parent,
std::string  name 
)

Definition at line 13 of file DefaultHepRepType.cc.

14 : DefaultHepRepDefinition(), parent(parentType), name(typeName) {
15 this->description = "No Description";
16 this->infoURL = "No Info URL";
17
18 // HepRepTypes are sometimes used without a parent (top-level)
19 if (parent != NULL) {
20 parent->addType(this);
21 }
22}
virtual void addType(HepRepType *type)=0

◆ DefaultHepRepType() [2/2]

cheprep::DefaultHepRepType::DefaultHepRepType ( HEPREP::HepRepTypeTree parent,
std::string  name 
)

Definition at line 24 of file DefaultHepRepType.cc.

25 : DefaultHepRepDefinition(), parent(NULL), name(typeName) {
26 this->description = "No Description";
27 this->infoURL = "No Info URL";
28
29 parentTypeTree->addType(this);
30}

◆ ~DefaultHepRepType()

cheprep::DefaultHepRepType::~DefaultHepRepType ( )

Definition at line 32 of file DefaultHepRepType.cc.

32 {
33 for (vector<HepRepType*>::iterator i1 = types.begin(); i1 != types.end(); i1++) {
34 delete (*i1);
35 }
36}

Member Function Documentation

◆ addType()

void cheprep::DefaultHepRepType::addType ( HEPREP::HepRepType type)
virtual

Adds a sub-type to this type.

Parameters
typesub-type to be added.

Implements HEPREP::HepRepType.

Definition at line 102 of file DefaultHepRepType.cc.

102 {
103 // FIXME should check if type already exists
104 types.push_back(type);
105}

◆ copy()

HepRepType * cheprep::DefaultHepRepType::copy ( HEPREP::HepRepType parent)
virtual

Returns a deep copy of this type.

Parameters
parentto which this copy is added.
Returns
copy of this type.

Implements HEPREP::HepRepType.

Definition at line 73 of file DefaultHepRepType.cc.

73 {
74 cerr << "DefaultHepRepType::copy(HepRepType*) not implemented." << endl;
75 return NULL;
76}

◆ getAttDef()

HepRepAttDef * cheprep::DefaultHepRepType::getAttDef ( std::string  name)
virtual

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

Parameters
nameof attribute definition.
Returns
attribute definition.

Implements cheprep::DefaultHepRepDefinition.

Definition at line 42 of file DefaultHepRepType.cc.

42 {
43 HepRepAttDef* def = NULL;
44 HepRepType* type = this;
45 while ((def == NULL) && (type != NULL)) {
46 def = type->getAttDefFromNode(defName);
47 type = type->getSuperType();
48 }
49 if (def == NULL) {
50 cerr << "ERROR: No HepRepDefaults, trying to get definition for: " << defName << endl;
51 // FIXME, no HepRepDefaults
52 }
53 return def;
54}
virtual HepRepAttDef * getAttDefFromNode(std::string lowerCaseName)=0
virtual HepRepType * getSuperType()=0

◆ getAttValue()

HepRepAttValue * cheprep::DefaultHepRepType::getAttValue ( std::string  name)
virtual

searched for a value with given name. Search up the type tree if needed.

Implements cheprep::DefaultHepRepDefinition.

Definition at line 59 of file DefaultHepRepType.cc.

59 {
60 HepRepAttValue* value = NULL;
61 HepRepType* type = this;
62 while ((value == NULL) && (type != NULL)) {
63 value = type->getAttValueFromNode(attName);
64 type = type->getSuperType();
65 }
66 if (value == NULL) {
67 cerr << "ERROR: No HepRepDefaults, trying to get value for: " << attName << endl;
68 // FIXME, no HepRepDefaults
69 }
70 return value;
71}
virtual HepRepAttValue * getAttValueFromNode(std::string lowerCaseName)=0

◆ getDescription()

string cheprep::DefaultHepRepType::getDescription ( )
virtual

Returns the description of this type.

Returns
description of type.

Implements HEPREP::HepRepType.

Definition at line 86 of file DefaultHepRepType.cc.

86 {
87 return description;
88}

◆ getFullName()

string cheprep::DefaultHepRepType::getFullName ( )
virtual

Returns the full name of this type. The full name is constructed from the root of the typeTree (without the typeTreeName) by concatenating all the node names separated by slashes "/". For example: Geometry/InnerDetector/Sector24/Wire20

Returns
full name of type.
See also
getName()

Implements HEPREP::HepRepType.

Definition at line 82 of file DefaultHepRepType.cc.

82 {
83 return (getSuperType() == NULL) ? getName() : getSuperType()->getFullName() + "/" + getName();
84}
HEPREP::HepRepType * getSuperType()

◆ getInfoURL()

string cheprep::DefaultHepRepType::getInfoURL ( )
virtual

Returns the information URL of this type.

Returns
info URL of type.

Implements HEPREP::HepRepType.

Definition at line 94 of file DefaultHepRepType.cc.

94 {
95 return infoURL;
96}

◆ getName()

string cheprep::DefaultHepRepType::getName ( )
virtual

Returns the name of this type. This is the full name if one uses flat-types, and the node name if one uses hierarchical typenames. It is the name supplied at construction of the type.

Returns
name of type.
See also
getFullName()

Implements HEPREP::HepRepType.

Definition at line 78 of file DefaultHepRepType.cc.

78 {
79 return name;
80}

Referenced by getFullName().

◆ getSuperType()

HepRepType * cheprep::DefaultHepRepType::getSuperType ( )
virtual

Returns the parent of this type.

Returns
parent of type, or null if top-level.

Implements HEPREP::HepRepType.

Definition at line 38 of file DefaultHepRepType.cc.

38 {
39 return parent;
40}

Referenced by getFullName().

◆ getTypeList()

vector< HepRepType * > cheprep::DefaultHepRepType::getTypeList ( )
virtual

Returns a collection of all the sub-types of this type.

Returns
collection of HepRepTypes.

Implements HEPREP::HepRepType.

Definition at line 107 of file DefaultHepRepType.cc.

107 {
108 return types;
109}

◆ setDescription()

void cheprep::DefaultHepRepType::setDescription ( std::string  description)
virtual

Sets the description of this type.

Parameters
infoURL

Implements HEPREP::HepRepType.

Definition at line 90 of file DefaultHepRepType.cc.

90 {
91 this->description = desc;
92}

◆ setInfoURL()

void cheprep::DefaultHepRepType::setInfoURL ( std::string  infoURL)
virtual

Sets the information URL of this type.

Parameters
infoURL

Implements HEPREP::HepRepType.

Definition at line 98 of file DefaultHepRepType.cc.

98 {
99 this->infoURL = info;
100}

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