MARLEY (Model of Argon Reaction Low Energy Yields) v2.0.0
A Monte Carlo event generator for tens-of-MeV neutrino interactions
Loading...
Searching...
No Matches
HepMC3::StringAttribute Class Reference

Attribute that holds a string. More...

#include <Attribute.h>

Inheritance diagram for HepMC3::StringAttribute:
HepMC3::Attribute

Public Member Functions

 StringAttribute ()
 Default constructor - empty string.
 
 StringAttribute (const std::string &st)
 String-based constructor.
 
bool from_string (const std::string &att) override
 Implementation of Attribute::from_string.
 
void set_value (const std::string &s)
 set the value associated to this Attribute.
 
bool to_string (std::string &att) const override
 Implementation of Attribute::to_string.
 
std::string value () const
 get the value associated to this Attribute.
 
- Public Member Functions inherited from HepMC3::Attribute
 Attribute ()
 Default constructor.
 
virtual ~Attribute ()
 Virtual destructor.
 
const GenEventevent () const
 
virtual bool init ()
 Optionally initialize the attribute after from_string.
 
virtual bool init (const GenRunInfo &)
 Optionally initialize the attribute after from_string.
 
bool is_parsed () const
 Check if this attribute is parsed.
 
GenParticlePtr particle ()
 
ConstGenParticlePtr particle () const
 
const std::string & unparsed_string () const
 Get unparsed string.
 
GenVertexPtr vertex ()
 
ConstGenVertexPtr vertex () const
 

Additional Inherited Members

- Protected Member Functions inherited from HepMC3::Attribute
 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.
 

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

Constructor & Destructor Documentation

◆ StringAttribute() [1/2]

HepMC3::StringAttribute::StringAttribute ( )
inline

Default constructor - empty string.

Definition at line 347 of file Attribute.h.

347:Attribute() {}
Attribute()
Default constructor.
Definition Attribute.h:51

References HepMC3::Attribute::Attribute().

◆ StringAttribute() [2/2]

HepMC3::StringAttribute::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 355 of file Attribute.h.

355:Attribute(st) {}

References HepMC3::Attribute::Attribute().

Member Function Documentation

◆ from_string()

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

Implementation of Attribute::from_string.

Implements HepMC3::Attribute.

Definition at line 358 of file Attribute.h.

358 {
360 return true;
361 }
void set_unparsed_string(const std::string &st)
Set unparsed string.
Definition Attribute.h:137

References HepMC3::Attribute::set_unparsed_string().

◆ set_value()

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

set the value associated to this Attribute.

Definition at line 375 of file Attribute.h.

375 {
377 }

References HepMC3::Attribute::set_unparsed_string().

◆ to_string()

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

Implementation of Attribute::to_string.

Implements HepMC3::Attribute.

Definition at line 364 of file Attribute.h.

364 {
365 att = unparsed_string();
366 return true;
367 }
const std::string & unparsed_string() const
Get unparsed string.
Definition Attribute.h:105

References HepMC3::Attribute::unparsed_string().

◆ value()

std::string HepMC3::StringAttribute::value ( ) const
inline

get the value associated to this Attribute.

Definition at line 370 of file Attribute.h.

370 {
371 return unparsed_string();
372 }

References HepMC3::Attribute::unparsed_string().

Referenced by marley::OutputFileRoot::resume().


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