HepMC3 event record library
Public Member Functions | Protected Member Functions | Private Attributes | Friends
Attribute Class Referenceabstract

Forward declaration of GenParticle. More...

#include <Attribute.h>

+ Inheritance diagram for Attribute:
+ Collaboration diagram for Attribute:

Public Member Functions

 Attribute ()
 Default constructor. More...
 
virtual ~Attribute ()
 Virtual destructor. More...
 
virtual bool from_string (const std::string &att)=0
 Fill class content from string. More...
 
virtual bool init ()
 Optionally initialize the attribute after from_string. More...
 
virtual bool init (const GenRunInfo &)
 Optionally initialize the attribute after from_string. More...
 
virtual bool to_string (std::string &att) const =0
 Fill string from class content. More...
 
bool is_parsed () const
 Check if this attribute is parsed. More...
 
const std::string & unparsed_string () const
 Get unparsed string. More...
 
const GenEventevent () 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. More...
 
void set_is_parsed (bool flag)
 Set is_parsed flag. More...
 
void set_unparsed_string (const std::string &st)
 Set unparsed string. More...
 

Private Attributes

bool m_is_parsed
 Is this attribute parsed? More...
 
std::string m_string
 Raw (unparsed) string. More...
 
const GenEventm_event
 
GenParticlePtr m_particle
 controlling GenEvent object. More...
 
GenVertexPtr m_vertex
 Vertex to which assigned. More...
 

Friends

class GenEvent
 GenEvent is a friend. More...
 

Detailed Description

Forward declaration of GenParticle.

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 45 of file Attribute.h.

Constructor & Destructor Documentation

Attribute ( )
inline

Default constructor.

Definition at line 52 of file Attribute.h.

References Attribute::m_event.

virtual ~Attribute ( )
inlinevirtual

Virtual destructor.

Definition at line 55 of file Attribute.h.

Attribute ( const std::string &  st)
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.

Note
There should be no need for user class to ever use this constructor

Definition at line 67 of file Attribute.h.

References Attribute::m_event.

Member Function Documentation

const GenEvent* event ( ) const
inline

return the GenEvent to which this Attribute belongs, if at all.

Definition at line 109 of file Attribute.h.

References Attribute::m_event.

virtual bool from_string ( const std::string &  att)
pure virtual
virtual bool init ( )
inlinevirtual

Optionally initialize the attribute after from_string.

Reimplemented in HEPEUPAttribute.

Definition at line 82 of file Attribute.h.

virtual bool init ( const GenRunInfo )
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 91 of file Attribute.h.

bool is_parsed ( ) const
inline

Check if this attribute is parsed.

Definition at line 103 of file Attribute.h.

References Attribute::m_is_parsed.

GenParticlePtr particle ( )
inline

return the GenParticle to which this Attribute belongs, if at all.

Definition at line 114 of file Attribute.h.

References Attribute::m_particle.

ConstGenParticlePtr particle ( ) const
inline

return the GenParticle to which this Attribute belongs, if at all.

Definition at line 119 of file Attribute.h.

References Attribute::m_particle.

void set_is_parsed ( bool  flag)
inlineprotected

Set is_parsed flag.

Definition at line 135 of file Attribute.h.

References Attribute::m_is_parsed.

void set_unparsed_string ( const std::string &  st)
inlineprotected

Set unparsed string.

Definition at line 138 of file Attribute.h.

References Attribute::m_string.

virtual bool to_string ( std::string &  att) const
pure virtual
const std::string& unparsed_string ( ) const
inline

Get unparsed string.

Definition at line 106 of file Attribute.h.

References Attribute::m_string.

GenVertexPtr vertex ( )
inline

return the GenVertex to which this Attribute belongs, if at all.

Definition at line 124 of file Attribute.h.

References Attribute::m_vertex.

ConstGenVertexPtr vertex ( ) const
inline

return the GenVertex to which this Attribute belongs, if at all.

Definition at line 129 of file Attribute.h.

References Attribute::m_vertex.

Friends And Related Function Documentation

friend class GenEvent
friend

GenEvent is a friend.

Definition at line 70 of file Attribute.h.

Field Documentation

const GenEvent* m_event
private

Possibility to be aware of the

Definition at line 146 of file Attribute.h.

bool m_is_parsed
private

Is this attribute parsed?

Definition at line 144 of file Attribute.h.

GenParticlePtr m_particle
private

controlling GenEvent object.

Particle to which assigned.

Definition at line 148 of file Attribute.h.

std::string m_string
private

Raw (unparsed) string.

Definition at line 145 of file Attribute.h.

GenVertexPtr m_vertex
private

Vertex to which assigned.

Definition at line 149 of file Attribute.h.


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