libbio
Loading...
Searching...
No Matches
Classes | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
bio::Metallic< T > Class Template Reference

#include <Metallic.h>

Inheritance diagram for bio::Metallic< T >:
Inheritance graph
[legend]
Collaboration diagram for bio::Metallic< T >:
Collaboration graph
[legend]

Classes

struct  BondIdentity
 
struct  BreakDonatedCollect
 
struct  DonateCollect
 

Public Member Functions

 Metallic ()
 
 Metallic (const Metallic &other)
 
virtual ~Metallic ()
 
Metallicoperator= (const Metallic &other)
 
Pointer< TObject ()
 
Pointer< const TObject () const
 
- 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)
 
virtual Code Attenuate (Pointer< const physical::Wave > other)
 
virtual Code Disattenuate (Pointer< const physical::Wave > other)
 
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 ~Class ()
 
virtual Pointer< Atom > GetWaveObject ()
 
virtual Pointer< const Atom > GetWaveObject () const
 
virtual operator Atom & ()
 
virtual operator const Atom & () const
 
virtual Pointer< WaveClone () 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 ()
 
virtual Properties GetProperties () const
 
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)
 
virtual Pointer< WaveDemodulate ()
 
virtual Pointer< const WaveDemodulate () const
 
Pointer< WaveAsWave ()
 
Pointer< const WaveAsWave () const
 
virtual Pointer< chemical::AtomAsAtom ()
 
virtual Pointer< const chemical::AtomAsAtom () 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::ThreadSafe
 ThreadSafe ()
 
 ThreadSafe (const ThreadSafe &toCopy)
 
ThreadSafeoperator= (const ThreadSafe &toCopy)
 
 ~ThreadSafe ()
 
void LockThread () const
 
void UnlockThread () const
 
void LockMutexShared () const
 
void UnlockMutexShared () const
 

Static Public Member Functions

static void DonateCollectVisitor (const chemical::Bond &bond, void *ctx)
 
static void DonateBonds (Pointer< chemical::Atom > donor, Pointer< chemical::Atom > receiver)
 
static void BreakDonatedCollectVisitor (const chemical::Bond &bond, void *ctx)
 
static void BreakDonatedBonds (Pointer< chemical::Atom > receiver)
 
static BondType GetBondType ()
 
- 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::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)
 

Protected Attributes

Pointer< TmT
 
- 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
 
- Protected Attributes inherited from bio::physical::Wave
LazyPointer< SymmetrymSymmetry
 
bool mHasSignal
 
uint16_t mTypeId
 

Additional Inherited Members

- 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 Member Functions inherited from bio::chemical::Atom
void IndexBond (AtomicNumber bondedId, Valence position)
 
void UnindexBond (AtomicNumber bondedId)
 

Detailed Description

template<class T>
class bio::Metallic< T >

Metallic bonds create a "horizontal inheritance" similar to Covalent bonds.
With Metallic bonds, all Bonds are shared between the Bonding objects.
This solves the problem of Bonding a child class but trying to use As< ParentClass >().
However, this introduces the limitation of not being able to Bond more than one object of the same type.
If both of the objects being Bonded have already Bonded to an object of the same type, the behavior is undefined (ideally neither class is affected & the result of As< SharedClass >() depends on which object you start with.
When instantiating a Metallic class, a new T will be created and Metallicly bonded to the child class of *this (through the shared Atom).
Each Metallic Bond has a distinct Type based on the template it is constructed with. This type helps to identify which Bonds have been shared.
You may get the BondType *this uses with GetBondType().
IMPORTANT NOTE: Metallic Bonds are only updated when a new Metallic Bond is created.
NOTE: atm, there is no way to provide arguments to the new Ts.
See Atom.h for more on Bonds.

Template Parameters
T

Constructor & Destructor Documentation

◆ Metallic() [1/2]

template<class T >
bio::Metallic< T >::Metallic ( )
inline

◆ Metallic() [2/2]

template<class T >
bio::Metallic< T >::Metallic ( const Metallic< T > &  other)
inline

Deep-copy constructor to avoid shared ownership across copies.

◆ ~Metallic()

template<class T >
virtual bio::Metallic< T >::~Metallic ( )
inlinevirtual

Member Function Documentation

◆ BreakDonatedBonds()

template<class T >
static void bio::Metallic< T >::BreakDonatedBonds ( Pointer< chemical::Atom receiver)
inlinestatic

Break all Bonds in receiver that were donated by donor.

Parameters
receiver

◆ BreakDonatedCollectVisitor()

template<class T >
static void bio::Metallic< T >::BreakDonatedCollectVisitor ( const chemical::Bond bond,
void ctx 
)
inlinestatic

◆ DonateBonds()

template<class T >
static void bio::Metallic< T >::DonateBonds ( Pointer< chemical::Atom donor,
Pointer< chemical::Atom receiver 
)
inlinestatic

Pass all Bonds in donor to the receiver.
The BondType used will be that of GetBondType().

Parameters
donor
receiver

◆ DonateCollectVisitor()

template<class T >
static void bio::Metallic< T >::DonateCollectVisitor ( const chemical::Bond bond,
void ctx 
)
inlinestatic

◆ GetBondType()

template<class T >
static BondType bio::Metallic< T >::GetBondType ( )
inlinestatic
Returns
the unique BondType used by *this.

◆ Object() [1/2]

template<class T >
Pointer< T > bio::Metallic< T >::Object ( )
inline
Returns
what *this was created for.

◆ Object() [2/2]

template<class T >
Pointer< const T > bio::Metallic< T >::Object ( ) const
inline
Returns
what *this was created for.

◆ operator=()

template<class T >
Metallic & bio::Metallic< T >::operator= ( const Metallic< T > &  other)
inline

Deep-copy assignment to avoid shared ownership across copies.

Member Data Documentation

◆ mT

template<class T >
Pointer< T > bio::Metallic< T >::mT
protected

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