HepMC3 event record library
|
Base attribute class.
Base class for all attributes.
Contains virtual functions to_string and from_string that each attribute must implement, as well as init function that attributes should overload to initialize parsed attribute
Definition at line 44 of file Attribute.h.
#include <Attribute.h>
Public Member Functions | |
Attribute () | |
Default constructor. | |
virtual | ~Attribute () |
Virtual destructor. | |
virtual bool | from_string (const std::string &att)=0 |
Fill class content from string. | |
virtual bool | init () |
Optionally initialize the attribute after from_string. | |
virtual bool | init (const GenRunInfo &) |
Optionally initialize the attribute after from_string. | |
virtual bool | to_string (std::string &att) const =0 |
Fill string from class content. | |
bool | is_parsed () const |
Check if this attribute is parsed. | |
const std::string & | unparsed_string () const |
Get unparsed string. | |
const GenEvent * | event () const |
GenParticlePtr | particle () |
ConstGenParticlePtr | particle () const |
GenVertexPtr | vertex () |
ConstGenVertexPtr | vertex () const |
Protected Member Functions | |
Attribute (const std::string &st) | |
Protected constructor that allows to set string. | |
void | set_is_parsed (bool flag) |
Set is_parsed flag. | |
void | set_unparsed_string (const std::string &st) |
Set unparsed string. | |
Private Attributes | |
bool | m_is_parsed |
Is this attribute parsed? | |
std::string | m_string |
Raw (unparsed) string. | |
const GenEvent * | m_event |
GenParticlePtr | m_particle |
controlling GenEvent object. | |
GenVertexPtr | m_vertex |
Vertex to which assigned. | |
Friends | |
class | GenEvent |
GenEvent is a friend. | |
|
inline |
|
inlinevirtual |
Virtual destructor.
Definition at line 54 of file Attribute.h.
|
inlineexplicitprotected |
Protected constructor that allows to set string.
Used when parsing attributes from file. An StringAttribute class object is made, which uses this constructor to signify that it just holds string without parsing it.
Definition at line 66 of file Attribute.h.
References Attribute::m_event.
|
inline |
return the GenEvent to which this Attribute belongs, if at all.
Definition at line 108 of file Attribute.h.
References Attribute::m_event.
|
pure virtual |
Fill class content from string.
Implemented in AssociatedParticle, IntAttribute, LongAttribute, DoubleAttribute, FloatAttribute, StringAttribute, CharAttribute, LongLongAttribute, LongDoubleAttribute, UIntAttribute, ULongAttribute, ULongLongAttribute, BoolAttribute, VectorCharAttribute, VectorFloatAttribute, VectorLongDoubleAttribute, VectorLongLongAttribute, VectorUIntAttribute, VectorULongAttribute, VectorULongLongAttribute, VectorIntAttribute, VectorLongIntAttribute, VectorDoubleAttribute, GenCrossSection, GenHeavyIon, GenPdfInfo, HEPRUPAttribute, HEPEUPAttribute, and VectorStringAttribute.
|
inlinevirtual |
Optionally initialize the attribute after from_string.
Reimplemented in HEPEUPAttribute.
Definition at line 81 of file Attribute.h.
|
inlinevirtual |
Optionally initialize the attribute after from_string.
Is passed a reference to the GenRunInfo object to which the Attribute belongs.
Reimplemented in HEPEUPAttribute.
Definition at line 90 of file Attribute.h.
|
inline |
Check if this attribute is parsed.
Definition at line 102 of file Attribute.h.
References Attribute::m_is_parsed.
|
inline |
return the GenParticle to which this Attribute belongs, if at all.
Definition at line 113 of file Attribute.h.
References Attribute::m_particle.
|
inline |
return the GenParticle to which this Attribute belongs, if at all.
Definition at line 118 of file Attribute.h.
References Attribute::m_particle.
|
inlineprotected |
|
inlineprotected |
|
pure virtual |
Fill string from class content.
Implemented in IntAttribute, LongAttribute, DoubleAttribute, FloatAttribute, StringAttribute, CharAttribute, LongLongAttribute, LongDoubleAttribute, UIntAttribute, ULongAttribute, ULongLongAttribute, BoolAttribute, VectorCharAttribute, VectorFloatAttribute, VectorLongDoubleAttribute, VectorLongLongAttribute, VectorUIntAttribute, VectorULongAttribute, VectorULongLongAttribute, VectorIntAttribute, VectorLongIntAttribute, VectorDoubleAttribute, VectorStringAttribute, GenCrossSection, GenHeavyIon, GenPdfInfo, HEPRUPAttribute, and HEPEUPAttribute.
|
inline |
|
inline |
return the GenVertex to which this Attribute belongs, if at all.
Definition at line 123 of file Attribute.h.
References Attribute::m_vertex.
|
inline |
return the GenVertex to which this Attribute belongs, if at all.
Definition at line 128 of file Attribute.h.
References Attribute::m_vertex.
|
friend |
GenEvent is a friend.
Definition at line 69 of file Attribute.h.
|
private |
Possibility to be aware of the
Definition at line 145 of file Attribute.h.
|
private |
Is this attribute parsed?
Definition at line 143 of file Attribute.h.
|
private |
controlling GenEvent object.
Particle to which assigned.
Definition at line 147 of file Attribute.h.
|
private |
Raw (unparsed) string.
Definition at line 144 of file Attribute.h.
|
private |
Vertex to which assigned.
Definition at line 148 of file Attribute.h.