Geant4  10.03.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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...
 

Detailed Description

Definition at line 22 of file DefaultHepRepDefinition.h.

Constructor & Destructor Documentation

cheprep::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

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 }

Here is the call graph for this function:

Here is the caller graph for this function:

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 }
const XML_Char * name
Definition: expat.h:151
void addAttDef(HEPREP::HepRepAttDef *hepRepAttDef)

Here is the call graph for this function:

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.

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 }
const XML_Char * name
Definition: expat.h:151
const XML_Char * s
Definition: expat.h:262
typedef int(XMLCALL *XML_NotStandaloneHandler)(void *userData)

Here is the call graph for this function:

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 }

Here is the caller graph for this function:

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: