Loading...
Searching...
No Matches
gridfire::policy::ReactionChainPolicy Class Referenceabstract

Abstract interface encapsulating a set of reactions representing a single chain or pathway. More...

`#include <policy_abstract.h>`

Inheritance diagram for gridfire::policy::ReactionChainPolicy:
[legend]

## Public Member Functions

virtual | ~ReactionChainPolicy ()=default
virtual const reaction::ReactionSet & | get_reactions () const =0
| Returns the ReactionSet describing this chain.
virtual bool | contains (const std::string &id) const =0
virtual bool | contains (const reaction::Reaction &reaction) const =0
virtual std::unique_ptr< ReactionChainPolicy > | clone () const =0
virtual std::string | name () const =0
virtual uint64_t | hash (uint64_t seed) const =0
virtual bool | operator== (const ReactionChainPolicy &other) const =0
virtual bool | operator!= (const ReactionChainPolicy &other) const =0

## Friends

std::ostream & | operator<< (std::ostream &os, const ReactionChainPolicy &rcp)

## Detailed Description

Abstract interface encapsulating a set of reactions representing a single chain or pathway.

ReactionChainPolicy implementations (see `chains.h`) supply a ReactionSet describing the reactions that comprise a nuclear reaction chain (for example the proton-proton chain, CNO cycle, etc.).

Example
  ProtonProtonChainPolicy pp;
  const gridfire::reaction::ReactionSet& reactions = pp.get_reactions();
  gridfire::policy::MultiReactionChainPolicy::get_reactions
  const reaction::ReactionSet & get_reactions() const override
  Returns the combined ReactionSet of all child chain policies.
  Definition policy_logical.cpp:20
  gridfire::policy::ProtonProtonChainPolicy
  Proton-Proton Chain Policy.
  Definition chains.h:197
  gridfire::reaction::ReactionSet
  Definition reaction.h:842

Note
  Concrete implementations may throw exceptions on construction if the underlying reaction database (e.g. REACLIB) does not include requested reactions. See `chains.h` for details.

## Constructor & Destructor Documentation

## ~ReactionChainPolicy()

virtual gridfire::policy::ReactionChainPolicy::~ReactionChainPolicy | ( |  | ) |

virtualdefault

## Member Function Documentation

## clone()

virtual std::unique_ptr< ReactionChainPolicy > gridfire::policy::ReactionChainPolicy::clone | ( |  | ) | const

nodiscardpure virtual

Implemented in gridfire::policy::CNOIChainPolicy, gridfire::policy::CNOIIChainPolicy, gridfire::policy::CNOIIIChainPolicy, gridfire::policy::CNOIVChainPolicy, gridfire::policy::HotCNOIChainPolicy, gridfire::policy::HotCNOIIChainPolicy, gridfire::policy::HotCNOIIIChainPolicy, gridfire::policy::MultiReactionChainPolicy, gridfire::policy::ProtonProtonIChainPolicy, gridfire::policy::ProtonProtonIIChainPolicy, gridfire::policy::ProtonProtonIIIChainPolicy, gridfire::policy::TripleAlphaChainPolicy, and PyReactionChainPolicy.

## contains() [1/2]

virtual bool gridfire::policy::ReactionChainPolicy::contains | ( | const reaction::Reaction & | reaction | ) | const

nodiscardpure virtual

Implemented in gridfire::policy::MultiReactionChainPolicy, gridfire::policy::TemperatureDependentChainPolicy, and PyReactionChainPolicy.

## contains() [2/2]

virtual bool gridfire::policy::ReactionChainPolicy::contains | ( | const std::string & | id | ) | const

nodiscardpure virtual

Implemented in gridfire::policy::MultiReactionChainPolicy, gridfire::policy::TemperatureDependentChainPolicy, and PyReactionChainPolicy.

## get_reactions()

virtual const reaction::ReactionSet & gridfire::policy::ReactionChainPolicy::get_reactions | ( |  | ) | const

nodiscardpure virtual

Returns the ReactionSet describing this chain.

Returns
  const reaction::ReactionSet& reference to the chain's reactions.

Example
  const reaction::ReactionSet &set = chainPolicy.get_reactions();
  std::cout << "Chain contains " << set.size() << " reactions\n";
  gridfire::reaction::ReactionSet::size
  size_t size() const
  Gets the number of reactions in the set.
  Definition reaction.h:903

Exceptions

  gridfire::exceptions::MissingBaseReactionError | may be thrown by concrete implementations at construction time if the required reactions cannot be found in the base reaction set.

Implemented in gridfire::policy::MultiReactionChainPolicy, gridfire::policy::TemperatureDependentChainPolicy, and PyReactionChainPolicy.

## hash()

virtual uint64_t gridfire::policy::ReactionChainPolicy::hash | ( | uint64_t | seed | ) | const

nodiscardpure virtual

Implemented in gridfire::policy::MultiReactionChainPolicy, gridfire::policy::TemperatureDependentChainPolicy, and PyReactionChainPolicy.

## name()

virtual std::string gridfire::policy::ReactionChainPolicy::name | ( |  | ) | const

nodiscardpure virtual

Implemented in gridfire::policy::CNOChainPolicy, gridfire::policy::CNOIChainPolicy, gridfire::policy::CNOIIChainPolicy, gridfire::policy::CNOIIIChainPolicy, gridfire::policy::CNOIVChainPolicy, gridfire::policy::HotCNOChainPolicy, gridfire::policy::HotCNOIChainPolicy, gridfire::policy::HotCNOIIChainPolicy, gridfire::policy::HotCNOIIIChainPolicy, gridfire::policy::MainSequenceReactionChainPolicy, gridfire::policy::MultiReactionChainPolicy, gridfire::policy::ProtonProtonChainPolicy, gridfire::policy::ProtonProtonIChainPolicy, gridfire::policy::ProtonProtonIIChainPolicy, gridfire::policy::ProtonProtonIIIChainPolicy, gridfire::policy::TripleAlphaChainPolicy, and PyReactionChainPolicy.

## operator!=()

virtual bool gridfire::policy::ReactionChainPolicy::operator!= | ( | const ReactionChainPolicy & | other | ) | const

nodiscardpure virtual

Implemented in gridfire::policy::MultiReactionChainPolicy, and gridfire::policy::TemperatureDependentChainPolicy.

## operator==()

virtual bool gridfire::policy::ReactionChainPolicy::operator== | ( | const ReactionChainPolicy & | other | ) | const

nodiscardpure virtual

Implemented in gridfire::policy::MultiReactionChainPolicy, and gridfire::policy::TemperatureDependentChainPolicy.

## Friends And Related Symbol Documentation

## operator<<

std::ostream & operator<< | ( | std::ostream & | os,
|  | const ReactionChainPolicy & | rcp )

friend

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

- src/include/gridfire/policy/policy_abstract.h