Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
PoPI::PhysicalQuantity Class Referenceabstract

#include <PoPI.hpp>

Inheritance diagram for PoPI::PhysicalQuantity:

Public Member Functions

 PhysicalQuantity (HAPI::Node const &a_node, PQ_class a_class)
virtual ~PhysicalQuantity ()
PQ_class Class (void) const
std::string const & tag (void) const
std::string const & label (void) const
std::string const & valueString (void) const
std::string const & unit (void) const
void toXMLList (std::vector< std::string > &a_XMLList, std::string const &a_indent1) const
virtual std::string valueToString (void) const =0

Detailed Description

The base class for all PhysicalQuantity classes.

Definition at line 403 of file PoPI.hpp.

Constructor & Destructor Documentation

◆ PhysicalQuantity()

PoPI::PhysicalQuantity::PhysicalQuantity ( HAPI::Node const & a_node,
PQ_class a_class )
Parameters
a_node[in] The HAPI::Node node to be parsed.
a_class[in] The class of the physical quantity.

Definition at line 30 of file PoPI_physicalQuantity.cc.

30 :
31 m_class( a_class ),
32 m_tag( a_node.name( ) ),
33 m_label( a_node.attribute( PoPI_labelChars ).value( ) ),
34 m_valueString( a_node.attribute( PoPI_valueChars ).value( ) ),
35 m_unit( a_node.attribute( PoPI_unitChars ).value( ) ) {
36
37}
#define PoPI_labelChars
Definition PoPI.hpp:90
#define PoPI_unitChars
#define PoPI_valueChars

Referenced by PoPI::PQ_double::PQ_double(), PoPI::PQ_double::PQ_double(), PoPI::PQ_fraction::PQ_fraction(), PoPI::PQ_integer::PQ_integer(), and PoPI::PQ_string::PQ_string().

◆ ~PhysicalQuantity()

PoPI::PhysicalQuantity::~PhysicalQuantity ( )
virtual

Definition at line 42 of file PoPI_physicalQuantity.cc.

42 {
43
44}

Member Function Documentation

◆ Class()

PQ_class PoPI::PhysicalQuantity::Class ( void ) const
inline

Returns the value of the m_class member.

Definition at line 416 of file PoPI.hpp.

Referenced by PoPI::getPhysicalQuantityAsDouble().

◆ label()

std::string const & PoPI::PhysicalQuantity::label ( void ) const
inline

Returns the value of the m_label member.

Definition at line 418 of file PoPI.hpp.

◆ tag()

std::string const & PoPI::PhysicalQuantity::tag ( void ) const
inline

Returns the value of the m_tag member.

Definition at line 417 of file PoPI.hpp.

◆ toXMLList()

void PoPI::PhysicalQuantity::toXMLList ( std::vector< std::string > & a_XMLList,
std::string const & a_indent1 ) const

Adds the contents of this to a_XMLList where each item in a_XMLList is one line (without linefeeds) to output as an XML representation of this.

Parameters
a_XMLList[in] The list to add an XML output representation of this to.
a_indent1[in] The amount of indentation to added to each line added to a_XMLList.

Definition at line 53 of file PoPI_physicalQuantity.cc.

53 {
54
55 std::string _unit;
56
57 if( m_unit.size( ) > 0 ) _unit = "\" unit=\"" + m_unit;
58
59 std::string header = a_indent1 + "<" + m_tag + " label=\"" + m_label + "\" value=\"" + valueToString( ) + _unit + "\"/>";
60 a_XMLList.push_back( std::move( header ) );
61}
virtual std::string valueToString(void) const =0

◆ unit()

std::string const & PoPI::PhysicalQuantity::unit ( void ) const
inline

Returns the value of the m_unit member.

Definition at line 420 of file PoPI.hpp.

Referenced by PoPI::Nucleus::energy().

◆ valueString()

std::string const & PoPI::PhysicalQuantity::valueString ( void ) const
inline

Returns the value of the valueString member.

Definition at line 419 of file PoPI.hpp.

Referenced by PoPI::PQ_string::value(), PoPI::PQ_fraction::valueToString(), and PoPI::PQ_string::valueToString().

◆ valueToString()

virtual std::string PoPI::PhysicalQuantity::valueToString ( void ) const
pure virtual

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