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

Attribute that holds a vector of integers of type unsigned long long. More...

#include <Attribute.h>

Inheritance diagram for HepMC3::VectorULongLongAttribute:
HepMC3::Attribute

Public Member Functions

 VectorULongLongAttribute ()
 Default constructor.
 
 VectorULongLongAttribute (std::vector< unsigned long long > val)
 Constructor initializing attribute value.
 
bool from_string (const std::string &att) override
 Implementation of Attribute::from_string.
 
void set_value (const std::vector< unsigned long long > &i)
 set the value associated to this Attribute.
 
bool to_string (std::string &att) const override
 Implementation of Attribute::to_string.
 
std::vector< unsigned 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 a vector of integers of type unsigned long long.

Definition at line 992 of file Attribute.h.

Constructor & Destructor Documentation

◆ VectorULongLongAttribute() [1/2]

HepMC3::VectorULongLongAttribute::VectorULongLongAttribute ( )
inline

Default constructor.

Definition at line 996 of file Attribute.h.

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

References HepMC3::Attribute::Attribute().

◆ VectorULongLongAttribute() [2/2]

HepMC3::VectorULongLongAttribute::VectorULongLongAttribute ( std::vector< unsigned long long > val)
inline

Constructor initializing attribute value.

Definition at line 999 of file Attribute.h.

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

References HepMC3::Attribute::Attribute().

Member Function Documentation

◆ from_string()

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

Implementation of Attribute::from_string.

Implements HepMC3::Attribute.

Definition at line 1002 of file Attribute.h.

1002 {
1003 unsigned long long datafoo;
1004 m_val.clear();
1005 std::stringstream datastream(att);
1006 while (datastream >> datafoo) m_val.emplace_back(datafoo);
1007 set_is_parsed(true);
1008 return true;
1009 }
void set_is_parsed(bool flag)
Set is_parsed flag.
Definition Attribute.h:134

References HepMC3::Attribute::set_is_parsed().

◆ set_value()

void HepMC3::VectorULongLongAttribute::set_value ( const std::vector< unsigned long long > & i)
inline

set the value associated to this Attribute.

Definition at line 1024 of file Attribute.h.

1024 {
1025 m_val = i;
1026 set_is_parsed(true);
1027 }

References HepMC3::Attribute::set_is_parsed().

◆ to_string()

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

Implementation of Attribute::to_string.

Implements HepMC3::Attribute.

Definition at line 1012 of file Attribute.h.

1012 {
1013 att.clear();
1014 for (const auto& a: m_val) {if (att.length()) att+=" "; att+=std::to_string(a);}
1015 return true;
1016 }

◆ value()

std::vector< unsigned long long > HepMC3::VectorULongLongAttribute::value ( ) const
inline

get the value associated to this Attribute.

Definition at line 1019 of file Attribute.h.

1019 {
1020 return m_val;
1021 }

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