Develop Biology
The language of life
|
#include <PeriodicTable.h>
Public Member Functions | |
PeriodicTableImplementation () | |
virtual | ~PeriodicTableImplementation () |
virtual bool | AssociateType (AtomicNumber id, physical::Wave *type) |
virtual bool | DisassociateType (AtomicNumber id) |
template<typename T > | |
AtomicNumber | GetIdFromType () |
template<typename T > | |
AtomicNumber | GetIdFromType (const T t) |
template<typename T > | |
Name | GetNameFromType () const |
template<typename T > | |
Name | GetNameFromType (const T t) const |
template<typename T > | |
const Properties | GetPropertiesOf () const |
const Properties | GetPropertiesOf (AtomicNumber id) const |
const Properties | GetPropertiesOf (Name name) const |
virtual const physical::Wave * | GetTypeFromId (AtomicNumber id) const |
AtomicNumber | RecordPropertiesOf (AtomicNumber id, Properties properties) |
AtomicNumber | RecordPropertiesOf (Name name, Properties properties) |
template<typename T > | |
AtomicNumber | RecordPropertiesOf (Properties properties) |
AtomicNumber | RecordPropertyOf (AtomicNumber id, Property property) |
AtomicNumber | RecordPropertyOf (Name name, Property property) |
template<typename T > | |
AtomicNumber | RecordPropertyOf (Property property) |
Public Member Functions inherited from bio::physical::Perspective< AtomicNumber > | |
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 Wave * | GetNewObjectFromId (Id id) const |
T | GetNewObjectFromIdAs (Id id) |
virtual Wave * | GetNewObjectFromName (Name name) |
T | GetNewObjectFromNameAs (Name name) |
virtual Id | GetNumUsedIds () const |
virtual const Wave * | GetTypeFromId (Id id) const |
const T | GetTypeFromIdAs (Id id) const |
virtual const Wave * | GetTypeFromName (Name name) const |
const T | GetTypeFromNameAs (Name name) const |
virtual Id | GetUniqueIdFor (Name name) |
Public Member Functions inherited from bio::ThreadSafe | |
ThreadSafe () | |
ThreadSafe (const ThreadSafe &toCopy) | |
virtual | ~ThreadSafe () |
void | LockThread () const |
void | UnlockThread () const |
Additional Inherited Members | |
Public Types inherited from bio::physical::Perspective< AtomicNumber > | |
typedef std::vector< Hadit > | Hadits |
typedef AtomicNumber | Id |
typedef std::vector< Id > | Ids |
Static Public Member Functions inherited from bio::physical::Perspective< AtomicNumber > | |
static Id | InvalidId () |
static Name | InvalidName () |
Protected Attributes inherited from bio::physical::Perspective< AtomicNumber > | |
Hadits | m_hadits |
Id | m_nextId |
The PeriodicTable is a stand-in for runtime type information (RTTI). Instead of having to rely on code compiled with RTTI enabled, we implement our own type tracking mechanism.
The PeriodicTable tracks Properties of types in addition to assigning them an AtomicNumber.. This is done because neither static nor virtual methods will allow for the inverted inheritance necessary to make inverted-inheritance methods like Atom::CallForAll work properly. See Elementary.h for a more detailed description of this system.
Definition at line 40 of file PeriodicTable.h.
bio::chemical::PeriodicTableImplementation::PeriodicTableImplementation | ( | ) |
Definition at line 55 of file PeriodicTable.cpp.
|
virtual |
Definition at line 60 of file PeriodicTable.cpp.
|
virtual |
Associates the given Wave type with the given id. This is only necessary if you want to use GetTypeFromId later on. Associating a type with an id has no effect on the Recorded Properties.
id | |
type |
Definition at line 146 of file PeriodicTable.cpp.
References BIO_SANITIZE, bio::ThreadSafe::LockThread(), bio::chemical::Element::m_type, and bio::ThreadSafe::UnlockThread().
|
virtual |
Removes the type association created by AssociateType(). Disassociating a type has no effect on the Recorded Properties.
id |
Definition at line 160 of file PeriodicTable.cpp.
References BIO_SANITIZE, bio::ThreadSafe::LockThread(), bio::chemical::Element::m_type, and bio::ThreadSafe::UnlockThread().
|
inline |
T |
Definition at line 81 of file PeriodicTable.h.
References bio::physical::Perspective< AtomicNumber >::GetIdFromName().
|
inline |
For auto template determination.
T |
t |
Definition at line 93 of file PeriodicTable.h.
|
inline |
T |
Definition at line 59 of file PeriodicTable.h.
|
inline |
For auto template determination.
T |
t |
Definition at line 71 of file PeriodicTable.h.
|
inline |
T |
Definition at line 115 of file PeriodicTable.h.
References GetPropertiesOf().
Referenced by GetPropertiesOf().
const Properties bio::chemical::PeriodicTableImplementation::GetPropertiesOf | ( | AtomicNumber | id | ) | const |
id |
Definition at line 65 of file PeriodicTable.cpp.
References BIO_SANITIZE, bio::chemical::UnorderedStructureInterface::GetAllAsVector(), bio::ThreadSafe::LockThread(), bio::Properties, and bio::ThreadSafe::UnlockThread().
const Properties bio::chemical::PeriodicTableImplementation::GetPropertiesOf | ( | Name | name | ) | const |
name |
Definition at line 77 of file PeriodicTable.cpp.
References bio::physical::Perspective< AtomicNumber >::GetIdWithoutCreation(), and GetPropertiesOf().
|
virtual |
Only works if AssociateType has been called with the given id.
id |
Definition at line 138 of file PeriodicTable.cpp.
References BIO_SANITIZE, and bio::chemical::Element::m_type.
AtomicNumber bio::chemical::PeriodicTableImplementation::RecordPropertiesOf | ( | AtomicNumber | id, |
Properties | properties | ||
) |
Add Properties to the given type's record in *this.
id | |
properties |
Definition at line 106 of file PeriodicTable.cpp.
References bio::physical::Class< T >::AsWave(), BIO_SANITIZE_AT_SAFETY_LEVEL_2, bio::physical::Perspective< AtomicNumber >::Find(), bio::chemical::UnorderedStructureInterface::Import(), bio::physical::Perspective< AtomicNumber >::InvalidId(), bio::ThreadSafe::LockThread(), bio::physical::Perspective< AtomicNumber >::m_hadits, and bio::ThreadSafe::UnlockThread().
Referenced by RecordPropertiesOf(), and RecordPropertyOf().
AtomicNumber bio::chemical::PeriodicTableImplementation::RecordPropertiesOf | ( | Name | name, |
Properties | properties | ||
) |
Add Properties to the given type's record in *this.
name | |
properties |
Definition at line 127 of file PeriodicTable.cpp.
References bio::physical::Perspective< AtomicNumber >::GetIdFromName(), and RecordPropertiesOf().
|
inline |
Add Properties to the given type's record in *this.
T |
properties |
Definition at line 186 of file PeriodicTable.h.
References RecordPropertiesOf().
AtomicNumber bio::chemical::PeriodicTableImplementation::RecordPropertyOf | ( | AtomicNumber | id, |
Property | property | ||
) |
Add a Property to the given type's record in *this.
id | |
property |
Definition at line 82 of file PeriodicTable.cpp.
References bio::Properties, and RecordPropertiesOf().
Referenced by RecordPropertyOf().
AtomicNumber bio::chemical::PeriodicTableImplementation::RecordPropertyOf | ( | Name | name, |
Property | property | ||
) |
Add a Property to the given type's record in *this.
name | |
property |
Definition at line 95 of file PeriodicTable.cpp.
References bio::physical::Perspective< AtomicNumber >::GetIdFromName(), and RecordPropertyOf().
|
inline |
Add a Property to the given type's record in *this.
T |
property |
Definition at line 149 of file PeriodicTable.h.
References RecordPropertyOf().