HepMC3 event record library
Public Member Functions | Protected Member Functions
StringAttribute Class Reference

Attribute that holds a string. More...

#include <Attribute.h>

+ Inheritance diagram for StringAttribute:
+ Collaboration diagram for StringAttribute:

Public Member Functions

 StringAttribute ()
 Default constructor - empty string. More...
 
 StringAttribute (const std::string &st)
 String-based constructor. More...
 
bool from_string (const std::string &att) override
 Implementation of Attribute::from_string. More...
 
bool to_string (std::string &att) const override
 Implementation of Attribute::to_string. More...
 
std::string value () const
 get the value associated to this Attribute. More...
 
void set_value (const std::string &s)
 set the value associated to this Attribute. 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...
 
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

void set_is_parsed (bool flag)
 Set is_parsed flag. More...
 
void set_unparsed_string (const std::string &st)
 Set unparsed string. More...
 

Detailed Description

Attribute that holds a string.

Default attribute constructed when reading input files. It can be then parsed by other attributes or left as a string.

Definition at line 336 of file Attribute.h.

Constructor & Destructor Documentation

StringAttribute ( )
inline

Default constructor - empty string.

Definition at line 340 of file Attribute.h.

StringAttribute ( const std::string &  st)
inline

String-based constructor.

The Attribute constructor used here marks that this is an unparsed string that can be (but does not have to be) parsed

Definition at line 348 of file Attribute.h.

Member Function Documentation

const GenEvent* event ( ) const
inlineinherited

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

Definition at line 109 of file Attribute.h.

References Attribute::m_event.

bool from_string ( const std::string &  att)
inlineoverridevirtual

Implementation of Attribute::from_string.

Implements Attribute.

Definition at line 351 of file Attribute.h.

References Attribute::set_unparsed_string().

virtual bool init ( )
inlinevirtualinherited

Optionally initialize the attribute after from_string.

Reimplemented in HEPEUPAttribute.

Definition at line 82 of file Attribute.h.

virtual bool init ( const GenRunInfo )
inlinevirtualinherited

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
inlineinherited

Check if this attribute is parsed.

Definition at line 103 of file Attribute.h.

References Attribute::m_is_parsed.

GenParticlePtr particle ( )
inlineinherited

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
inlineinherited

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)
inlineprotectedinherited

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)
inlineprotectedinherited

Set unparsed string.

Definition at line 138 of file Attribute.h.

References Attribute::m_string.

void set_value ( const std::string &  s)
inline

set the value associated to this Attribute.

Definition at line 368 of file Attribute.h.

References Attribute::set_unparsed_string().

bool to_string ( std::string &  att) const
inlineoverridevirtual

Implementation of Attribute::to_string.

Implements Attribute.

Definition at line 357 of file Attribute.h.

References Attribute::unparsed_string().

const std::string& unparsed_string ( ) const
inlineinherited

Get unparsed string.

Definition at line 106 of file Attribute.h.

References Attribute::m_string.

std::string value ( ) const
inline

get the value associated to this Attribute.

Definition at line 363 of file Attribute.h.

References Attribute::unparsed_string().

GenVertexPtr vertex ( )
inlineinherited

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
inlineinherited

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

Definition at line 129 of file Attribute.h.

References Attribute::m_vertex.


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