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

#include <GIDI.hpp>

Inheritance diagram for GIDI::Styles::Suite:

Public Member Functions

 Suite ()
std::string const * findLabelInLineage (GIDI::Suite const &a_suite, std::string const &a_label) const
std::vector< std::vector< Base const * > > chains (bool a_ends) const
void updateChainEnds ()
std::vector< Base const * > const & chainEnds () const
std::vector< Base const * > const & preProcessingChainEnds () const
Public Member Functions inherited from GIDI::Suite
 Suite (std::string const &a_keyName=GIDI_labelChars)
 Suite (std::string const &a_moniker, std::string const &a_keyName)
 Suite (Construction::Settings const &a_construction, std::string const &a_moniker, std::string const &a_keyName, HAPI::Node const &a_node, SetupInfo &a_setupInfo, PoPI::Database const &a_pops, PoPI::Database const &a_internalPoPs, parseSuite a_parseSuite, Styles::Suite const *a_styles, bool a_allowsLazyParsing=false)
 ~Suite ()
std::string const & keyName () const
std::size_t size () const
iterator begin ()
const_iterator begin () const
iterator end ()
const_iterator end () const
std::size_t operator[] (std::string const &a_label) const
template<typename T>
T * get (std::size_t a_Index)
template<typename T>
T const * get (std::size_t a_Index) const
template<typename T>
T * get (std::string const &a_label)
template<typename T>
T const * get (std::string const &a_label) const
template<typename T>
T * getViaLineage (std::string const &a_label)
template<typename T>
T * getViaLineage (std::string const &a_label) const
template<typename T>
T * pop (std::size_t a_Index)
template<typename T>
T * pop (std::string const &a_label)
Styles::Suite const * styles ()
std::string const & href () const
void parse (Construction::Settings const &a_construction, HAPI::Node const &a_node, SetupInfo &a_setupInfo, PoPI::Database const &a_pops, PoPI::Database const &a_internalPoPs, parseSuite a_parseSuite, Styles::Suite const *a_styles)
void add (Form *a_form)
iterator find (std::string const &a_label, bool a_convertLazyParsingHelperForm=false)
const_iterator find (std::string const &a_label, bool a_convertLazyParsingHelperForm=false) const
bool has (std::string const &a_label) const
FormcheckLazyParsingHelperForm (std::size_t a_index)
FormcheckLazyParsingHelperForm (std::size_t a_index) const
iterator checkLazyParsingHelperFormIterator (iterator a_iter)
const_iterator checkLazyParsingHelperFormIterator (const_iterator a_iter) const
void modifiedMultiGroupElasticForTNSL (std::map< std::string, std::size_t > const &a_maximumTNSL_MultiGroupIndex)
GUPI::AncestryfindInAncestry3 (std::string const &a_item)
GUPI::Ancestry const * findInAncestry3 (std::string const &a_item) const
std::vector< iteratorfindAllOfMoniker (std::string const &a_moniker)
std::vector< const_iteratorfindAllOfMoniker (std::string const &a_moniker) const
Form const * findInstanceOfTypeInLineage (std::string const &_label, std::string const &a_moniker) const
FormfindInstanceOfTypeInLineage (Styles::Suite const &a_styles, std::string const &_label, std::string const &a_moniker)
void toXMLList (GUPI::WriteInfo &a_writeInfo, std::string const &a_indent="") const
void printFormLabels (std::string const &a_header) const
template<typename T>
T const * get (std::size_t a_index) const
template<typename T>
T const * get (std::string const &a_label) const
template<typename T>
T const * get (std::size_t a_index) const
template<typename T>
T const * get (std::string const &a_label) 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 LUPI_HOST void serialize (LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode)
virtual std::string xlinkItemKey () const
std::string toXLink () const
void printXML () const

Additional Inherited Members

Public Types inherited from GIDI::Suite
typedef std::vector< Form * > Forms
typedef Forms::iterator iterator
typedef Forms::const_iterator const_iterator
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 is essentially the GIDI::Suite class with the addition of the findLabelInLineage method.

Definition at line 3392 of file GIDI.hpp.

Constructor & Destructor Documentation

◆ Suite()

GIDI::Styles::Suite::Suite ( )

Definition at line 24 of file GIDI_styles.cc.

24 :
25 GIDI::Suite( GIDI_stylesChars ) {
26
27}
#define GIDI_stylesChars
Definition GIDI.hpp:177

Referenced by Suite().

Member Function Documentation

◆ chainEnds()

std::vector< Base const * > const & GIDI::Styles::Suite::chainEnds ( ) const
inline

Returns a const reference to the m_chainEnds member.

Definition at line 3404 of file GIDI.hpp.

◆ chains()

std::vector< std::vector< Base const * > > GIDI::Styles::Suite::chains ( bool a_ends) const
Parameters
a_ends[in] If true only the end of each chain is returned.
a_styles[in] The style's suite whose styles are analyzed.
Returns

Definition at line 66 of file GIDI_styles.cc.

66 {
67
68 std::vector< std::vector< Base const * > > chains1;
69
70 for( auto iter = begin( ); iter != end( ); ++iter ) {
71 Base const *base = static_cast<Base const *>( *iter );
72 chains1.push_back( base->chain( ) );
73 }
74
75 if( a_ends ) {
76 std::vector< std::vector<Base const *> > chains2;
77 for( auto iter1 = chains1.begin( ); iter1 != chains1.end( ); ++iter1 ) {
78 Base const *head = (*iter1)[0];
79 bool found = false;
80 for( auto iter2 = chains1.begin( ); iter2 != chains1.end( ); ++iter2 ) {
81 if( (*iter2)[0]->isStyleInDerivedForm( head ) ) {
82 found = true;
83 break;
84 }
85 }
86 if( !found ) {
87 std::vector< Base const * > item;
88 item.push_back( head );
89 chains2.push_back( item );
90 }
91 }
92 chains1 = chains2;
93 }
94
95 return( chains1 );
96}
iterator begin()
Definition GIDI.hpp:2594
iterator end()
Definition GIDI.hpp:2596

Referenced by updateChainEnds().

◆ findLabelInLineage()

std::string const * GIDI::Styles::Suite::findLabelInLineage ( GIDI::Suite const & a_suite,
std::string const & a_label ) const

Searches the Suite a_suite for a form with label a_label or, if not found, recursively ascends the derivedFrom until a derived form is found. The this instance must be an <styles> node so that the **derivedFrom**s can be ascended. If no form is found, an empty string is returned.

Parameters
a_suite[in] The Suite, typically a component, whose forms are searched for a form with label a_label or one of its derivedFrom.
a_label[in] The label of the form to start the search.
Returns
The label of the form found or an empty string if none is found.

Definition at line 39 of file GIDI_styles.cc.

39 {
40
41 std::string const *label = &a_label;
42 Suite::const_iterator iter = a_suite.find( a_label );
43
44 while( true ) {
45 if( iter != a_suite.end( ) ) return( label );
46
47 Base const *form = get<Base>( *label );
48 form = form->getDerivedStyle( );
49 label = &form->keyValue( );
50 if( *label == "" ) break;
51 iter = a_suite.find( *label );
52 }
53
54 return( label );
55}
T * get(std::size_t a_Index)
Definition GIDI.hpp:2642
Forms::const_iterator const_iterator
Definition GIDI.hpp:2593

Referenced by MCGIDI::Distributions::parseGIDI().

◆ preProcessingChainEnds()

std::vector< Base const * > const & GIDI::Styles::Suite::preProcessingChainEnds ( ) const
inline

Returns a const reference to the m_preProcessingChainEnds member.

Definition at line 3405 of file GIDI.hpp.

Referenced by MCGIDI::Functions::parseMultiplicityFunction1d().

◆ updateChainEnds()

void GIDI::Styles::Suite::updateChainEnds ( )

This methods updates the m_chainEnds member of this.

Definition at line 102 of file GIDI_styles.cc.

102 {
103
104 m_chainEnds.clear( );
105 m_preProcessingChainEnds.clear( );
106
107 auto chains1 = chains( true );
108 for( auto iter = chains1.begin( ); iter != chains1.end( ); ++iter ) m_chainEnds.push_back( (*iter)[0] );
109
110 chains1 = chains( false );
111 std::vector<Base const *> preProcessingChains;
112 for( auto iter = chains1.begin( ); iter != chains1.end( ); ++iter ) {
113 auto moniker = (*iter)[0]->moniker( );
115 || ( moniker == GIDI_realizationChars ) ) {
116 preProcessingChains.push_back( (*iter)[0] );
117 }
118 }
119
120 for( auto iter1 = preProcessingChains.begin( ); iter1 != preProcessingChains.end( ); ++iter1 ) {
121 bool found = false;
122 for( auto iter2 = preProcessingChains.begin( ); iter2 != preProcessingChains.end( ); ++iter2 ) {
123 if( (*iter2)->isStyleInDerivedForm( *iter1 ) ) {
124 found = true;
125 break;
126 }
127 }
128 if( !found ) {
129 m_preProcessingChainEnds.push_back( *iter1 );
130 }
131 }
132}
#define GIDI_realizationChars
Definition GIDI.hpp:249
#define GIDI_evaluatedStyleChars
Definition GIDI.hpp:240
#define GIDI_crossSectionReconstructedStyleChars
Definition GIDI.hpp:241
std::vector< std::vector< Base const * > > chains(bool a_ends) const
std::string const & moniker() const
Definition GUPI.hpp:102

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