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

#include <PoPI.hpp>

Inheritance diagram for PoPI::PQ_suite:

Public Member Functions

 PQ_suite (HAPI::Node const &a_node)
 ~PQ_suite ()
std::string & label (void)
void toXMLList (std::vector< std::string > &a_XMLList, std::string const &a_indent1) const

Detailed Description

Suite for storing the values in an physical quantity.

Definition at line 528 of file PoPI.hpp.

Constructor & Destructor Documentation

◆ PQ_suite()

PoPI::PQ_suite::PQ_suite ( HAPI::Node const & a_node)
Parameters
a_node[in] The HAPI::Node node to be parsed.

Definition at line 22 of file PoPI_pq_suite.cc.

22 :
23 m_label( a_node.name( ) ) {
24
25 for( HAPI::Node child = a_node.first_child( ); !child.empty( ); child.to_next_sibling( ) ) {
26 std::string name( child.name( ) );
27 PhysicalQuantity *quantity;
28
29 if( name == PoPI_doubleChars ) {
30 quantity = new PQ_double( child ); }
31 else if( name == PoPI_integerChars ) {
32 quantity = new PQ_integer( child ); }
33 else if( name == PoPI_fractionChars ) {
34 quantity = new PQ_fraction( child ); }
35 else if( name == PoPI_stringChars ) {
36 quantity = new PQ_string( child ); }
37 else if( name == PoPI_shellChars ) {
38 quantity = new PQ_shell( child ); }
39 else {
40 continue;
41 }
42 push_back( quantity );
43 }
44}
#define PoPI_fractionChars
Definition PoPI.hpp:81
#define PoPI_doubleChars
Definition PoPI.hpp:79
#define PoPI_integerChars
Definition PoPI.hpp:80
#define PoPI_stringChars
Definition PoPI.hpp:82
#define PoPI_shellChars
Definition PoPI.hpp:83
const char * name(G4int ptype)

◆ ~PQ_suite()

PoPI::PQ_suite::~PQ_suite ( )

Definition at line 49 of file PoPI_pq_suite.cc.

49 {
50
51 std::string::size_type i1, __size = size( );
52
53 for( i1 = 0; i1 < __size; ++i1 ) delete (*this)[i1];
54}

Referenced by ~PQ_suite().

Member Function Documentation

◆ label()

std::string & PoPI::PQ_suite::label ( void )
inline

Definition at line 537 of file PoPI.hpp.

537{ return( m_label ); }

◆ toXMLList()

void PoPI::PQ_suite::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 63 of file PoPI_pq_suite.cc.

63 {
64
65 std::string indent2 = a_indent1 + " ";
66
67 if( size( ) == 0 ) return;
68 std::string header = a_indent1 + "<" + m_label + ">";
69 a_XMLList.push_back( std::move( header ) );
70 for( std::vector<PhysicalQuantity *>::const_iterator iter = begin( ); iter != end( ); ++iter )
71 (*iter)->toXMLList( a_XMLList, indent2 );
72 appendXMLEnd( a_XMLList, m_label );
73}
void appendXMLEnd(std::vector< std::string > &a_XMLList, std::string const &a_label)
Definition PoPI_misc.cc:53

Referenced by toXMLList().


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