Reactions  0.1.1
Handling reaction trees and decays
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
reactions::reaction< Element > Class Template Reference

Description of a process where reactants generate a set of products. More...

#include <processes.hpp>

Collaboration diagram for reactions::reaction< Element >:
Collaboration graph
[legend]

Public Types

using element_type = element_wrapper< Element >
 
using builder_type = element_traits::builder_tpl_t< Element >
 Underlying element type. More...
 
using nodes_type = std::vector< node< Element, reaction > >
 

Public Member Functions

 reaction (reaction &&)=default
 Collection of elements. More...
 
 reaction (const reaction &)=default
 Default copy constructor. More...
 
reactionoperator= (const reaction &)=default
 Default assignment operator. More...
 
 ~reaction ()=default
 Default destructor. More...
 
 reaction ()=delete
 
nodes_type const & reactants () const
 Get the reactants of the reaction. More...
 
nodes_type const & products () const
 Get the products of the reaction. More...
 
bool operator== (reaction< Element > const &other) const
 Compare two reactions. More...
 
bool operator!= (reaction< Element > const &other) const
 Compare two reactions. More...
 

Protected Member Functions

 reaction (std::string::const_iterator &&begin, std::string::const_iterator const &end, builder_type builder)
 Constructor from the string iterators. More...
 
 reaction (std::string::const_iterator &sit, std::string::const_iterator const &end, builder_type builder)
 Constructor from the string iterators. More...
 

Protected Attributes

nodes_type m_reactants
 Reactants. More...
 
nodes_type m_products
 Products. More...
 

Friends

template<class Process >
Process reactions::processes::make_process (std::string const &, typename Process::builder_type)
 

Detailed Description

template<class Element>
class reactions::reaction< Element >

Description of a process where reactants generate a set of products.

Nested reactions must be expressed within parenteses.

Member Typedef Documentation

◆ builder_type

template<class Element>
using reactions::reaction< Element >::builder_type = element_traits::builder_tpl_t<Element>

Underlying element type.

◆ element_type

template<class Element>
using reactions::reaction< Element >::element_type = element_wrapper<Element>

◆ nodes_type

template<class Element>
using reactions::reaction< Element >::nodes_type = std::vector<node<Element, reaction> >

Signature type of an element builder

Constructor & Destructor Documentation

◆ reaction() [1/5]

template<class Element>
reactions::reaction< Element >::reaction ( reaction< Element > &&  )
default

Collection of elements.

Default move constructor

◆ reaction() [2/5]

template<class Element>
reactions::reaction< Element >::reaction ( const reaction< Element > &  )
default

Default copy constructor.

◆ ~reaction()

template<class Element>
reactions::reaction< Element >::~reaction ( )
default

Default destructor.

◆ reaction() [3/5]

template<class Element>
reactions::reaction< Element >::reaction ( )
delete

◆ reaction() [4/5]

template<class Element>
reactions::reaction< Element >::reaction ( std::string::const_iterator &&  begin,
std::string::const_iterator const &  end,
builder_type  builder 
)
inlineprotected

Constructor from the string iterators.

Parameters
beginiterator pointing to the beginning of the string.
enditerator pointing to the end of the string.
builderfunction to create the underlying element from a string.

◆ reaction() [5/5]

template<class Element>
reactions::reaction< Element >::reaction ( std::string::const_iterator &  sit,
std::string::const_iterator const &  end,
builder_type  builder 
)
inlineprotected

Constructor from the string iterators.

This constructor is called internally when creating reactions that contain other reactions.

Parameters
sititerator pointing to the current read position in the string.
enditerator pointing to the end of the string.
builderfunction to create the underlying element from a string.

Member Function Documentation

◆ operator!=()

template<class Element>
bool reactions::reaction< Element >::operator!= ( reaction< Element > const &  other) const
inline

Compare two reactions.

Parameters
otherthe reaction to compare with (of the same underlying type).
Returns
whether the two reactions have the same reactants and products or not.

◆ operator=()

template<class Element>
reaction& reactions::reaction< Element >::operator= ( const reaction< Element > &  )
default

Default assignment operator.

◆ operator==()

template<class Element>
bool reactions::reaction< Element >::operator== ( reaction< Element > const &  other) const
inline

Compare two reactions.

Parameters
otherthe reaction to compare with (of the same underlying type).
Returns
whether the two reactions have the same reactants and products or not.

◆ products()

template<class Element>
nodes_type const& reactions::reaction< Element >::products ( ) const
inline

Get the products of the reaction.

◆ reactants()

template<class Element>
nodes_type const& reactions::reaction< Element >::reactants ( ) const
inline

Get the reactants of the reaction.

Friends And Related Function Documentation

◆ reactions::processes::make_process

template<class Element>
template<class Process >
Process reactions::processes::make_process ( std::string const &  ,
typename Process::builder_type   
)
friend

Member Data Documentation

◆ m_products

template<class Element>
nodes_type reactions::reaction< Element >::m_products
protected

Products.

◆ m_reactants

template<class Element>
nodes_type reactions::reaction< Element >::m_reactants
protected

Reactants.


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