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

Attribute that holds an Integer implemented as a long long int. More...

#include <Attribute.h>

Inheritance diagram for HepMC3::LongLongAttribute:
HepMC3::Attribute

Public Member Functions

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

Definition at line 434 of file Attribute.h.

Constructor & Destructor Documentation

◆ LongLongAttribute() [1/2]

HepMC3::LongLongAttribute::LongLongAttribute ( )
inline

Default constructor.

Definition at line 438 of file Attribute.h.

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

References HepMC3::Attribute::Attribute().

◆ LongLongAttribute() [2/2]

HepMC3::LongLongAttribute::LongLongAttribute ( long long val)
inline

Constructor initializing attribute value.

Definition at line 441 of file Attribute.h.

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

References HepMC3::Attribute::Attribute().

Member Function Documentation

◆ from_string()

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

Implementation of Attribute::from_string.

Implements HepMC3::Attribute.

Definition at line 444 of file Attribute.h.

444 {
445 m_val = atoll( att.c_str() );
446 set_is_parsed(true);
447 return true;
448 }
void set_is_parsed(bool flag)
Set is_parsed flag.
Definition Attribute.h:134

References HepMC3::Attribute::set_is_parsed().

◆ set_value()

void HepMC3::LongLongAttribute::set_value ( const long long & l)
inline

set the value associated to this Attribute.

Definition at line 462 of file Attribute.h.

462 {
463 m_val = l;
464 set_is_parsed(true);
465 }

References HepMC3::Attribute::set_is_parsed().

◆ to_string()

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

Implementation of Attribute::to_string.

Implements HepMC3::Attribute.

Definition at line 451 of file Attribute.h.

451 {
452 att = std::to_string(m_val);
453 return true;
454 }

◆ value()

long long HepMC3::LongLongAttribute::value ( ) const
inline

get the value associated to this Attribute.

Definition at line 457 of file Attribute.h.

457 {
458 return m_val;
459 }

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