|
GridFire v0.7.1_rc2
General Purpose Nuclear Network
|
A ReactionChainPolicy composed of multiple child ReactionChainPolicy instances. More...
#include <policy_logical.h>
Public Member Functions | |
| MultiReactionChainPolicy (std::vector< std::unique_ptr< ReactionChainPolicy > > &&chain_policies) | |
| Constructs a MultiReactionChainPolicy from a vector of ReactionChainPolicy instances. | |
| const std::vector< std::unique_ptr< ReactionChainPolicy > > & | get_chain_policies () const |
| Returns the vector of child ReactionChainPolicy instances. | |
| const reaction::ReactionSet & | get_reactions () const override |
| Returns the combined ReactionSet of all child chain policies. | |
| bool | contains (const std::string &id) const override |
| Checks if the MultiReactionChainPolicy contains a reaction by ID. | |
| bool | contains (const reaction::Reaction &reaction) const override |
| Checks if the MultiReactionChainPolicy contains a specific reaction. | |
| std::unique_ptr< ReactionChainPolicy > | clone () const override |
| Creates a deep copy of the MultiReactionChainPolicy. | |
| std::string | name () const override |
| Returns the name of the MultiReactionChainPolicy. | |
| uint64_t | hash (uint64_t seed) const override |
| Computes a hash value for the MultiReactionChainPolicy. | |
| bool | operator== (const ReactionChainPolicy &other) const override |
| Equality comparison operator. | |
| bool | operator!= (const ReactionChainPolicy &other) const override |
| Inequality comparison operator. | |
| size_t | size () const |
| Returns the number of child ReactionChainPolicy instances. | |
| auto | begin () |
| Returns iterator to the beginning of the child ReactionChainPolicy instances. | |
| auto | begin () const |
| Returns const iterator to the beginning of the child ReactionChainPolicy instances. | |
| auto | end () |
| Returns iterator to the end of the child ReactionChainPolicy instances. | |
| auto | end () const |
| Returns const iterator to the end of the child ReactionChainPolicy instances. | |
Public Member Functions inherited from gridfire::policy::ReactionChainPolicy | |
| virtual | ~ReactionChainPolicy ()=default |
Protected Attributes | |
| std::vector< std::unique_ptr< ReactionChainPolicy > > | m_chain_policies {} |
| Child chain policies. | |
| reaction::ReactionSet | m_reactions |
| Combined reactions from all child policies. | |
A ReactionChainPolicy composed of multiple child ReactionChainPolicy instances.
Useful for policies that represent a union of several reaction chains (for example the LowMassMainSequenceReactionChainPolicy composes the proton-proton and CNO chains).
|
explicit |
Constructs a MultiReactionChainPolicy from a vector of ReactionChainPolicy instances.
The provided chain policies are moved into the new MultiReactionChainPolicy instance.
| chain_policies | vector of unique_ptr to ReactionChainPolicy instances. |
|
inline |
Returns iterator to the beginning of the child ReactionChainPolicy instances.
|
inline |
Returns const iterator to the beginning of the child ReactionChainPolicy instances.
|
overridevirtual |
Creates a deep copy of the MultiReactionChainPolicy.
Implements gridfire::policy::ReactionChainPolicy.
|
overridevirtual |
Checks if the MultiReactionChainPolicy contains a specific reaction.
| reaction | the Reaction to check for. |
Implements gridfire::policy::ReactionChainPolicy.
|
overridevirtual |
Checks if the MultiReactionChainPolicy contains a reaction by ID.
| id | the reaction ID to check for. |
Implements gridfire::policy::ReactionChainPolicy.
|
inline |
Returns iterator to the end of the child ReactionChainPolicy instances.
|
inline |
Returns const iterator to the end of the child ReactionChainPolicy instances.
| const std::vector< std::unique_ptr< ReactionChainPolicy > > & gridfire::policy::MultiReactionChainPolicy::get_chain_policies | ( | ) | const |
Returns the vector of child ReactionChainPolicy instances.
|
overridevirtual |
Returns the combined ReactionSet of all child chain policies.
Implements gridfire::policy::ReactionChainPolicy.
|
overridevirtual |
Computes a hash value for the MultiReactionChainPolicy.
| seed | the seed value for the hash computation. |
Implements gridfire::policy::ReactionChainPolicy.
|
overridevirtual |
Returns the name of the MultiReactionChainPolicy.
Implements gridfire::policy::ReactionChainPolicy.
Reimplemented in gridfire::policy::ProtonProtonChainPolicy.
|
overridevirtual |
Inequality comparison operator.
| other | the other ReactionChainPolicy to compare against. |
Implements gridfire::policy::ReactionChainPolicy.
|
overridevirtual |
Equality comparison operator.
| other | the other ReactionChainPolicy to compare against. |
Implements gridfire::policy::ReactionChainPolicy.
| size_t gridfire::policy::MultiReactionChainPolicy::size | ( | ) | const |
Returns the number of child ReactionChainPolicy instances.
|
protected |
Child chain policies.
|
protected |
Combined reactions from all child policies.