Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
GIDI::Sums::Summands Class Reference

#include <GIDI.hpp>

Inheritance diagram for GIDI::Sums::Summands:

Public Member Functions

 Summands (Construction::Settings const &a_construction, HAPI::Node const &a_node, SetupInfo &a_setupInfo)
 ~Summands ()
std::size_t size () const
Summand::Base const * operator[] (std::size_t a_index) const
void toXMLList (GUPI::WriteInfo &a_writeInfo, std::string const &a_indent="") const
Public Member Functions inherited from GIDI::Form
 Form (FormType a_type)
 Form (std::string const &a_moniker, FormType a_type, std::string const &a_label)
 Form (HAPI::Node const &a_node, SetupInfo &a_setupInfo, FormType a_type, Suite *a_suite=nullptr)
 Form (Form const &a_form)
virtual ~Form ()
Formoperator= (Form const &a_rhs)
Suiteparent () const
std::string const & label () const
void setLabel (std::string const &a_label)
virtual std::string actualMoniker () const
std::string const & keyName () const
void setKeyName (std::string const &a_keyName)
std::string const & keyValue () const
virtual void setKeyValue (std::string const &a_keyName) const
FormType type () const
Form const * sibling (std::string a_label) const
GUPI::AncestryfindInAncestry3 (LUPI_maybeUnused std::string const &a_item)
GUPI::Ancestry const * findInAncestry3 (LUPI_maybeUnused std::string const &a_item) const
std::string xlinkItemKey () const
Public Member Functions inherited from GUPI::Ancestry
 Ancestry (std::string const &a_moniker, std::string const &a_attribute="")
virtual ~Ancestry ()
Ancestryoperator= (Ancestry const &a_ancestry)
std::string const & moniker () const
void setMoniker (std::string const &a_moniker)
Ancestryancestor ()
Ancestry const * ancestor () const
void setAncestor (Ancestry *a_ancestor)
std::string attribute () const
Ancestryroot ()
Ancestry const * root () const
bool isChild (Ancestry *a_instance)
bool isParent (Ancestry *a_parent)
bool isRoot () const
AncestryfindInAncestry (std::string const &a_href)
Ancestry const * findInAncestry (std::string const &a_href) const
virtual AncestryfindInAncestry3 (std::string const &a_item)=0
virtual Ancestry const * findInAncestry3 (std::string const &a_item) const =0
virtual LUPI_HOST void serialize (LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode)
std::string toXLink () const
void printXML () const

Additional Inherited Members

Static Public Member Functions inherited from GUPI::Ancestry
static std::string buildXLinkItemKey (std::string const &a_name, std::string const &a_key)

Detailed Description

This class represents the GNDS <summands> node.

Definition at line 4418 of file GIDI.hpp.

Constructor & Destructor Documentation

◆ Summands()

GIDI::Sums::Summands::Summands ( Construction::Settings const & a_construction,
HAPI::Node const & a_node,
SetupInfo & a_setupInfo )
Parameters
a_construction[in] Used to pass user options to the constructor.
a_node[in] The HAPI::Node to be parsed.
a_setupInfo[in] Information create my the Protare constructor to help in parsing.

Definition at line 272 of file GIDI_sums.cc.

272 :
273 Form( a_node, a_setupInfo, FormType::summands ) {
274
275 for( HAPI::Node child = a_node.first_child( ); !child.empty( ); child.to_next_sibling( ) ) {
276 std::string name( child.name( ) );
277
278 if( name == GIDI_sumsAddChars ) {
279 Summand::Add *add = new Summand::Add( a_construction, child, a_setupInfo );
280
281 add->setAncestor( this );
282 m_summands.push_back( add ); }
283 else {
284 std::cout << "Sums::Summand::Base: Ignoring unsupported Form '" << name << "'." << std::endl;
285 }
286 }
287}
#define GIDI_sumsAddChars
Definition GIDI.hpp:207
Form(FormType a_type)
Definition GIDI_form.cc:25
const char * name(G4int ptype)

◆ ~Summands()

GIDI::Sums::Summands::~Summands ( )

Definition at line 292 of file GIDI_sums.cc.

292 {
293
294 for( std::vector<Summand::Base *>::iterator iter = m_summands.begin( ); iter < m_summands.end( ); ++iter ) delete *iter;
295}

Referenced by ~Summands().

Member Function Documentation

◆ operator[]()

Summand::Base const * GIDI::Sums::Summands::operator[] ( std::size_t a_index) const
inline

Returns the summand at index a_index.

Definition at line 4428 of file GIDI.hpp.

◆ size()

std::size_t GIDI::Sums::Summands::size ( ) const
inline

Returns the number of summands in this.

Definition at line 4427 of file GIDI.hpp.

◆ toXMLList()

void GIDI::Sums::Summands::toXMLList ( GUPI::WriteInfo & a_writeInfo,
std::string const & a_indent = "" ) const
virtual

Fills the argument a_writeInfo with the XML lines that represent this. Recursively enters each sub-node.

Parameters
a_writeInfo[in/out] Instance containing incremental indentation and other information and stores the appended lines.
a_indent[in] The amount to indent this node.

Reimplemented from GUPI::Ancestry.

Definition at line 304 of file GIDI_sums.cc.

304 {
305
306 std::string indent2 = a_writeInfo.incrementalIndent( a_indent );
307
308 a_writeInfo.addNodeStarter( a_indent, moniker( ), "" );
309 for( std::vector<Summand::Base *>::const_iterator iter = m_summands.begin( ); iter != m_summands.end( ); ++iter ) (*iter)->toXMLList( a_writeInfo, indent2 );
310 a_writeInfo.addNodeEnder( moniker( ) );
311}
std::string const & moniker() const
Definition GUPI.hpp:102
void addNodeEnder(std::string const &a_moniker)
Definition GUPI.hpp:59
std::string incrementalIndent(std::string const &indent)
Definition GUPI.hpp:52
void addNodeStarter(std::string const &indent, std::string const &a_moniker, std::string const &a_attributes="")
Definition GUPI.hpp:55

Referenced by GIDI::Sums::CrossSectionSum::toXMLList(), GIDI::Sums::MultiplicitySum::toXMLList(), and toXMLList().


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