Develop Biology
The language of life
|
#include <Atom.h>
Public Member Functions | |
Atom (const Atom &other) | |
virtual | ~Atom () |
template<typename T > | |
T | As () |
template<typename T > | |
const T | As () const |
template<typename T > | |
T | AsBonded () |
template<typename T > | |
const T | AsBonded () const |
template<typename T > | |
T | AsBondedQuantum () |
template<typename T > | |
const T | AsBondedQuantum () const |
virtual Code | Attenuate (const Wave *other) |
BIO_DISAMBIGUATE_ALL_CLASS_METHODS (physical, Atom) explicit Atom() | |
template<typename T > | |
bool | BreakBond (T toDisassociate, BondType type=bond_type::Unknown()) |
virtual Code | Disattenuate (const Wave *other) |
template<typename T > | |
bool | FormBond (T toBond, BondType type=bond_type::Unknown()) |
Bonds * | GetAllBonds () |
const Bonds * | GetAllBonds () const |
Wave * | GetBonded (Valence position) |
const Wave * | GetBonded (Valence position) const |
template<typename T > | |
Valence | GetBondPosition () const |
Valence | GetBondPosition (AtomicNumber bondedId) const |
Valence | GetBondPosition (Name typeName) const |
template<typename T > | |
BondType | GetBondType () const |
BondType | GetBondType (Valence position) const |
template<typename T > | |
operator T () | |
virtual Code | Reify (physical::Symmetry *symmetry) |
virtual physical::Symmetry * | Spin () const |
Public Member Functions inherited from bio::physical::Class< Atom > | |
Class (Atom *object, Symmetry *symmetry=NULL) | |
virtual | ~Class () |
virtual Wave * | AsWave () |
virtual const Wave * | AsWave () const |
virtual Wave * | Clone () const |
Atom * | Convert (Wave *wave) |
virtual | operator Atom * () |
virtual | operator Wave * () |
Public Member Functions inherited from bio::physical::Wave | |
Wave (Symmetry *symmetry=NULL) | |
virtual | ~Wave () |
virtual chemical::Atom * | AsAtom () |
virtual const chemical::Atom * | AsAtom () const |
virtual Wave * | AsWave () |
virtual const Wave * | AsWave () const |
virtual Code | Attenuate (const Wave *other) |
virtual Wave * | Clone () const |
virtual Wave * | Demodulate () |
virtual const Wave * | Demodulate () const |
virtual Code | Disattenuate (const Wave *other) |
virtual Properties | GetProperties () const |
virtual Wave * | Modulate (Wave *signal) |
virtual Wave * | operator* () |
virtual const Wave * | operator* () const |
virtual Wave * | operator* (Wave *signal) |
virtual void | operator+ (const Wave *other) |
virtual void | operator- (const Wave *other) |
virtual void | operator| (Symmetry *symmetry) |
virtual Code | Reify (Symmetry *symmetry) |
virtual Symmetry * | Spin () const |
Protected Member Functions | |
virtual bool | BreakBondImplementation (Wave *toDisassociate, AtomicNumber id, BondType type) |
virtual bool | FormBondImplementation (Wave *toBond, AtomicNumber id, BondType type) |
Protected Attributes | |
Bonds | m_bonds |
Protected Attributes inherited from bio::physical::Class< Atom > | |
Atom * | m_object |
Protected Attributes inherited from bio::physical::Wave | |
Wave * | m_signal |
Symmetry * | m_symmetry |
Additional Inherited Members | |
Static Public Member Functions inherited from bio::physical::Wave | |
static Properties | GetResonanceBetween (const Wave *wave, const Properties &properties) |
static Properties | GetResonanceBetween (const Wave *wave1, const Wave *wave2) |
static Properties | GetResonanceBetween (ConstWaves waves) |
Atom MUST be virtually inherited! Atom is an interface for other implementations. Atom objects form Bonds with Waves (such as Quantum Waves, like real-life electrons). Counter to how atoms are often described, here, you can Bond things that are not Atoms (iff they are a Wave). This is similar to forming ionic bonds or radicals where the "bonded" target is a sub-atomic particle (also a shared resource). Waves have a unique class name to Id mapping that is stored in the PeriodicTable. Atom objects take advantage of this to store and retrieve pointers to any type. Bonds are arbitrarily flexible, so this system can be (ab)used in many ways. Unlike real chemistry, the actual valence of a Atom changes to accommodate new Bonds. NOTE: m_bonds[0] is always empty. This may change in a future release.
NOTE: iff using a C++ version below 11, only Quantum<> Bonds are supported. This is due to an inability to evaluate IsPrimitive<>() expressions at compile time and the compiler following all "possible" execution paths, which are necessarily incompatible.
|
explicit |
|
inline |
This method is here so that we can add different As____ methods without changing the downstream interfaces.
T |
Definition at line 176 of file Atom.h.
Referenced by bio::chemical::LinearMotif< CONTENT_TYPE >::Attenuate(), bio::chemical::LinearMotif< CONTENT_TYPE >::Disattenuate(), and bio::chemical::LinearMotif< CONTENT_TYPE >::ForEachImplementation().
|
inline |
Const version of As(). This method is here so that we can add different As____ methods without changing the downstream interfaces.
T |
Definition at line 199 of file Atom.h.
|
inline |
Gets the bond to an bonded of type T from this, then casts the Bond()ed Wave to T.
T |
Definition at line 125 of file Atom.h.
References BIO_SANITIZE, m_bonds, and bio::physical::Arrangement< TYPE >::OptimizedAccess().
Referenced by AsBondedQuantum().
|
inline |
Gets the bond to an bonded of type T from this, then casts the Bond()ed Wave to T.
T |
Definition at line 139 of file Atom.h.
References BIO_SANITIZE, m_bonds, and bio::physical::Arrangement< TYPE >::OptimizedAccess().
|
inline |
If T IsPrimitive(), you can use *this to get the Bonded Quantum Wave for that primitive.
T |
Definition at line 154 of file Atom.h.
References AsBonded().
|
inline |
Const version of AsBondedQuantum().
T |
Definition at line 165 of file Atom.h.
|
virtual |
If the given Wave Resonates with any Bonded Wave in *this, the given Wave will be Demodulated and Attenuated by the Bonded Wave. Attenuation here operates slightly differently from the real world concept. Because we have a continuous flow of electrons providing the power to run this code, doing work is essentially free (or at least abstracted and we don't HAVE to worry about it), Attenuation is more like amplification, where flux, in terms of work, is generated, rather than dispersed. However, if we treat some desired state as flux and any deviation from that state as offering resistance, "information flux" is lost as the desired state is approached, making Attenuation technically correct.
other |
Definition at line 49 of file Atom.cpp.
References bio::physical::Wave::Attenuate(), bio::code::BadArgument1(), BIO_SANITIZE, bio::physical::Wave::Demodulate(), bio::Container::End(), bio::chemical::Bond::GetBonded(), bio::physical::Wave::GetResonanceBetween(), bio::SmartIterator::IsAtBeginning(), bio::chemical::Bond::IsEmpty(), m_bonds, bio::code::Success(), and bio::code::UnknownError().
bio::chemical::Atom::BIO_DISAMBIGUATE_ALL_CLASS_METHODS | ( | physical | , |
Atom | |||
) |
Ensure virtual methods point to Class implementations.
|
inline |
Breaking a Bond Break()s the associated position. Removal of the Bond object is done upon destruction. Updating a Bond requires both Breaking and Forming steps to be done manually.
T |
toDisassociate | |
type |
Definition at line 279 of file Atom.h.
References BreakBondImplementation().
|
protectedvirtual |
Remove a Bond.
toDisassociate | |
id | |
type |
Definition at line 148 of file Atom.cpp.
References BIO_SANITIZE, GetBondPosition(), bio::Container::IsAllocated(), m_bonds, and bio::physical::Arrangement< TYPE >::OptimizedAccess().
Referenced by BreakBond().
|
virtual |
If the given Wave Resonates with any Bonded Wave in *this, the given Wave will be Demodulated and Disattenuated by the Bonded Wave. This is the opposite of Attenuation (above).
other |
Definition at line 83 of file Atom.cpp.
References bio::code::BadArgument1(), BIO_SANITIZE, bio::physical::Wave::Demodulate(), bio::physical::Wave::Disattenuate(), bio::Container::End(), bio::chemical::Bond::GetBonded(), bio::physical::Wave::GetResonanceBetween(), bio::SmartIterator::IsAtBeginning(), bio::chemical::Bond::IsEmpty(), m_bonds, bio::code::Success(), and bio::code::UnknownError().
|
inline |
Adds a new Bond to *this or updates an Empty Bond for T. Updating a Bond requires both Breaking and Forming steps to be done manually. You CANNOT bond the same T twice (without Breaking the initial Bond). See Molecule.h if you would like to Bond multiple Ts.
T | A pointer to an instance of a class deriving from Wave and which is not already Bonded. |
toBond | what to Bond |
Definition at line 237 of file Atom.h.
References bio::physical::Class< Atom >::AsWave(), and FormBondImplementation().
Referenced by bio::molecular::Surface::Bind(), bio::molecular::Surface::Manage(), and bio::molecular::Surface::Use().
|
protectedvirtual |
Create a Bond.
toBond | |
id | |
type |
Definition at line 117 of file Atom.cpp.
References bio::physical::Arrangement< TYPE >::Add(), BIO_SANITIZE, bio::chemical::Bond::Form(), GetBondPosition(), bio::Container::IsAllocated(), bio::chemical::Bond::IsEmpty(), m_bonds, and bio::physical::Arrangement< TYPE >::OptimizedAccess().
Referenced by FormBond().
Bonds * bio::chemical::Atom::GetAllBonds | ( | ) |
DANGEROUS!
Definition at line 224 of file Atom.cpp.
References m_bonds.
Referenced by bio::chemical::UnorderedStructureInterface::ImportAll().
const Bonds * bio::chemical::Atom::GetAllBonds | ( | ) | const |
physical::Wave * bio::chemical::Atom::GetBonded | ( | Valence | position | ) |
Simply get a bond.
position |
Definition at line 210 of file Atom.cpp.
References BIO_SANITIZE, bio::Container::IsAllocated(), m_bonds, and bio::physical::Arrangement< TYPE >::OptimizedAccess().
Referenced by bio::chemical::UnorderedStructureInterface::ImportAll(), and bio::chemical::LinearMotif< CONTENT_TYPE >::InsertImplementation().
const physical::Wave * bio::chemical::Atom::GetBonded | ( | Valence | position | ) | const |
Simply get a bond.
position |
Definition at line 217 of file Atom.cpp.
References BIO_SANITIZE, bio::Container::IsAllocated(), m_bonds, and bio::physical::Arrangement< TYPE >::OptimizedAccess().
|
inline |
GetBondPosition via a type, rather than an Wave Id.
T |
Definition at line 326 of file Atom.h.
References GetBondPosition().
Referenced by BreakBondImplementation(), FormBondImplementation(), GetBondPosition(), and GetBondType().
Valence bio::chemical::Atom::GetBondPosition | ( | AtomicNumber | bondedId | ) | const |
Gives the array index of a Bond()ed Wave.
bondedId |
Definition at line 168 of file Atom.cpp.
References BIO_SANITIZE, bio::Container::End(), bio::SmartIterator::IsAtBeginning(), and m_bonds.
Referenced by bio::chemical::UnorderedStructureInterface::ImportAll(), and bio::chemical::Reactant::operator==().
Converts the given typeName to and Id Gives the array index of a Bond()ed Wave.
typeName |
Definition at line 186 of file Atom.cpp.
References GetBondPosition().
|
inline |
Get the type of a Bond.
T |
Definition at line 352 of file Atom.h.
References GetBondPosition(), and GetBondType().
Referenced by GetBondType().
BondType bio::chemical::Atom::GetBondType | ( | Valence | position | ) | const |
Get the type of a Bond.
position |
Definition at line 191 of file Atom.cpp.
References BIO_SANITIZE, bio::Container::IsAllocated(), m_bonds, and bio::physical::Arrangement< TYPE >::OptimizedAccess().
|
inline |
|
virtual |
Required method from Wave. See that class for details. Reconstruct *this from the given Symmetry.
symmetry |
Reimplemented from bio::physical::Wave.
Reimplemented in bio::molecular::Molecule, and bio::molecular::Surface.
Definition at line 204 of file Atom.cpp.
|
virtual |
Required method from Wave. See that class for details.
Reimplemented from bio::physical::Wave.
Reimplemented in bio::molecular::Molecule, and bio::molecular::Surface.
Definition at line 198 of file Atom.cpp.
|
protected |
Definition at line 378 of file Atom.h.
Referenced by bio::molecular::Surface::~Surface(), AsBonded(), Attenuate(), BreakBondImplementation(), Disattenuate(), FormBondImplementation(), GetAllBonds(), GetBonded(), GetBondPosition(), GetBondType(), bio::molecular::Surface::Release(), and bio::molecular::Surface::ReleaseAll().