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::CharAttribute Class Reference

Attribute that holds an Character implemented as an int. More...

#include <Attribute.h>

Inheritance diagram for HepMC3::CharAttribute:
HepMC3::Attribute

Public Member Functions

 CharAttribute ()
 Default constructor.
 
 CharAttribute (char val)
 Constructor initializing attribute value.
 
bool from_string (const std::string &att) override
 Implementation of Attribute::from_string.
 
void set_value (const char &i)
 set the value associated to this Attribute.
 
bool to_string (std::string &att) const override
 Implementation of Attribute::to_string.
 
char 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 an Character implemented as an int.

Definition at line 387 of file Attribute.h.

Constructor & Destructor Documentation

◆ CharAttribute() [1/2]

HepMC3::CharAttribute::CharAttribute ( )
inline

Default constructor.

Definition at line 391 of file Attribute.h.

391:Attribute(),m_val(0) {}
Attribute()
Default constructor.
Definition Attribute.h:51

References HepMC3::Attribute::Attribute().

◆ CharAttribute() [2/2]

HepMC3::CharAttribute::CharAttribute ( char val)
inline

Constructor initializing attribute value.

Definition at line 394 of file Attribute.h.

394:Attribute(),m_val(val) {}

References HepMC3::Attribute::Attribute().

Member Function Documentation

◆ from_string()

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

Implementation of Attribute::from_string.

Implements HepMC3::Attribute.

Definition at line 397 of file Attribute.h.

397 {
398 set_is_parsed(true);
399 if (att.size())
400 {
401 m_val = att.at(0);
402 return true;
403 }
404 return false;
405 }
void set_is_parsed(bool flag)
Set is_parsed flag.
Definition Attribute.h:134

References HepMC3::Attribute::set_is_parsed().

◆ set_value()

void HepMC3::CharAttribute::set_value ( const char & i)
inline

set the value associated to this Attribute.

Definition at line 419 of file Attribute.h.

419 {
420 m_val = i;
421 set_is_parsed(true);
422 }

References HepMC3::Attribute::set_is_parsed().

◆ to_string()

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

Implementation of Attribute::to_string.

Implements HepMC3::Attribute.

Definition at line 408 of file Attribute.h.

408 {
409 att = std::to_string(m_val);
410 return true;
411 }

◆ value()

char HepMC3::CharAttribute::value ( ) const
inline

get the value associated to this Attribute.

Definition at line 414 of file Attribute.h.

414 {
415 return m_val;
416 }

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