libbio
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Attributes | List of all members
bio::chemical::Reaction Class Reference

#include <Reaction.h>

Inheritance diagram for bio::chemical::Reaction:
Inheritance graph
[legend]
Collaboration diagram for bio::chemical::Reaction:
Collaboration graph
[legend]

Public Member Functions

 BIO_DEFAULT_IDENTIFIABLE_CONSTRUCTORS (chemical, Reaction, filter::Chemical(), symmetry_type::Operation()) explicit Reaction(const Name &name
 
virtual void Require (Pointer< Reactant > reactant)
 
void Require (const Name &typeName, Pointer< const Substance > substance)
 
void Require (const Name &typeName, const UnorderedMotif< Property > &properties, const UnorderedMotif< State > &states)
 
template<typename T >
void Require ()
 
template<typename T >
void Require (Pointer< const T > substance)
 
template<typename T >
void Require (Pointer< const typename UnorderedMotif< Property >::Contents > properties, Pointer< const typename UnorderedMotif< State >::Contents > states)
 
virtual Products Process (Pointer< Reactants > reactants) const
 
virtual bool ReactantsMeetRequirements (Pointer< const Reactants > toCheck) const
 
virtual Products operator() (Pointer< Reactants > reactants) const
 
- Public Member Functions inherited from bio::chemical::Class< Reaction >
virtual Pointer< ::bio::physical::WaveClone () const
 
Pointer< ::bio::physical::WaveAsWave ()
 
Pointer< const ::bio::physical::WaveAsWave () const
 
 operator Pointer< ::bio::physical::Wave > ()
 
virtual Pointer< ::bio::physical::WaveModulate (Pointer< ::bio::physical::Wave > signal)
 
virtual Pointer< ::bio::physical::WaveDemodulate ()
 
virtual Pointer< const ::bio::physical::WaveDemodulate () const
 
virtual Pointer< ::bio::physical::WaveSuperpose (const ::bio::physical::ConstWaves &displacement, Pointer< ::bio::physical::Interference > pattern)
 
virtual bool Superpose (Pointer< const ::bio::physical::Wave > displacement, Pointer< ::bio::physical::Interference > pattern)
 
 Class (Pointer< Reaction > object, Filter filter=filter::Default(), SymmetryType symmetryType=symmetry_type::Object())
 
 Class (Pointer< Reaction > object, const Name &name, Filter filter=filter::Default(), SymmetryType symmetryType=symmetry_type::Object())
 
 Class (Pointer< Reaction > object, const Id &id, Filter filter=filter::Default(), SymmetryType symmetryType=symmetry_type::Object())
 
 Class (const Class &other)
 
virtual ~Class ()
 
virtual bool RegisterProperties (const Properties &properties)
 
virtual Properties GetProperties () const
 
virtual Pointer< AtomAsAtom ()
 
virtual Pointer< const AtomAsAtom () const
 
virtual Code Attenuate (Pointer< const physical::Wave > other)
 
virtual Code Disattenuate (Pointer< const physical::Wave > other)
 
- Public Member Functions inherited from bio::physical::Class< T >
 Class (Pointer< T > object, Pointer< Symmetry > symmetry=NULL)
 
 Class (Pointer< T > object, SymmetryFactory symmetryFactory)
 
 Class (const Class &other)
 
virtual Pointer< TGetWaveObject ()
 
virtual Pointer< const TGetWaveObject () const
 
virtual operator T& ()
 
virtual operator const T & () const
 
Pointer< WaveAsWave ()
 
Pointer< const WaveAsWave () const
 
virtual operator Pointer< Wave > ()
 
- Public Member Functions inherited from bio::physical::Wave
 Wave (Pointer< Symmetry > symmetry=NULL)
 
 Wave (const Wave &other)
 
Waveoperator= (const Wave &other)
 
virtual ~Wave ()
 
Pointer< const SymmetryGetSymmetry () const
 
virtual bool Superpose (Pointer< const Wave > displacement, Pointer< Interference > pattern)
 
virtual Pointer< WaveSuperpose (const ConstWaves &displacement, Pointer< Interference > pattern)
 
virtual Pointer< WaveModulate (Pointer< Wave > signal)
 
Pointer< WaveAsWave ()
 
Pointer< const WaveAsWave () const
 
virtual void operator| (Pointer< Symmetry > symmetry)
 
virtual Pointer< Waveoperator* (Pointer< Wave > signal)
 
virtual Pointer< Waveoperator* ()
 
virtual Pointer< const Waveoperator* () const
 
virtual void operator+ (Pointer< const Wave > other)
 
virtual void operator- (Pointer< const Wave > other)
 
uint16_t GetTypeId () const
 
void SetTypeId (uint16_t typeId)
 
- Public Member Functions inherited from bio::physical::Identifiable< Id >
 Identifiable (Pointer< Perspective< Id > > perspective=NULL)
 
 Identifiable (const Name &name, Pointer< Perspective< Id > > perspective=NULL)
 
 Identifiable (Identifier id, Pointer< Perspective< Id > > perspective=NULL)
 
 Identifiable (const Identifiable &other)
 
virtual ~Identifiable ()
 
virtual operator Id () const
 
virtual bool operator== (const Identifier id) const
 
virtual bool operator== (const Name &name) const
 
virtual bool operator== (const Identifiable< Id > &other) const
 
virtual Name GetName () const
 
virtual Identifier GetId () const
 
virtual bool SetName (const Name &name)
 
virtual bool SetId (Identifier id)
 
virtual bool IsName (const Name &name) const
 
virtual bool IsNameInsensitive (const Name &name) const
 
virtual bool IsId (Identifier id) const
 
virtual void SetPerspective (Pointer< Perspective< Id > > perspective)
 
- Public Member Functions inherited from bio::physical::Observer< PERSPECTIVE >
 Observer (Pointer< Perspective > perspective=NULL)
 
 Observer (const Observer &other)
 
virtual ~Observer ()
 
virtual void SetPerspective (Pointer< Perspective > perspective)
 
virtual Pointer< PerspectiveGetPerspective () const
 
- Public Member Functions inherited from bio::log::Writer
 Writer ()
 
 Writer (Filter logFilter)
 
virtual ~Writer ()
 
virtual Pointer< const WriterAsLogWriter () const
 
bool IsEnabled (LogLevel level) const
 
virtual void Log (LogLevel level, const char *format, va_list args) const
 
- Public Member Functions inherited from bio::physical::Class< Writer >
 Class (Pointer< Writer > object, Pointer< Symmetry > symmetry=NULL)
 
 Class (Pointer< Writer > object, SymmetryFactory symmetryFactory)
 
 Class (const Class &other)
 
virtual Pointer< Writer > GetWaveObject ()
 
virtual Pointer< const Writer > GetWaveObject () const
 
virtual operator Writer & ()
 
virtual operator const Writer & () const
 
Pointer< WaveAsWave ()
 
Pointer< const WaveAsWave () const
 
virtual operator Pointer< Wave > ()
 
- Public Member Functions inherited from bio::physical::Filterable
 Filterable ()
 
 Filterable (Filter filter)
 
virtual ~Filterable ()
 
virtual void InitializeImplementation (ByteStreams &args)
 
virtual void SetFilter (Filter filter)
 
Filter GetFilter () const
 
virtual Pointer< const SymmetrySpin () const
 
virtual Code Reify (Pointer< const Symmetry > symmetry)
 
- Public Member Functions inherited from bio::physical::Class< Filterable >
 Class (Pointer< Filterable > object, Pointer< Symmetry > symmetry=NULL)
 
 Class (Pointer< Filterable > object, SymmetryFactory symmetryFactory)
 
 Class (const Class &other)
 
virtual Pointer< FilterableGetWaveObject ()
 
virtual Pointer< const FilterableGetWaveObject () const
 
virtual operator Filterable & ()
 
virtual operator const Filterable & () const
 
Pointer< WaveAsWave ()
 
Pointer< const WaveAsWave () const
 
virtual operator Pointer< Wave > ()
 
- Public Member Functions inherited from bio::chemical::Atom
 Atom ()
 
 Atom (const Atom &other)
 
virtual ~Atom ()
 
void CloneBondsFrom (const Atom &other, BondClonePolicy policy=&Atom::DefaultBondClonePolicy)
 
virtual Pointer< const physical::SymmetrySpin () const
 
virtual Code Reify (Pointer< const physical::Symmetry > symmetry)
 
Pointer< physical::WaveGetBonded (Valence position)
 
Pointer< const physical::WaveGetBonded (Valence position) const
 
Pointer< const physical::WaveResolveBondedForReadById (AtomicNumber bondId) const
 
Pointer< physical::WaveResolveBondedForWriteById (AtomicNumber bondId)
 
template<typename T >
Cow< TAsBonded () const
 
template<typename T >
Pointer< TAsBondedQuantum () const
 
template<typename T >
atom_detail::AsResultType< T, type::IsWaveImplementation< typenametype::RemovePointer< T >::Type >::sValue >::Type As () const
 
template<typename T >
 operator T () const
 
template<typename T >
Valence FormBond (T toBond, BondType type=bond_type::Unknown())
 
template<typename T >
bool BreakBond (T toDisassociate, BondType type=bond_type::Unknown())
 
Valence GetBondPosition (AtomicNumber bondedId) const
 
Valence GetBondPosition (const Name &typeName) const
 
Valence GetBondPositionLocked (AtomicNumber bondedId) const
 
template<typename T >
Valence GetBondPosition () const
 
BondType GetBondType (Valence position) const
 
template<typename T >
BondType GetBondType () const
 
Pointer< BondsGetAllBonds ()
 
Pointer< const BondsGetAllBonds () const
 
void ForEachBond (BondVisitor visitor, void *context=NULL) const
 
void ForEachBondMutable (BondMutator mutator, void *context=NULL)
 
virtual Valence FormBondImplementation (Pointer< physical::Wave > toBond, AtomicNumber id, BondType type)
 
Valence FormBondImplementation (Pointer< physical::Wave > toBond, AtomicNumber id, BondType type, bool ownsBonded)
 
Valence FormBondImplementationLocked (Pointer< physical::Wave > toBond, AtomicNumber id, BondType type, bool ownsBonded)
 
virtual bool BreakBondImplementation (AtomicNumber id, BondType type)
 
bool BreakBondImplementationLocked (AtomicNumber id, BondType type)
 
- Public Member Functions inherited from bio::physical::Class< Atom >
 Class (Pointer< Atom > object, Pointer< Symmetry > symmetry=NULL)
 
 Class (Pointer< Atom > object, SymmetryFactory symmetryFactory)
 
 Class (const Class &other)
 
virtual Pointer< Atom > GetWaveObject ()
 
virtual Pointer< const Atom > GetWaveObject () const
 
virtual operator Atom & ()
 
virtual operator const Atom & () const
 
Pointer< WaveAsWave ()
 
Pointer< const WaveAsWave () const
 
virtual operator Pointer< Wave > ()
 
- Public Member Functions inherited from bio::ThreadSafe
 ThreadSafe ()
 
 ThreadSafe (const ThreadSafe &toCopy)
 
ThreadSafeoperator= (const ThreadSafe &toCopy)
 
 ~ThreadSafe ()
 
void LockThread () const
 
void UnlockThread () const
 
void LockMutexShared () const
 
void UnlockMutexShared () const
 
- Public Member Functions inherited from bio::chemical::Structure
 Structure ()
 
virtual ~Structure ()
 
- Public Member Functions inherited from bio::chemical::UnorderedStructureInterface
 UnorderedStructureInterface ()
 
virtual ~UnorderedStructureInterface ()
 
template<typename T >
T Add (const T t)
 
template<typename T >
Pointer< TAdd (Pointer< T > t)
 
template<typename T >
Code Remove (const T t)
 
template<typename T >
Code Remove (Pointer< T > t)
 
template<typename T >
void Import (Pointer< const UnorderedMotif< T > > other)
 
template<typename T >
void Import (Pointer< const LinearMotif< T > > other)
 
template<typename T >
void Import (const ::bio::Arrangement< T > &other)
 
Code ImportAll (Pointer< const physical::Wave > other)
 
template<typename T >
Index GetCount () const
 
template<typename T >
Pointer< ContainerGetAll ()
 
template<typename T >
Pointer< const ContainerGetAll () const
 
template<typename T >
bool Has (T content) const
 
template<typename T >
bool Has (Pointer< T > content) const
 
template<typename T >
unsigned int GetNumMatching (Pointer< const Container > other) const
 
template<typename T >
bool HasAll (Pointer< const Container > contents) const
 
template<typename T >
void Clear ()
 
template<typename T >
std::string GetStringFrom (std::string separator=", ")
 
template<typename T >
void Log (const LogLevel &level=log_level::Info(), const Filter &filter=FilterPerspective::InvalidId())
 
- Public Member Functions inherited from bio::chemical::LinearStructureInterface
 LinearStructureInterface ()
 
virtual ~LinearStructureInterface ()
 
template<typename T >
Code Insert (typename LinearStructureRequest< T >::PointerType toAdd, const Position position=BOTTOM, const Id optionalPositionArg=0, const bool transferSubContents=false)
 
template<typename T >
LinearStructureRequest< T >::PointerType GetById (const Id &id)
 
template<typename T >
const LinearStructureRequest< T >::PointerType GetById (const Id &id) const
 
template<typename T >
LinearStructureRequest< T >::PointerType GetByName (const Name &name)
 
template<typename T >
const LinearStructureRequest< T >::PointerType GetByName (const Name &name) const
 
template<typename T >
LinearStructureRequest< T >::PointerType GetOrCreateById (Id id)
 
template<typename T >
LinearStructureRequest< T >::PointerType GetOrCreateByName (const Name &name)
 
template<typename T >
Code RemoveById (const Id &id)
 
template<typename T >
Code RemoveByName (const Name &name)
 
template<typename T >
LinearMotif< typenameLinearStructureRequest< T >::Pointee >::Contents GetAllLike (Pointer< const Affinity > affinity) const
 
template<typename T >
Emission ForEach (Pointer< ExcitationBase > excitation)
 

Static Public Member Functions

static Pointer< const ReactionInitiate (const AtomicNumber &id)
 
template<typename T >
static Pointer< const TInitiate ()
 
template<typename T >
static Products Attempt (Pointer< Reactants > reactants)
 
template<typename T >
static Products Attempt (Substances &substances)
 
template<typename T >
static Products Attempt (Pointer< Substance > reactant1, Pointer< Substance > reactant2=Pointer< Substance >(), Pointer< Substance > reactant3=Pointer< Substance >())
 
- Static Public Member Functions inherited from bio::physical::Class< T >
static Pointer< TConvert (Pointer< Wave > wave)
 
- Static Public Member Functions inherited from bio::physical::Wave
static Properties GetResonanceBetween (ConstWaves waves)
 
static Properties GetResonanceBetween (Pointer< const Wave > wave1, Pointer< const Wave > wave2)
 
static Properties GetResonanceBetween (Pointer< const Wave > wave, const Properties &properties)
 
- Static Public Member Functions inherited from bio::log::Writer
static void Log (Pointer< const Writer > writer, LogLevel level, const char *format,...)
 
static bool ShouldLog (Pointer< const Writer > writer, LogLevel level)
 
- Static Public Member Functions inherited from bio::physical::Class< Writer >
static Pointer< Writer > Convert (Pointer< Wave > wave)
 
- Static Public Member Functions inherited from bio::physical::Class< Filterable >
static Pointer< FilterableConvert (Pointer< Wave > wave)
 
- Static Public Member Functions inherited from bio::chemical::Atom
static BondCloneAction DefaultBondClonePolicy (const Bond &bond)
 
template<typename T >
static AtomicNumber GetBondId ()
 
- Static Public Member Functions inherited from bio::physical::Class< Atom >
static Pointer< Atom > Convert (Pointer< Wave > wave)
 
- Static Public Member Functions inherited from bio::chemical::UnorderedStructureInterface
static void ImportAllCollectVisitor (const chemical::Bond &bond, void *ctx)
 

Public Attributes

Pointer< const Reactantsreactants
 

Protected Attributes

Reactants mRequiredReactants
 
- Protected Attributes inherited from bio::physical::Class< T >
Pointer< TmObject
 
- Protected Attributes inherited from bio::physical::Wave
LazyPointer< SymmetrymSymmetry
 
bool mHasSignal
 
uint16_t mTypeId
 
- Protected Attributes inherited from bio::VirtualBase
bool mHasBeenInitialized
 
- Protected Attributes inherited from bio::physical::Class< Writer >
Pointer< Writer > mObject
 
- Protected Attributes inherited from bio::physical::Filterable
Filter mFilter
 
- Protected Attributes inherited from bio::physical::Class< Filterable >
Pointer< FilterablemObject
 
- Protected Attributes inherited from bio::chemical::Atom
Bonds mBonds
 
::std::map< AtomicNumber, ValencemBondIndex
 
Arrangement< Pointer< const physical::Wave > > mBackflowPreventer
 
- Protected Attributes inherited from bio::physical::Class< Atom >
Pointer< Atom > mObject
 

Additional Inherited Members

- Public Types inherited from bio::physical::Identifiable< Id >
typedef Id Identifier
 
typedef Arrangement< IdentifierIds
 
- Public Types inherited from bio::physical::Observer< PERSPECTIVE >
typedef PERSPECTIVE Perspective
 
- Public Types inherited from bio::chemical::Atom
typedef BondCloneAction(* BondClonePolicy) (const Bond &bond)
 
typedef void(* BondVisitor) (const Bond &bond, void *context)
 
typedef BondCloneAction(* BondMutator) (Bond &bond, void *context)
 
- Protected Types inherited from bio::physical::Identifiable< Id >
typedef Id Identifier
 
typedef Arrangement< IdentifierIds
 
- Protected Types inherited from bio::physical::Observer< PERSPECTIVE >
typedef PERSPECTIVE Perspective
 
- Protected Types inherited from bio::chemical::Atom
typedef BondCloneAction(* BondClonePolicy) (const Bond &bond)
 
typedef void(* BondVisitor) (const Bond &bond, void *context)
 
typedef BondCloneAction(* BondMutator) (Bond &bond, void *context)
 
- Protected Member Functions inherited from bio::chemical::Elementary< T >
void RegisterType ()
 
 Elementary (const Properties properties)
 
 Elementary ()
 
virtual ~Elementary ()
 
- Protected Member Functions inherited from bio::physical::Identifiable< Id >
virtual void InitializeImplementation (ByteStreams &args)
 
friend::std::ostream & operator<< (std::ostream &out, const Identifiable< Id > &t)
 
 Identifiable (Pointer< Perspective< Id > > perspective=NULL)
 
 Identifiable (const Name &name, Pointer< Perspective< Id > > perspective=NULL)
 
 Identifiable (Identifier id, Pointer< Perspective< Id > > perspective=NULL)
 
 Identifiable (const Identifiable &other)
 
virtual ~Identifiable ()
 
virtual operator Id () const
 
virtual bool operator== (const Identifier id) const
 
virtual bool operator== (const Name &name) const
 
virtual bool operator== (const Identifiable< Id > &other) const
 
virtual Name GetName () const
 
virtual Identifier GetId () const
 
virtual bool SetName (const Name &name)
 
virtual bool SetId (Identifier id)
 
virtual bool IsName (const Name &name) const
 
virtual bool IsNameInsensitive (const Name &name) const
 
virtual bool IsId (Identifier id) const
 
virtual void SetPerspective (Pointer< Perspective< Id > > perspective)
 
- Protected Member Functions inherited from bio::physical::Observer< PERSPECTIVE >
 Observer (Pointer< Perspective > perspective=NULL)
 
 Observer (const Observer &other)
 
virtual ~Observer ()
 
virtual void SetPerspective (Pointer< Perspective > perspective)
 
virtual Pointer< PerspectiveGetPerspective () const
 
- Protected Member Functions inherited from bio::VirtualBase
 VirtualBase ()
 
virtual ~VirtualBase ()
 
void Initialize (ByteStreams &args)
 
void Initialize (ByteStream arg1)
 
void Initialize (ByteStream arg1, ByteStream arg2)
 
void Initialize (ByteStream arg1, ByteStream arg2, ByteStream arg3)
 
- Protected Member Functions inherited from bio::log::Writer
 Writer ()
 
 Writer (Filter logFilter)
 
virtual ~Writer ()
 
virtual Pointer< const WriterAsLogWriter () const
 
bool IsEnabled (LogLevel level) const
 
virtual void Log (LogLevel level, const char *format, va_list args) const
 
- Protected Member Functions inherited from bio::physical::Class< Writer >
 Class (Pointer< Writer > object, Pointer< Symmetry > symmetry=NULL)
 
 Class (Pointer< Writer > object, SymmetryFactory symmetryFactory)
 
 Class (const Class &other)
 
virtual Pointer< Writer > GetWaveObject ()
 
virtual Pointer< const Writer > GetWaveObject () const
 
virtual operator Writer & ()
 
virtual operator const Writer & () const
 
Pointer< WaveAsWave ()
 
Pointer< const WaveAsWave () const
 
virtual operator Pointer< Wave > ()
 
- Protected Member Functions inherited from bio::physical::Filterable
 Filterable ()
 
 Filterable (Filter filter)
 
virtual ~Filterable ()
 
virtual void InitializeImplementation (ByteStreams &args)
 
virtual void SetFilter (Filter filter)
 
Filter GetFilter () const
 
virtual Pointer< const SymmetrySpin () const
 
virtual Code Reify (Pointer< const Symmetry > symmetry)
 
- Protected Member Functions inherited from bio::physical::Class< Filterable >
 Class (Pointer< Filterable > object, Pointer< Symmetry > symmetry=NULL)
 
 Class (Pointer< Filterable > object, SymmetryFactory symmetryFactory)
 
 Class (const Class &other)
 
virtual Pointer< FilterableGetWaveObject ()
 
virtual Pointer< const FilterableGetWaveObject () const
 
virtual operator Filterable & ()
 
virtual operator const Filterable & () const
 
Pointer< WaveAsWave ()
 
Pointer< const WaveAsWave () const
 
virtual operator Pointer< Wave > ()
 
- Protected Member Functions inherited from bio::chemical::Atom
void IndexBond (AtomicNumber bondedId, Valence position)
 
void UnindexBond (AtomicNumber bondedId)
 
 Atom ()
 
 Atom (const Atom &other)
 
virtual ~Atom ()
 
void CloneBondsFrom (const Atom &other, BondClonePolicy policy=&Atom::DefaultBondClonePolicy)
 
virtual Pointer< const physical::SymmetrySpin () const
 
virtual Code Reify (Pointer< const physical::Symmetry > symmetry)
 
Pointer< physical::WaveGetBonded (Valence position)
 
Pointer< const physical::WaveGetBonded (Valence position) const
 
Pointer< const physical::WaveResolveBondedForReadById (AtomicNumber bondId) const
 
Pointer< physical::WaveResolveBondedForWriteById (AtomicNumber bondId)
 
template<typename T >
Cow< TAsBonded () const
 
template<typename T >
Pointer< TAsBondedQuantum () const
 
template<typename T >
atom_detail::AsResultType< T, type::IsWaveImplementation< typenametype::RemovePointer< T >::Type >::sValue >::Type As () const
 
template<typename T >
 operator T () const
 
template<typename T >
Valence FormBond (T toBond, BondType type=bond_type::Unknown())
 
template<typename T >
bool BreakBond (T toDisassociate, BondType type=bond_type::Unknown())
 
Valence GetBondPosition (AtomicNumber bondedId) const
 
Valence GetBondPosition (const Name &typeName) const
 
Valence GetBondPositionLocked (AtomicNumber bondedId) const
 
template<typename T >
Valence GetBondPosition () const
 
BondType GetBondType (Valence position) const
 
template<typename T >
BondType GetBondType () const
 
Pointer< BondsGetAllBonds ()
 
Pointer< const BondsGetAllBonds () const
 
void ForEachBond (BondVisitor visitor, void *context=NULL) const
 
void ForEachBondMutable (BondMutator mutator, void *context=NULL)
 
virtual Valence FormBondImplementation (Pointer< physical::Wave > toBond, AtomicNumber id, BondType type)
 
Valence FormBondImplementation (Pointer< physical::Wave > toBond, AtomicNumber id, BondType type, bool ownsBonded)
 
Valence FormBondImplementationLocked (Pointer< physical::Wave > toBond, AtomicNumber id, BondType type, bool ownsBonded)
 
virtual bool BreakBondImplementation (AtomicNumber id, BondType type)
 
bool BreakBondImplementationLocked (AtomicNumber id, BondType type)
 
- Protected Member Functions inherited from bio::physical::Class< Atom >
 Class (Pointer< Atom > object, Pointer< Symmetry > symmetry=NULL)
 
 Class (Pointer< Atom > object, SymmetryFactory symmetryFactory)
 
 Class (const Class &other)
 
virtual Pointer< Atom > GetWaveObject ()
 
virtual Pointer< const Atom > GetWaveObject () const
 
virtual operator Atom & ()
 
virtual operator const Atom & () const
 
Pointer< WaveAsWave ()
 
Pointer< const WaveAsWave () const
 
virtual operator Pointer< Wave > ()
 
- Protected Member Functions inherited from bio::ThreadSafe
 ThreadSafe ()
 
 ThreadSafe (const ThreadSafe &toCopy)
 
ThreadSafeoperator= (const ThreadSafe &toCopy)
 
 ~ThreadSafe ()
 
void LockThread () const
 
void UnlockThread () const
 
void LockMutexShared () const
 
void UnlockMutexShared () const
 
- Protected Member Functions inherited from bio::chemical::LinearStructureInterface
template<typename T >
Pointer< LinearMotif< T > > ResolveLinearMotif ()
 
template<typename T >
Pointer< const LinearMotif< T > > ResolveLinearMotif () const
 
- Static Protected Member Functions inherited from bio::log::Writer
static void Log (Pointer< const Writer > writer, LogLevel level, const char *format,...)
 
static bool ShouldLog (Pointer< const Writer > writer, LogLevel level)
 
- Static Protected Member Functions inherited from bio::physical::Class< Writer >
static Pointer< Writer > Convert (Pointer< Wave > wave)
 
- Static Protected Member Functions inherited from bio::physical::Class< Filterable >
static Pointer< FilterableConvert (Pointer< Wave > wave)
 
- Static Protected Member Functions inherited from bio::chemical::Atom
static BondCloneAction DefaultBondClonePolicy (const Bond &bond)
 
template<typename T >
static AtomicNumber GetBondId ()
 
- Static Protected Member Functions inherited from bio::physical::Class< Atom >
static Pointer< Atom > Convert (Pointer< Wave > wave)
 

Detailed Description

A chemical::Reaction takes in Reactants and produces Products, performing some work in between.
For more info, see Reactants.h, Reactant.h (singular), Products.h, and Substance.h
This is basically a fancy functor that takes advantage of Atom::Bonds and Substance Properties and States to do argument validation.

Reactions, like those in real life, will often deal with the changing of chemical Bonds and Properties.
Both Excitation and Reaction are functors but the behavior and minimum requirements for using each are different.
Reactions are for turning iron into gold. All lesser magicks can be performed with Excitation!
In a more real sense, Excitations should not make or break Bonds (except in rare circumstances) whereas Reactions, when fully Processed, should change the Reactants in some significant way, hence their return as Products.
Another difference between Reactants and Excitations is that Excitations act ON a Wave (i.e. wave->someMethod()) while Reactions act WITH Substances.
Additionally, Excitations store their arguments as members, requiring each kind of Excitation function call to be a new object (e.g. to call firstObject->method(firstArg) and secondObject->method(firstArg) is 1 Excitation while firstObject->method(secondArg) would require a new Excitation).
Reactions, on the other hand, are more traditional functors and do not (by default) maintain any state between calls, meaning the same Reaction object can be used for all invokations.

A real life corollary:
Imagine a sound wave hitting a wall. This could be modeled as an Excitation: the energy from the air molecules excite those in the wall, passing energy between them. We might write this as soundEnergyTransferExcitation = EnergyTransferExcitation(sound); soundEnergyTransferExcitation(wall), which could produce code like wall->ExchangeEnergy(sound) and could be used on anything the sound wave hit (e.g. soundEnergyTransferExcitation(floor)).
A similar, but inappropriate Reaction could be EnergyTransferReaction(wall, sound) which might produce code like wall->ExchangeEnergy(sound); return {wall, sound}, saying that a sound wave hitting a wall creates a new wall and sound wave. The same Reaction would have to be called again for each object the sound wave impacted.
A more appropriate Reaction would be something like Burn(fuel, air), which might return {flame, ash, smoke, air}, where you could then check the flame->GetColor(), smoke->GetSmell(), reactantAir->GetQuantity("Oxygen") - productAir->GetQuantity("Oxygen"), and so on.
The inappropriate Excitation analog, airBurnExcitation = BurnExcitation(air); airBurnExcitation(fuel), would call fuel->burn(air), which could work but would require that anything capable of being burned implement the burn method.

While the semantic difference between the implementations of Excitation and Reaction is subtle and possibly pedantic, the use case of calling a class method vs calling a function with a class should be clear cut.
In reality, you'll probably want to use Excitations in your Reactions and vice-versa. For instance, hitting a wall with a nuclear blast would be far more complex than modeling a sound wave.
See Excitation.h for more info.

To make a Reaction, you must overload Process (virtual chemical::Products Process(chemical::Substances& reactants) = 0;)
Then, preferably in your constructor, state the Require()ments.
Each Require()d Reactant* will be checked against the reactants (Substances&) provided to *this. ORDER MATTERS! The reactants must follow the same order as the Required Reactants!

To invoke a Reaction, use the operator(), providing reactants.
For example: MyReaction r; r(MyReactants);
Doing so will do all necessary input checking and then call Process(), if all is good. Otherwise no Products are returned and you will get a code::FailedReaction().

Other ways to invoke a reaction include:
Reaction::Attempt<MyReaction>(myReactants);
myReaction = Reaction::Initiate<MyReaction>(); myReaction(myReactants);

Member Function Documentation

◆ Attempt() [1/3]

template<typename T >
static Products bio::chemical::Reaction::Attempt ( Pointer< Reactants reactants)
inlinestatic

Invokes a reaction of the given id using the provided reactants.

Template Parameters
Ta reaction type
Parameters
reactantsthe reactants to provide to T.
Returns
operator() of the given reaction; else reactants.

◆ Attempt() [2/3]

template<typename T >
static Products bio::chemical::Reaction::Attempt ( Pointer< Substance reactant1,
Pointer< Substance reactant2 = PointerSubstance >(),
Pointer< Substance reactant3 = PointerSubstance >() 
)
inlinestatic

Ease of use helper for invoking Reactions without creating a vector
(Mostly useful for C++98)

Template Parameters
T
Parameters
reactant1
reactant2
reactant3
Returns
Attempt<T> with the given reactants.

◆ Attempt() [3/3]

template<typename T >
static Products bio::chemical::Reaction::Attempt ( Substances substances)
inlinestatic

◆ BIO_DEFAULT_IDENTIFIABLE_CONSTRUCTORS()

bio::chemical::Reaction::BIO_DEFAULT_IDENTIFIABLE_CONSTRUCTORS ( chemical  ,
Reaction  ,
filter::Chemical()  ,
symmetry_type::Operation()   
) const &

Ensure virtual methods point to Class implementations.
Standard constructors.

Parameters
name
reactants

◆ Initiate() [1/2]

template<typename T >
static Pointer< const T > bio::chemical::Reaction::Initiate ( )
inlinestatic

Get a Reaction!
This should be used to avoid unnecessary new and deletes.
This only works for Reactions that have a name matching their type (i.e. were constructed with name=SafelyAccess<PeriodicTable>()->GetNameFromType(*this)), which is true for all Reactions in the core Biology framework.

Template Parameters
T
Returns
a Reaction* of the given type or NULL, if no Reaction exists matching the TypeName of the given T.

◆ Initiate() [2/2]

Pointer< const Reaction > bio::chemical::Reaction::Initiate ( const AtomicNumber id)
static

Get a Reaction!
This should be used to avoid unnecessary new and deletes.
Use when the TypeName does not match the Name or when you have the id of the Reaction you want.

Parameters
id
Returns
a Reaction* with the given id or NULL.

◆ operator()()

Products bio::chemical::Reaction::operator() ( Pointer< Reactants reactants) const
virtual

A Reaction takes in some Reactants and checks if they match the Reactants for *this.
If the inputs check out, the Reaction occurs and the products are returned.

Parameters
reactants
Returns
Products of this->Process(...) or empty Products with a code::FailedReaction() Code.

◆ Process()

virtual Products bio::chemical::Reaction::Process ( Pointer< Reactants reactants) const
inlinevirtual

User defined reaction process.
The actual work of *this.

Parameters
reactants
Returns
Products containing a Code and some set of new Substances or just the reactants. Up to you!

Reimplemented in bio::chemical::Mix.

◆ ReactantsMeetRequirements()

bool bio::chemical::Reaction::ReactantsMeetRequirements ( Pointer< const Reactants toCheck) const
virtual

Checks if the given Substances match the Reactants in *this.
ORDER MATTERS!
NOTE: toCheck may have MORE substances than just the reactants needed for this->Process but must have AT LEAST the required Reactants.

Parameters
toCheck
Returns
true if all Substances match; false otherwise.

Reimplemented in bio::molecular::Pathway, and bio::chemical::Mix.

◆ Require() [1/6]

template<typename T >
void bio::chemical::Reaction::Require ( )
inline

Wrapper around Require(Reactant*).
Constructs Reactant from args, adding the Enabled() State as a requirement.
NOTE: T should not have pointer type (unless you're using **).

Template Parameters
Tthe T* which will be used in the Reaction (without the *)

◆ Require() [2/6]

void bio::chemical::Reaction::Require ( const Name typeName,
const UnorderedMotif< Property > &  properties,
const UnorderedMotif< State > &  states 
)

Wrapper around Require(Reactant*).
Constructs Reactant from args

Parameters
typeName
properties
states

◆ Require() [3/6]

void bio::chemical::Reaction::Require ( const Name typeName,
Pointer< const Substance substance 
)

Wrapper around Require(Reactant*).
Constructs Reactant from args

Parameters
typeName
substance

◆ Require() [4/6]

template<typename T >
void bio::chemical::Reaction::Require ( Pointer< const T substance)
inline

Wrapper around Require(Reactant*).
Constructs Reactant from args

Template Parameters
Tof the T* which will be used in the Reaction (without the *)
Parameters
substancethe T* to use (with the *).

◆ Require() [5/6]

template<typename T >
void bio::chemical::Reaction::Require ( Pointer< const typename UnorderedMotif< Property >::Contents >  properties,
Pointer< const typename UnorderedMotif< State >::Contents >  states 
)
inline

Wrapper around Require(Reactant*).
Constructs Reactant from args

Template Parameters
Tthe T* which will be used in the Reaction (without the *)

◆ Require() [6/6]

void bio::chemical::Reaction::Require ( Pointer< Reactant reactant)
virtual

Add a required Reactant to *this.
NOTE: ORDER MATTERS!
The order of requirements MUST be the order of arguments provided to operator().

Parameters
reactant

Member Data Documentation

◆ mRequiredReactants

Reactants bio::chemical::Reaction::mRequiredReactants
protected

◆ reactants

Pointer< const Reactants > bio::chemical::Reaction::reactants

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