HepMC event record
Public Member Functions | Protected Member Functions | Private Attributes
Attribute Class Referenceabstract

Detailed Description

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 38 of file build/outputs/include/HepMC/Attribute.h.

#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 string &att)=0
 Fill class content from string. More...
 
virtual bool init (const GenEvent &)
 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 (string &att) const =0
 Fill string from class content. More...
 
bool is_parsed ()
 Check if this attribute is parsed. More...
 
const string & unparsed_string () const
 Get unparsed string. More...
 
 Attribute ()
 Default constructor. More...
 
virtual ~Attribute ()
 Virtual destructor. More...
 
virtual bool from_string (const string &att)=0
 Fill class content from string. More...
 
virtual bool init (const GenEvent &)
 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 (string &att) const =0
 Fill string from class content. More...
 
bool is_parsed ()
 Check if this attribute is parsed. More...
 
const string & unparsed_string () const
 Get unparsed string. More...
 

Protected Member Functions

 Attribute (const 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 string &st)
 Set unparsed string. More...
 
 Attribute (const 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 string &st)
 Set unparsed string. More...
 

Private Attributes

bool m_is_parsed
 Is this attribute parsed? More...
 
string m_string
 Raw (unparsed) string. More...
 

Constructor & Destructor Documentation

◆ Attribute() [1/4]

Attribute ( )
inline

Default constructor.

Definition at line 44 of file build/outputs/include/HepMC/Attribute.h.

◆ ~Attribute() [1/2]

virtual ~Attribute ( )
inlinevirtual

Virtual destructor.

Definition at line 47 of file build/outputs/include/HepMC/Attribute.h.

◆ Attribute() [2/4]

Attribute ( const string &  st)
inlineprotected

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 58 of file build/outputs/include/HepMC/Attribute.h.

◆ Attribute() [3/4]

Attribute ( )
inline

Default constructor.

Definition at line 44 of file include/HepMC/Attribute.h.

◆ ~Attribute() [2/2]

virtual ~Attribute ( )
inlinevirtual

Virtual destructor.

Definition at line 47 of file include/HepMC/Attribute.h.

◆ Attribute() [4/4]

Attribute ( const string &  st)
inlineprotected

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 58 of file include/HepMC/Attribute.h.

Member Function Documentation

◆ from_string() [1/2]

virtual bool from_string ( const string &  att)
pure virtual

◆ from_string() [2/2]

virtual bool from_string ( const string &  att)
pure virtual

◆ init() [1/4]

virtual bool init ( const GenEvent )
inlinevirtual

Optionally initialize the attribute after from_string.

Is passed a reference to the GenEvent object to which the Attribute belongs.

Reimplemented in HEPEUPAttribute, and HEPEUPAttribute.

Definition at line 73 of file build/outputs/include/HepMC/Attribute.h.

◆ init() [2/4]

virtual bool init ( const GenEvent )
inlinevirtual

Optionally initialize the attribute after from_string.

Is passed a reference to the GenEvent object to which the Attribute belongs.

Reimplemented in HEPEUPAttribute, and HEPEUPAttribute.

Definition at line 73 of file include/HepMC/Attribute.h.

◆ init() [3/4]

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, and HEPEUPAttribute.

Definition at line 82 of file include/HepMC/Attribute.h.

◆ init() [4/4]

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, and HEPEUPAttribute.

Definition at line 82 of file build/outputs/include/HepMC/Attribute.h.

◆ is_parsed() [1/2]

bool is_parsed ( )
inline

Check if this attribute is parsed.

Definition at line 94 of file build/outputs/include/HepMC/Attribute.h.

References Attribute::m_is_parsed.

◆ is_parsed() [2/2]

bool is_parsed ( )
inline

Check if this attribute is parsed.

Definition at line 94 of file include/HepMC/Attribute.h.

References Attribute::m_is_parsed.

◆ set_is_parsed() [1/2]

void set_is_parsed ( bool  flag)
inlineprotected

Set is_parsed flag.

Definition at line 101 of file include/HepMC/Attribute.h.

References Attribute::m_is_parsed.

◆ set_is_parsed() [2/2]

void set_is_parsed ( bool  flag)
inlineprotected

Set is_parsed flag.

Definition at line 101 of file build/outputs/include/HepMC/Attribute.h.

References Attribute::m_is_parsed.

◆ set_unparsed_string() [1/2]

void set_unparsed_string ( const string &  st)
inlineprotected

Set unparsed string.

Definition at line 104 of file build/outputs/include/HepMC/Attribute.h.

References Attribute::m_string.

◆ set_unparsed_string() [2/2]

void set_unparsed_string ( const string &  st)
inlineprotected

Set unparsed string.

Definition at line 104 of file include/HepMC/Attribute.h.

References Attribute::m_string.

◆ to_string() [1/2]

virtual bool to_string ( string &  att) const
pure virtual

◆ to_string() [2/2]

virtual bool to_string ( string &  att) const
pure virtual

◆ unparsed_string() [1/2]

const string& unparsed_string ( ) const
inline

Get unparsed string.

Definition at line 97 of file include/HepMC/Attribute.h.

References Attribute::m_string.

◆ unparsed_string() [2/2]

const string& unparsed_string ( ) const
inline

Get unparsed string.

Definition at line 97 of file build/outputs/include/HepMC/Attribute.h.

References Attribute::m_string.

Field Documentation

◆ m_is_parsed

bool m_is_parsed
private

Is this attribute parsed?

Definition at line 110 of file build/outputs/include/HepMC/Attribute.h.

◆ m_string

string m_string
private

Raw (unparsed) string.

Definition at line 111 of file build/outputs/include/HepMC/Attribute.h.


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