Develop Biology
The language of life
bio::molecular::Molecule Class Reference

#include <Molecule.h>

+ Inheritance diagram for bio::molecular::Molecule:
+ Collaboration diagram for bio::molecular::Molecule:

Public Member Functions

virtual ~Molecule ()
 
 BIO_DISAMBIGUATE_ALL_CLASS_METHODS (molecular, Molecule) BIO_DEFAULT_IDENTIFIABLE_CONSTRUCTORS(molecular
 
StandardDimension Define (Name varName)
 
template<typename T >
StandardDimension Define (Name varName)
 
template<typename T >
StandardDimension Define (Name varName, const T &assignment)
 
virtual bool DuplicateFrom (Molecule *source, Name surface)
 
 filter::Molecular ()) Molecule(const Molecule &toCopy)
 
MoleculePerspective::Instance ()
 
virtual Moleculeoperator<< (Molecule *source)
 
virtual Moleculeoperator<< (Surface *source)
 
virtual Moleculeoperator>> (Molecule *target)
 
virtual Surfaceoperator>> (Surface *target)
 
virtual Code Reify (physical::Symmetry *symmetry)
 
virtual SurfaceRotateTo (Name surfaceName)
 
virtual const SurfaceRotateTo (Name surfaceName) const
 
template<typename T >
RotateTo (Name surfaceName) const
 
virtual SurfaceRotateTo (StandardDimension surfaceId)
 
virtual const SurfaceRotateTo (StandardDimension surfaceId) const
 
template<typename T >
RotateTo (StandardDimension surfaceId) const
 
virtual physical::SymmetrySpin () const
 
virtual bool TransferFrom (Molecule *source, Name surface)
 
template<typename T >
StandardDimension Use (Name varName, T *varPtr)
 
virtual Surfaceoperator() (StandardDimension surfaceId)
 
virtual const Surfaceoperator() (StandardDimension surfaceId) const
 
template<typename T >
Surfaceoperator() (StandardDimension surfaceId)
 
virtual Surfaceoperator() (Name name)
 
virtual const Surfaceoperator() (Name name) const
 
template<typename T >
Surfaceoperator() (Name surfaceName)
 
- Public Member Functions inherited from bio::molecular::Class< Molecule >
 BIO_DISAMBIGUATE_ALL_CLASS_METHODS (chemical, Molecule) Class(Molecule *object
 
- Public Member Functions inherited from bio::chemical::Class< T >
 BIO_DISAMBIGUATE_ALL_CLASS_METHODS (physical, T) Class(T *object
 
- Public Member Functions inherited from bio::physical::Class< T >
 Class (T *object, Symmetry *symmetry=NULL)
 
virtual ~Class ()
 
virtual WaveAsWave ()
 
virtual const WaveAsWave () const
 
virtual WaveClone () const
 
T * Convert (Wave *wave)
 
virtual operator T* ()
 
virtual operator Wave * ()
 
- Public Member Functions inherited from bio::physical::Wave
 Wave (Symmetry *symmetry=NULL)
 
virtual ~Wave ()
 
virtual chemical::AtomAsAtom ()
 
virtual const chemical::AtomAsAtom () const
 
virtual WaveAsWave ()
 
virtual const WaveAsWave () const
 
virtual Code Attenuate (const Wave *other)
 
virtual WaveClone () const
 
virtual WaveDemodulate ()
 
virtual const WaveDemodulate () const
 
virtual Code Disattenuate (const Wave *other)
 
virtual Properties GetProperties () const
 
virtual WaveModulate (Wave *signal)
 
virtual Waveoperator* ()
 
virtual const Waveoperator* () const
 
virtual Waveoperator* (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 SymmetrySpin () const
 
- Public Member Functions inherited from bio::physical::Identifiable< StandardDimension >
 BIO_DISAMBIGUATE_ALL_CLASS_METHODS (physical, Identifiable< StandardDimension >) explicit Identifiable(Perspective< StandardDimension > *perspective
 
void CloneIntoName (Name name)
 
- Public Member Functions inherited from bio::physical::Observer< Perspective< StandardDimension > >
 Observer (const Observer &other)
 
 Observer (Perspective *perspective=NULL)
 
virtual ~Observer ()
 
virtual PerspectiveGetPerspective () const
 
virtual void SetPerspective (Perspective *perspective)
 
- Public Member Functions inherited from bio::physical::Class< Identifiable< StandardDimension > >
 Class (Identifiable< StandardDimension > *object, Symmetry *symmetry=NULL)
 
virtual ~Class ()
 
virtual WaveAsWave ()
 
virtual const WaveAsWave () const
 
virtual WaveClone () const
 
Identifiable< StandardDimension > * Convert (Wave *wave)
 
virtual operator Identifiable< StandardDimension > * ()
 
virtual operator Wave * ()
 
- Public Member Functions inherited from bio::log::Writer
 Writer (Engine *logEngine, Filter logFilter)
 
virtual ~Writer ()
 
 BIO_DISAMBIGUATE_ALL_CLASS_METHODS (physical, Writer) Writer()
 
void ExternalLog (Filter logFilter, Level level, const char *format,...) const
 
EngineGetLogEngine ()
 
const EngineGetLogEngine () const
 
bool HasLogEngine () const
 
virtual void SetLogEngine (Engine *logEngine)
 
- Public Member Functions inherited from bio::physical::Filterable
 Filterable (Filter filter)
 
virtual ~Filterable ()
 
 BIO_DISAMBIGUATE_ALL_CLASS_METHODS (physical, Filterable) Filterable()
 
Filter GetFilter () const
 
virtual void InitializeImplementation (ByteStreams args)
 
virtual Code Reify (Symmetry *symmetry)
 
virtual void SetFilter (Filter filter)
 
virtual SymmetrySpin () const
 
- Public Member Functions inherited from bio::physical::Class< Filterable >
 Class (Filterable *object, Symmetry *symmetry=NULL)
 
virtual ~Class ()
 
virtual WaveAsWave ()
 
virtual const WaveAsWave () const
 
virtual WaveClone () const
 
FilterableConvert (Wave *wave)
 
virtual operator Filterable * ()
 
virtual operator Wave * ()
 
- Public Member Functions inherited from bio::physical::Class< Writer >
 Class (Writer *object, Symmetry *symmetry=NULL)
 
virtual ~Class ()
 
virtual WaveAsWave ()
 
virtual const WaveAsWave () const
 
virtual WaveClone () const
 
Writer * Convert (Wave *wave)
 
virtual operator Wave * ()
 
virtual operator Writer * ()
 
- Public Member Functions inherited from bio::chemical::Atom
 Atom (const Atom &other)
 
virtual ~Atom ()
 
template<typename T >
As ()
 
template<typename T >
const T As () const
 
template<typename T >
AsBonded ()
 
template<typename T >
const T AsBonded () const
 
template<typename 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())
 
BondsGetAllBonds ()
 
const BondsGetAllBonds () const
 
WaveGetBonded (Valence position)
 
const WaveGetBonded (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::SymmetrySpin () const
 
- Public Member Functions inherited from bio::physical::Class< Atom >
 Class (Atom *object, Symmetry *symmetry=NULL)
 
virtual ~Class ()
 
virtual WaveAsWave ()
 
virtual const WaveAsWave () const
 
virtual WaveClone () const
 
Atom * Convert (Wave *wave)
 
virtual operator Atom * ()
 
virtual operator Wave * ()
 
- Public Member Functions inherited from bio::chemical::Substance
Substance Substance (const typename UnorderedMotif< Property >::Contents *properties, const typename UnorderedMotif< State >::Contents *states)
 
virtual ~Substance ()
 
 BIO_DEFAULT_IDENTIFIABLE_CONSTRUCTORS_WITH_CTOR_COMMON (chemical, Substance, &SubstancePerspective::Instance(), filter::Chemical()) BIO_DISAMBIGUATE_ALL_CLASS_METHODS(chemical
 
virtual void Disable ()
 
virtual void Enable ()
 
virtual bool IsEnabled () 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 >
Add (const T t)
 
template<typename T >
void Clear ()
 
template<typename T >
ContainerGetAll ()
 
template<typename T >
const ContainerGetAll () const
 
template<typename T >
std::vector< T > GetAllAsVector ()
 
template<typename T >
const std::vector< T > GetAllAsVector () const
 
template<typename T >
unsigned long GetCount () const
 
template<typename T >
unsigned int GetNumMatching (const Container *other) const
 
template<typename T >
std::string GetStringFrom (std::string separator=", ")
 
template<typename T >
bool Has (T content) const
 
template<typename T >
bool HasAll (const Container *contents) const
 
template<typename T >
void Import (const std::vector< T > &other)
 
template<typename T >
void Import (const UnorderedMotif< T > *other)
 
Code ImportAll (const physical::Wave *other)
 
template<typename T >
Remove (const T t)
 
- Public Member Functions inherited from bio::ThreadSafe
 ThreadSafe ()
 
 ThreadSafe (const ThreadSafe &toCopy)
 
virtual ~ThreadSafe ()
 
void LockThread () const
 
void UnlockThread () const
 
- Public Member Functions inherited from bio::chemical::LinearStructureInterface
 LinearStructureInterface ()
 
virtual ~LinearStructureInterface ()
 
template<typename T >
Emission ForEach (ExcitationBase *excitation)
 
template<typename T >
GetById (StandardDimension id)
 
template<typename T >
const T GetById (StandardDimension id) const
 
template<typename T >
GetByName (Name name)
 
template<typename T >
const T GetByName (Name name) const
 
template<typename T >
GetOrCreateById (StandardDimension id)
 
template<typename T >
GetOrCreateByName (Name name)
 
template<typename T >
Code Insert (T toAdd, const Position position=BOTTOM, const StandardDimension optionalPositionArg=0, const bool transferSubContents=false)
 
- Public Member Functions inherited from bio::chemical::Class< Substance >
 BIO_DISAMBIGUATE_ALL_CLASS_METHODS (physical, Substance) Class(Substance *object
 
- Public Member Functions inherited from bio::chemical::UnorderedMotif< Property >
 UnorderedMotif (const Contents *contents)
 
 UnorderedMotif (const UnorderedMotif< Property > *toCopy)
 
virtual ~UnorderedMotif ()
 
virtual Property AddImplementation (const Property content)
 
 BIO_DISAMBIGUATE_ALL_CLASS_METHODS (chemical, UnorderedMotif< Property >) UnorderedMotif()
 
virtual void ClearImplementation ()
 
virtual unsigned long GetCountImplementation () const
 
virtual unsigned int GetNumMatchingImplementation (const Container *other) const
 
virtual std::string GetStringFromImplementation (std::string separator=", ")
 
virtual bool HasAllImplementation (const Container *contents) const
 
virtual bool HasImplementation (const Property content) const
 
virtual void ImportImplementation (const UnorderedMotif< Property > *other)
 
virtual Property RemoveImplementation (const Property content)
 
- Public Member Functions inherited from bio::chemical::Class< UnorderedMotif< Property > >
 BIO_DISAMBIGUATE_ALL_CLASS_METHODS (physical, UnorderedMotif< Property >) Class(UnorderedMotif< Property > *object
 
- Public Member Functions inherited from bio::chemical::AbstractMotif
 AbstractMotif ()
 
virtual ~AbstractMotif ()
 
virtual void ClearImplementation ()
 
virtual ContainerGetAllImplementation ()
 
virtual const ContainerGetAllImplementation () const
 
virtual unsigned long GetCountImplementation () const
 
virtual std::string GetStringFromImplementation (std::string separator=", ")
 
virtual void ImportImplementation (const void *other)
 
- Public Member Functions inherited from bio::chemical::UnorderedMotif< State >
 UnorderedMotif (const Contents *contents)
 
 UnorderedMotif (const UnorderedMotif< State > *toCopy)
 
virtual ~UnorderedMotif ()
 
virtual State AddImplementation (const State content)
 
 BIO_DISAMBIGUATE_ALL_CLASS_METHODS (chemical, UnorderedMotif< State >) UnorderedMotif()
 
virtual void ClearImplementation ()
 
virtual unsigned long GetCountImplementation () const
 
virtual unsigned int GetNumMatchingImplementation (const Container *other) const
 
virtual std::string GetStringFromImplementation (std::string separator=", ")
 
virtual bool HasAllImplementation (const Container *contents) const
 
virtual bool HasImplementation (const State content) const
 
virtual void ImportImplementation (const UnorderedMotif< State > *other)
 
virtual State RemoveImplementation (const State content)
 
- Public Member Functions inherited from bio::chemical::Class< UnorderedMotif< State > >
 BIO_DISAMBIGUATE_ALL_CLASS_METHODS (physical, UnorderedMotif< State >) Class(UnorderedMotif< State > *object
 
- Public Member Functions inherited from bio::physical::Perspective< StandardDimension >
 Perspective ()
 
virtual ~Perspective ()
 
virtual bool AssociateType (Id id, Wave *type)
 
virtual bool DisassociateType (Id id)
 
Hadits::iterator Find (Id id)
 
Hadits::const_iterator Find (Id id) const
 
virtual Id GetIdFromName (Name name)
 
virtual Id GetIdWithoutCreation (Name name) const
 
virtual Name GetNameFromId (Id id) const
 
virtual WaveGetNewObjectFromId (Id id) const
 
GetNewObjectFromIdAs (Id id)
 
virtual WaveGetNewObjectFromName (Name name)
 
GetNewObjectFromNameAs (Name name)
 
virtual Id GetNumUsedIds () const
 
virtual const WaveGetTypeFromId (Id id) const
 
const T GetTypeFromIdAs (Id id) const
 
virtual const WaveGetTypeFromName (Name name) const
 
const T GetTypeFromNameAs (Name name) const
 
virtual Id GetUniqueIdFor (Name name)
 
- Public Member Functions inherited from bio::chemical::LinearMotif< Surface * >
 LinearMotif (const Contents *contents, physical::Perspective< StandardDimension > *perspective=NULL)
 
 LinearMotif (const LinearMotif< Surface * > &toCopy)
 
 LinearMotif (physical::Perspective< StandardDimension > *perspective=NULL)
 
virtual ~LinearMotif ()
 
virtual Surface * AddImplementation (Surface * content)
 
virtual Code Attenuate (const physical::Wave *other)
 
 BIO_DISAMBIGUATE_REQUIRED_CLASS_METHODS (chemical, LinearMotif< Surface * >) BIO_DISAMBIGUATE_OPTIONAL_CLASS_METHODS(physical
 
virtual void ClearImplementation ()
 
virtual Surface * CreateImplementation (StandardDimension id)
 
virtual Code Disattenuate (const physical::Wave *other)
 
virtual Emission ForEachImplementation (ExcitationBase *excitation)
 
virtual Surface * GetByIdImplementation (StandardDimension id)
 
virtual const Surface * GetByIdImplementation (StandardDimension id) const
 
virtual Surface * GetByNameImplementation (Name name)
 
virtual const Surface * GetByNameImplementation (Name name) const
 
virtual Surface * GetOrCreateByIdImplementation (StandardDimension id)
 
virtual Surface * GetOrCreateByNameImplementation (Name name)
 
virtual std::string GetStringFromImplementation (std::string separator=", ")
 
physical::Perspective< StandardDimension > * GetStructuralPerspective ()
 
const physical::Perspective< StandardDimension > * GetStructuralPerspective () const
 
virtual bool HasImplementation (const Surface * &content) const
 
virtual void ImportImplementation (const LinearMotif< Surface * > *other)
 
virtual Code InsertImplementation (Surface * toAdd, const Position position=BOTTOM, const StandardDimension optionalPositionArg=0, const bool transferSubContents=false)
 
- Public Member Functions inherited from bio::chemical::Elementary< LinearMotif< Surface * > >
 Elementary ()
 
 Elementary (const Properties properties)
 
virtual ~Elementary ()
 
void RegisterProperties (const Properties properties)
 
- Public Member Functions inherited from bio::chemical::Class< LinearMotif< Surface * > >
 BIO_DISAMBIGUATE_ALL_CLASS_METHODS (physical, LinearMotif< Surface * >) Class(LinearMotif< Surface * > *object
 
- Public Member Functions inherited from bio::chemical::UnorderedMotif< Surface * >
 UnorderedMotif (const Contents *contents)
 
 UnorderedMotif (const UnorderedMotif< Surface * > *toCopy)
 
virtual ~UnorderedMotif ()
 
virtual Surface * AddImplementation (const Surface * content)
 
 BIO_DISAMBIGUATE_ALL_CLASS_METHODS (chemical, UnorderedMotif< Surface * >) UnorderedMotif()
 
virtual void ClearImplementation ()
 
virtual unsigned long GetCountImplementation () const
 
virtual unsigned int GetNumMatchingImplementation (const Container *other) const
 
virtual std::string GetStringFromImplementation (std::string separator=", ")
 
virtual bool HasAllImplementation (const Container *contents) const
 
virtual bool HasImplementation (const Surface * content) const
 
virtual void ImportImplementation (const UnorderedMotif< Surface * > *other)
 
virtual Surface * RemoveImplementation (const Surface * content)
 
- Public Member Functions inherited from bio::chemical::Class< UnorderedMotif< Surface * > >
 BIO_DISAMBIGUATE_ALL_CLASS_METHODS (physical, UnorderedMotif< Surface * >) Class(UnorderedMotif< Surface * > *object
 

Public Attributes

 Molecule
 
- Public Attributes inherited from bio::molecular::Class< Molecule >
physical::Perspective< StandardDimension > Filter filter
 
physical::Perspective< StandardDimension > * perspective
 
- Public Attributes inherited from bio::chemical::Class< T >
physical::Perspective< StandardDimension > Filter filter = filter::Default()
 
physical::Perspective< StandardDimension > * perspective = NULL
 
- Public Attributes inherited from bio::physical::Identifiable< StandardDimension >
Id m_id
 
- Public Attributes inherited from bio::chemical::Class< Substance >
physical::Perspective< StandardDimension > Filter filter
 
physical::Perspective< StandardDimension > * perspective
 
- Public Attributes inherited from bio::chemical::Class< UnorderedMotif< Property > >
physical::Perspective< StandardDimension > Filter filter
 
physical::Perspective< StandardDimension > * perspective
 
- Public Attributes inherited from bio::chemical::Class< UnorderedMotif< State > >
physical::Perspective< StandardDimension > Filter filter
 
physical::Perspective< StandardDimension > * perspective
 
- Public Attributes inherited from bio::chemical::LinearMotif< Surface * >
physical::Perspective< StandardDimension > * m_perspective
 
- Public Attributes inherited from bio::chemical::Class< LinearMotif< Surface * > >
physical::Perspective< StandardDimension > Filter filter
 
physical::Perspective< StandardDimension > * perspective
 
- Public Attributes inherited from bio::chemical::Class< UnorderedMotif< Surface * > >
physical::Perspective< StandardDimension > Filter filter
 
physical::Perspective< StandardDimension > * perspective
 

Additional Inherited Members

- Public Types inherited from bio::physical::Identifiable< StandardDimension >
typedef StandardDimension Id
 
typedef std::vector< IdIds
 
- Public Types inherited from bio::physical::Observer< Perspective< StandardDimension > >
typedef Perspective< StandardDimension > Perspective
 
- Public Types inherited from bio::chemical::UnorderedMotif< Property >
typedef physical::Arrangement< Property > Contents
 
- Public Types inherited from bio::chemical::UnorderedMotif< State >
typedef physical::Arrangement< State > Contents
 
- Public Types inherited from bio::physical::Perspective< StandardDimension >
typedef std::vector< Hadit > Hadits
 
typedef StandardDimension Id
 
typedef std::vector< IdIds
 
- Public Types inherited from bio::chemical::LinearMotif< Surface * >
typedef physical::Line Contents
 
- Public Types inherited from bio::chemical::UnorderedMotif< Surface * >
typedef physical::Arrangement< Surface * > Contents
 
- 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)
 
- Static Public Member Functions inherited from bio::chemical::AbstractMotif
static Properties GetClassProperties ()
 
- Static Public Member Functions inherited from bio::physical::Perspective< StandardDimension >
static Id InvalidId ()
 
static Name InvalidName ()
 
- Static Public Member Functions inherited from bio::chemical::LinearMotif< Surface * >
static LinearMotif< Surface * > Properties GetClassProperties ()
 
- Static Public Attributes inherited from bio::chemical::Elementary< LinearMotif< Surface * > >
static bool hasRegistered
 
- Protected Member Functions inherited from bio::physical::Observer< Perspective< StandardDimension > >
virtual void InitializeImplementation (ByteStreams args)
 
- Protected Member Functions inherited from bio::VirtualBase
 VirtualBase ()
 
virtual ~VirtualBase ()
 
void Initialize (ByteStream arg1)
 
void Initialize (ByteStream arg1, ByteStream arg2)
 
void Initialize (ByteStream arg1, ByteStream arg2, ByteStream arg3)
 
void Initialize (ByteStreams args)
 
virtual void InitializeImplementation (ByteStreams args)=0
 
- Protected Member Functions inherited from bio::log::Writer
virtual void InitializeImplementation (ByteStreams args)
 
void Log (Level level, const char *format,...) const
 
- Protected Member Functions inherited from bio::chemical::Atom
virtual bool BreakBondImplementation (Wave *toDisassociate, AtomicNumber id, BondType type)
 
virtual bool FormBondImplementation (Wave *toBond, AtomicNumber id, BondType type)
 
- Protected Attributes inherited from bio::physical::Class< T >
T * m_object
 
- Protected Attributes inherited from bio::physical::Wave
Wavem_signal
 
Symmetrym_symmetry
 
- Protected Attributes inherited from bio::VirtualBase
bool m_hasBeenInitialized
 
- Protected Attributes inherited from bio::physical::Class< Identifiable< StandardDimension > >
Identifiable< StandardDimension > * m_object
 
- Protected Attributes inherited from bio::physical::Filterable
Filter m_filter
 
- Protected Attributes inherited from bio::physical::Class< Filterable >
Filterablem_object
 
- Protected Attributes inherited from bio::physical::Class< Writer >
Writer * m_object
 
- Protected Attributes inherited from bio::chemical::Atom
Bonds m_bonds
 
- Protected Attributes inherited from bio::physical::Class< Atom >
Atom * m_object
 
- Protected Attributes inherited from bio::chemical::AbstractMotif
Containerm_contents
 
- Protected Attributes inherited from bio::physical::Perspective< StandardDimension >
Hadits m_hadits
 
Id m_nextId
 

Detailed Description

As a combination of relativistic Waves and chemical Bonds, Molecules are rather complicated. They're kinda like viewing particle physics from mathematical topology. I'm not sure I have the english words to describe this view of the world adequately, so looking at the code might be better. Still, I'll try to describe the idea as an imagination exercise:

Imagine a Quantum Wave (aka a built-in type, like bool or int) as a sphere. These quantum balls are the maximum resolution we can see any Molecule through (it doesn't get any more basic than built-in types). Next, imagine a collection of these spheres as some kind of glob. This represents a collection of basic types and would be akin to a class or struct. However, these globs can take whatever form we want and do not have to map into any hard-coded structure. We call these globular constructs a Surface. Most of the time, Surfaces will be singular globs, with a 1 to 1 Surface to primitive type correspondence. However, they can be arbitrarily knobby. Now imagine 10 or so of these Surfaces all stuck together as a Molecule. So, a Molecule is just a big globby mass. Surfaces do not (usually) overlap. They are, instead, distinct, identifiable (Identifiable<StandardDimension>) regions on a Molecule. Imagine identical 2 Molecules that have 1 globby collection (Surface) that differs between them. That kind of comparative difference helps us Identify the Surfaces from the otherwise indistinguishable mass of globs. Next, imagine 2 Molecules bumping into each other so that 1 or more of their Surfaces touch. When Surfaces interact in this manner, they can change each other. In computer science, we can just conjure change whenever, however, and wherever we want. However, in the real world, the idea that matter / energy is conserved requires that matter / energy be moved between the interacting surfaces in order to effect change. This same concept has been modeled here (see Transfer..., etc., below); though we can still do whatever the **** we want cause computers.

You can create Surfaces in 1 Molecule and then Transfer them to another. However, doing so may change (or break) the Molecules' interactions with other Molecules and systems. This would be like transferring variables between objects at runtime. This Transfer system is why Molecules are Perspectives. The Id of Surfaces in 1 Molecule may not hold within another Molecule and we don't want to enforce a global Surface labeling at this time. You can think of Surface::Ids as numbered variables. When an class (Molecule) is instantiated, we go through and number its member variables. Members can then be added or removed throughout the life of the object and each one will have a number that is unique to that Molecule. In other words, there is no absolutely right number for "MyVar"; instead, "MyVar" can be an int in one Molecule and a bool in another.

The ability to Transfer Surfaces between Molecules is just one advantage that comes from this member abstraction. Another advantage is Symmetry (i.e. reflection into other languages, like json). Beyond this point, Spin() and Reify(), which are native to physical::Waves, should no longer require definition, as we will be able to use the Biology structures we've created to determine those implementations dynamically.

Lastly, Surfaces also give us the ability to store methods via Proteins. See Protein.h for more on that.

In order realize the behavior described above, we have to employ a non-native, Biology-specific syntax. In short, Define<>() creates a member and RotateTo gets a member. For example: MyType myVar = SomeFunction(); => Define<MyType>("myVar", SomeFunction()); MyType another = myVar; => Define<MyType>("another", RotateTo("myVar")); Of course, in order to avoid slower string lookups, you can cache the Id of "myVar" within a Molecule by calling GetIdFromName("myVar"), which can then be used with RotateTo(...).

You can think of members as globs on the surface of our Molecule and we rotate this globby mass until the side we want is facing us. This allows us to interact with our desired Surface. In order to set a member, you would do something like: RotateTo("myVar")->operator=(*RotateTo("another")); or, more simply, (*RotateTo("myVar")) = (*RotateTo("another")) NOTE: if "myVar" or "another" don't exist in the Molecule, this will segfault. To avoid crashing, you may want to use BIO_SANITIZE() (from bio/common/Macros.h) This can be done because Surfaces can be treated as the values they are Bonded to.

Lastly, if you want to create a Molecule from a hard-coded data structure, you can call Use() instead of Define<>(), which will create a Surface from a (member) pointer. Surfaces created with Use will not be Transferable.

Definition at line 72 of file Molecule.h.

Constructor & Destructor Documentation

◆ ~Molecule()

bio::molecular::Molecule::~Molecule ( )
virtual

Definition at line 44 of file Molecule.cpp.

45{
46}

Member Function Documentation

◆ BIO_DISAMBIGUATE_ALL_CLASS_METHODS()

bio::molecular::Molecule::BIO_DISAMBIGUATE_ALL_CLASS_METHODS ( molecular  ,
Molecule   
)

Ensure virtual methods point to Class implementations. Standard ctors.

◆ Define() [1/3]

StandardDimension bio::molecular::Molecule::Define ( Name  varName)
inline

Create a new variable within *this, the Biology way. The created variable will have no type set upon creation. Will fail if varName already exists within *this.

Parameters
varName
Returns
the Id of the Surface created or InvalidId().

Definition at line 135 of file Molecule.h.

136 {
137 BIO_SANITIZE(!RotateTo(varName), ,
138 return InvalidId());
139 Surface* toAdd = new Surface(
140 varName,
141 this
142 );
143 Add< Surface* >(toAdd);
144 return toAdd->GetId();
145 }
#define BIO_SANITIZE(test, success, failure)
virtual Surface * RotateTo(StandardDimension surfaceId)
Definition: Molecule.cpp:48

References BIO_SANITIZE, bio::physical::Perspective< StandardDimension >::InvalidId(), and RotateTo().

Referenced by bio::genetic::FetchPlasmid::FetchPlasmid(), bio::genetic::RegisterPlasmid::RegisterPlasmid(), and bio::genetic::RNAPolymerase::RNAPolymerase().

◆ Define() [2/3]

template<typename T >
StandardDimension bio::molecular::Molecule::Define ( Name  varName)
inline

Create a new variable within *this, the Biology way. Will fail if varName already exists within *this.

Template Parameters
T
Parameters
varName
Returns
the Id of the Surface created or InvalidId().

Definition at line 155 of file Molecule.h.

156 {
157 BIO_SANITIZE(!RotateTo(varName), ,
158 return InvalidId());
159 Surface* toAdd = new Surface(
160 varName,
161 this
162 );
163 toAdd->Manage(new T());
164 Add< Surface* >(toAdd);
165 return toAdd->GetId();
166 }

References BIO_SANITIZE, bio::physical::Perspective< StandardDimension >::InvalidId(), bio::molecular::Surface::Manage(), and RotateTo().

◆ Define() [3/3]

template<typename T >
StandardDimension bio::molecular::Molecule::Define ( Name  varName,
const T &  assignment 
)
inline

Create a new variable within *this, the Biology way. Assigns the new variable to the value provided. Will fail if varName already exists within *this.

Template Parameters
T
Parameters
varName
assignment
Returns
the Id of the Surface created or InvalidId().

Definition at line 178 of file Molecule.h.

182 {
183 BIO_SANITIZE(!RotateTo(varName), ,
184 return InvalidId());
185 Surface* toAdd = new Surface(
186 varName,
187 this
188 );
189 toAdd->Manage(new T(assignment));
190 Add< Surface* >(toAdd);
191 return toAdd->GetId();
192 }

References BIO_SANITIZE, bio::physical::Perspective< StandardDimension >::InvalidId(), bio::molecular::Surface::Manage(), and RotateTo().

◆ DuplicateFrom()

bool bio::molecular::Molecule::DuplicateFrom ( Molecule source,
Name  surface 
)
virtual

Copy a Surface from another Molecule into *this.

Parameters
source
surface
Returns
whether or not the operation succeeded.

Definition at line 84 of file Molecule.cpp.

88{
89 BIO_SANITIZE(source, ,
90 return false);
91
92 BIO_SANITIZE(!RotateTo(surface), ,
93 return false);
94
95 Surface* toTransfer = NULL;
96
97 BIO_SANITIZE_WITH_CACHE(source->RotateTo(surface),
98 toTransfer = RESULT,
99 return false);
100
101 Add< Surface* >(CloneAndCast< Surface* >(toTransfer))->SetEnvironment(this);
102 return true;
103}
#define BIO_SANITIZE_WITH_CACHE(test, success, failure)

References BIO_SANITIZE, BIO_SANITIZE_WITH_CACHE, and RotateTo().

◆ filter::Molecular()

bio::molecular::Molecule::filter::Molecular ( ) const &

Copying a Molecule will duplicate all Surfaces of toCopy.

Parameters
toCopy

◆ MoleculePerspective::Instance()

& bio::molecular::Molecule::MoleculePerspective::Instance ( )

◆ operator()() [1/6]

Surface * bio::molecular::Molecule::operator() ( Name  name)
virtual

Definition at line 137 of file Molecule.cpp.

138{
139 return RotateTo(name);
140}

◆ operator()() [2/6]

const Surface * bio::molecular::Molecule::operator() ( Name  name) const
virtual

Definition at line 142 of file Molecule.cpp.

143{
144 return RotateTo(name);
145}

◆ operator()() [3/6]

template<typename T >
Surface * bio::molecular::Molecule::operator() ( Name  surfaceName)
inline

Definition at line 303 of file Molecule.h.

304 {
305 return ChemicalCast< T >(RotateTo(surfaceName));
306 }

References RotateTo().

◆ operator()() [4/6]

Surface * bio::molecular::Molecule::operator() ( StandardDimension  surfaceId)
virtual

operator wrappers around RotateTo

Parameters
surfaceId
Returns
RotateTo(...)

Definition at line 127 of file Molecule.cpp.

128{
129 return RotateTo(surfaceId);
130}

◆ operator()() [5/6]

template<typename T >
Surface * bio::molecular::Molecule::operator() ( StandardDimension  surfaceId)
inline

Definition at line 293 of file Molecule.h.

294 {
295 return ChemicalCast< T >(RotateTo(surfaceId));
296 }

References RotateTo().

◆ operator()() [6/6]

const Surface * bio::molecular::Molecule::operator() ( StandardDimension  surfaceId) const
virtual

Definition at line 132 of file Molecule.cpp.

133{
134 return RotateTo(surfaceId);
135}

◆ operator<<() [1/2]

Molecule * bio::molecular::Molecule::operator<< ( Molecule source)
virtual

Molecule copy operation. Copies all Surfaces on the source Molecule onto *this.

Parameters
source
Returns
this

Definition at line 163 of file Molecule.cpp.

164{
165 BIO_SANITIZE(source, ,
166 return this);
167 Import< Surface* >(source);
168 return this;
169}

References BIO_SANITIZE.

◆ operator<<() [2/2]

Molecule * bio::molecular::Molecule::operator<< ( Surface source)
virtual

Surface move operation. Moves a Surface onto *this.

Parameters
source
Returns
this

Definition at line 147 of file Molecule.cpp.

148{
149 BIO_SANITIZE(source, ,
150 return this);
151 Add< Surface* >(source)->SetEnvironment(this);
152 return this;
153}

References BIO_SANITIZE.

◆ operator>>() [1/2]

Molecule * bio::molecular::Molecule::operator>> ( Molecule target)
virtual

Molecule move operation. Moves all Surfaces on *this onto the target Molecule. This REMOVES all Surfaces from *this.

Parameters
target
Returns
target

Definition at line 171 of file Molecule.cpp.

172{
173 BIO_SANITIZE(target, ,
174 return target);
175 target->Import< Surface* >(this);
176 Clear< Surface* >();
177 return target;
178}

References BIO_SANITIZE, and bio::chemical::UnorderedStructureInterface::Import().

◆ operator>>() [2/2]

Surface * bio::molecular::Molecule::operator>> ( Surface target)
virtual

Surface move operation. Places *this in a Surface. NOTE: There is no check that *this is not in multiple Surfaces.

Parameters
target
Returns
target

Definition at line 155 of file Molecule.cpp.

156{
157 BIO_SANITIZE(target, ,
158 return target);
159 target->Add< Molecule* >(this);
160 return target;
161}

References bio::chemical::UnorderedStructureInterface::Add(), and BIO_SANITIZE.

◆ Reify()

Code bio::molecular::Molecule::Reify ( physical::Symmetry symmetry)
virtual

Required method from Wave. See that class for details. Reconstruct *this from the given Symmetry.

Parameters
symmetry

Reimplemented from bio::chemical::Atom.

Definition at line 186 of file Molecule.cpp.

187{
188 //TODO...
189 return code::NotImplemented();
190}
Code NotImplemented()

References bio::code::NotImplemented().

◆ RotateTo() [1/6]

Surface * bio::molecular::Molecule::RotateTo ( Name  surfaceName)
virtual

Get a variable from within *this. Use for getting and/or setting.

Parameters
surfaceName
Returns
a Surface with the given Name from *this.

Definition at line 66 of file Molecule.cpp.

67{
68 BIO_SANITIZE_WITH_CACHE(GetByName< Surface* >(
69 surfaceName
70 ),
71 return *Cast< Surface** >(RESULT),
72 return NULL);
73}

References BIO_SANITIZE_WITH_CACHE.

◆ RotateTo() [2/6]

const Surface * bio::molecular::Molecule::RotateTo ( Name  surfaceName) const
virtual

const version of RotateTo

Parameters
surfaceName
Returns
a const Surface with the given Name from *this.

Definition at line 75 of file Molecule.cpp.

76{
77 BIO_SANITIZE_WITH_CACHE(GetByName< Surface* >(
78 surfaceName
79 ),
80 return *Cast< const Surface** >(RESULT),
81 return NULL);
82}

References BIO_SANITIZE_WITH_CACHE.

◆ RotateTo() [3/6]

template<typename T >
T bio::molecular::Molecule::RotateTo ( Name  surfaceName) const
inline

Ease of use methods for getting variables as the desired type.

Template Parameters
T
Returns
a Surface from *this casted to T.

Definition at line 242 of file Molecule.h.

243 {
244 return ChemicalCast< T >(RotateTo(surfaceName));
245 }

References RotateTo().

◆ RotateTo() [4/6]

Surface * bio::molecular::Molecule::RotateTo ( StandardDimension  surfaceId)
virtual

Get a variable from within *this. Use for getting and/or setting. REMINDER: use this->GetIdFromName("someName") to get the Id of a Surface with the given Name.

Parameters
surfaceId
Returns
a Surface with the given Id, as defined by *this, or NULL.

Definition at line 48 of file Molecule.cpp.

49{
50 BIO_SANITIZE_WITH_CACHE(GetById< Surface* >(
51 surfaceId
52 ),
53 return *Cast< Surface** >(RESULT),
54 return NULL);
55}

References BIO_SANITIZE_WITH_CACHE.

Referenced by bio::genetic::FetchPlasmid::Activate(), bio::genetic::RegisterPlasmid::Activate(), Define(), DuplicateFrom(), bio::genetic::GenomeImplementation::FetchPlasmid(), operator()(), RotateTo(), bio::genetic::Plasmid::TranscribeFor(), TransferFrom(), and Use().

◆ RotateTo() [5/6]

const Surface * bio::molecular::Molecule::RotateTo ( StandardDimension  surfaceId) const
virtual

const version of RotateTo

Parameters
surfaceId
Returns
a const Surface with the given Id, as defined by *this, or NULL.

Definition at line 57 of file Molecule.cpp.

58{
59 BIO_SANITIZE_WITH_CACHE(GetById< Surface* >(
60 surfaceId
61 ),
62 return *Cast< const Surface** >(RESULT),
63 return NULL);
64}

References BIO_SANITIZE_WITH_CACHE.

◆ RotateTo() [6/6]

template<typename T >
T bio::molecular::Molecule::RotateTo ( StandardDimension  surfaceId) const
inline

Ease of use methods for getting variables as the desired type.

Template Parameters
T
Returns
a Surface from *this casted to T.

Definition at line 216 of file Molecule.h.

217 {
218 return ChemicalCast< T >(RotateTo(surfaceId));
219 }

References RotateTo().

◆ Spin()

physical::Symmetry * bio::molecular::Molecule::Spin ( ) const
virtual

Required method from Wave. See that class for details.

Returns
a Symmetrical image of *this

Reimplemented from bio::chemical::Atom.

Definition at line 180 of file Molecule.cpp.

181{
182 //TODO...
183 return NULL;
184}

◆ TransferFrom()

bool bio::molecular::Molecule::TransferFrom ( Molecule source,
Name  surface 
)
virtual

Move a Surface from another Molecule into *this.

Parameters
source
surface
Returns
whether or not the operation succeeded.

Definition at line 105 of file Molecule.cpp.

109{
110 BIO_SANITIZE(source, ,
111 return false);
112
113 BIO_SANITIZE(!RotateTo(surface), ,
114 return false);
115
116 Surface* toTransfer = NULL;
117
118 BIO_SANITIZE_WITH_CACHE(source->RotateTo(surface),
119 toTransfer = RESULT,
120 return false);
121
122 Add< Surface* >(toTransfer)->SetEnvironment(this);
123 source->Remove< Surface* >(toTransfer);
124 return true;
125}

References BIO_SANITIZE, BIO_SANITIZE_WITH_CACHE, bio::chemical::UnorderedStructureInterface::Remove(), and RotateTo().

◆ Use()

template<typename T >
StandardDimension bio::molecular::Molecule::Use ( Name  varName,
T *  varPtr 
)
inline

Create a Surface from an existing (member) variable. Will fail if varName already exists within *this.

Template Parameters
T
Parameters
varName
varPtr
Returns
the Id of the Surface created or InvalidId().

Definition at line 112 of file Molecule.h.

116 {
117 BIO_SANITIZE(!RotateTo(varName), ,
118 return InvalidId());
119 Surface* toAdd = new Surface(
120 varName,
121 this
122 );
123 toAdd->Use(varPtr);
124 Add< Surface* >(toAdd);
125 return toAdd->GetId();
126 }

References BIO_SANITIZE, bio::physical::Perspective< StandardDimension >::InvalidId(), RotateTo(), and bio::molecular::Surface::Use().

Member Data Documentation

◆ Molecule

bio::molecular::Molecule::Molecule

Definition at line 88 of file Molecule.h.


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