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

#include <GIDI.hpp>

Inheritance diagram for GIDI::Axis:

Public Member Functions

 Axis (HAPI::Node const &a_node, SetupInfo &a_setupInfo, FormType a_type=FormType::axis)
 Axis (int a_index, std::string const &a_label, std::string const &a_unit, FormType a_type=FormType::axis)
 Axis (Axis const &a_axis)
virtual ~Axis ()
int index () const
std::string const & unit () const
std::string const & href () 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

Class to store an axis or the base class for a Grid instance. The type is "axis" if the instance is an Axis or is "grid" if the instance is a Grid.

Definition at line 799 of file GIDI.hpp.

Constructor & Destructor Documentation

◆ Axis() [1/3]

GIDI::Axis::Axis ( HAPI::Node const & a_node,
SetupInfo & a_setupInfo,
FormType a_type = FormType::axis )
Parameters
a_node[in] The HAPI::Node to be parsed and used to construct the Axis.
a_setupInfo[in] Information create my the Protare constructor to help in parsing.
a_type[in] The type is either "axis" or "grid".

Definition at line 42 of file GIDI_axis.cc.

42 :
43 Form( a_node, a_setupInfo, a_type ),
44 m_index( a_node.attribute_as_int( GIDI_indexChars ) ),
45 m_unit( a_node.attribute_as_string( GIDI_unitChars ) ),
46 m_href( a_node.attribute_as_string( GIDI_hrefChars ) ) {
47
48}
#define GIDI_hrefChars
Definition GIDI.hpp:440
#define GIDI_unitChars
Definition GIDI.hpp:439
#define GIDI_indexChars
Definition GIDI.hpp:437
Form(FormType a_type)
Definition GIDI_form.cc:25

Referenced by Axis(), GIDI::Grid::Grid(), and GIDI::Grid::Grid().

◆ Axis() [2/3]

GIDI::Axis::Axis ( int a_index,
std::string const & a_label,
std::string const & a_unit,
FormType a_type = FormType::axis )
Parameters
a_index[in] The index for the axis.
a_label[in] The label for the axes.
a_unit[in] The unit for the axis.
a_type[in] The type is either "axis" or "grid".

Definition at line 28 of file GIDI_axis.cc.

28 :
29 Form( GIDI_axisChars, a_type, a_label ),
30 m_index( a_index ),
31 m_unit( a_unit ) {
32
33}
#define GIDI_axisChars
Definition GIDI.hpp:383

◆ Axis() [3/3]

GIDI::Axis::Axis ( Axis const & a_axis)

Copy constructor for the Axis class.

Parameters
a_axis[in] The Axis instance to copy.

Definition at line 56 of file GIDI_axis.cc.

56 :
57 Form( a_axis ),
58 m_index( a_axis.index( ) ),
59 m_unit( a_axis.unit( ) ),
60 m_href( a_axis.href( ) ) {
61
62}

◆ ~Axis()

GIDI::Axis::~Axis ( )
virtual

Definition at line 67 of file GIDI_axis.cc.

67 {
68
69}

Member Function Documentation

◆ href()

std::string const & GIDI::Axis::href ( ) const
inline

Returns the value of the m_href member.

Definition at line 815 of file GIDI.hpp.

Referenced by Axis(), GIDI::Grid::Grid(), and GIDI::Grid::toXMLList().

◆ index()

int GIDI::Axis::index ( ) const
inline

Returns the value of the m_index member.

Definition at line 812 of file GIDI.hpp.

Referenced by Axis(), toXMLList(), and GIDI::Grid::toXMLList().

◆ toXMLList()

void GIDI::Axis::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.

Reimplemented in GIDI::Grid.

Definition at line 78 of file GIDI_axis.cc.

78 {
79
80 std::string indent2 = a_writeInfo.incrementalIndent( a_indent );
81 std::string attributes = a_writeInfo.addAttribute( GIDI_indexChars, intToString( index( ) ) );
82
83 if( m_href == "" ) {
84 attributes += a_writeInfo.addAttribute( GIDI_labelChars, label( ) );
85 attributes += a_writeInfo.addAttribute( GIDI_unitChars, unit( ) );
86 a_writeInfo.addNodeStarterEnder( a_indent, moniker( ), attributes ); }
87 else {
88 attributes += a_writeInfo.addAttribute( GIDI_hrefChars, m_href );
89 a_writeInfo.addNodeStarterEnder( a_indent, moniker( ), attributes );
90 }
91}
#define GIDI_labelChars
Definition GIDI.hpp:438
std::string const & unit() const
Definition GIDI.hpp:813
int index() const
Definition GIDI.hpp:812
std::string const & label() const
Definition GIDI.hpp:658
std::string const & moniker() const
Definition GUPI.hpp:102
void addNodeStarterEnder(std::string const &indent, std::string const &a_moniker, std::string const &a_attributes="")
Definition GUPI.hpp:57
std::string incrementalIndent(std::string const &indent)
Definition GUPI.hpp:52
std::string addAttribute(std::string const &a_name, std::string const &a_value) const
Definition GUPI.hpp:60
std::string intToString(int a_value)
Definition GIDI_misc.cc:415

◆ unit()

std::string const & GIDI::Axis::unit ( ) const
inline

Returns the value of the m_unit member.

Definition at line 813 of file GIDI.hpp.

Referenced by Axis(), toXMLList(), and GIDI::Grid::toXMLList().


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