Develop Biology
The language of life
|
#include <Identifiable.h>
Public Types | |
typedef DIMENSION | Id |
typedef std::vector< Id > | Ids |
Public Types inherited from bio::physical::Observer< Perspective< DIMENSION > > | |
typedef Perspective< DIMENSION > | Perspective |
Public Member Functions | |
BIO_DISAMBIGUATE_ALL_CLASS_METHODS (physical, Identifiable< DIMENSION >) explicit Identifiable(Perspective< DIMENSION > *perspective | |
void | CloneIntoName (Name name) |
Public Member Functions inherited from bio::physical::Observer< Perspective< DIMENSION > > | |
Observer (const Observer &other) | |
Observer (Perspective *perspective=NULL) | |
virtual | ~Observer () |
virtual Perspective * | GetPerspective () const |
virtual void | SetPerspective (Perspective *perspective) |
Public Member Functions inherited from bio::physical::Class< Identifiable< DIMENSION > > | |
Class (Identifiable< DIMENSION > *object, Symmetry *symmetry=NULL) | |
virtual | ~Class () |
virtual Wave * | AsWave () |
virtual const Wave * | AsWave () const |
virtual Wave * | Clone () const |
Identifiable< DIMENSION > * | Convert (Wave *wave) |
virtual | operator Identifiable< DIMENSION > * () |
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 |
Public Attributes | |
Id | m_id |
An Identifiable class has a name and a numeric identifier (Id). Names are used for debugging and human interaction, while Ids are used for run-time processing. Identifiable classes require a Perspective<DIMENSION> to maintain a mapping of Id <-> Name pairs. The Id exists within a DIMENSION, i.e. an int type (almost always unsigned), like uint32_t. For more on DIMENSIONs, see Perspective.h
The reason this class is templated is so that less numerous classes can use a smaller ID type, which decreases memory footprint and increases processing speed (less bits to check). Unfortunately, inheritance reveals a problem with this design: Identifiable classes cannot change their ID type. For example, if you have one class that you expect a small number of and then derive from that class, expecting a larger number of children, you either must derive from Identifiable twice, indulging in diamond inheritance, or increase the size of Id to encompass all possible uses. For this reason, the default DIMENSION (StandardDimension, from Types.h) should be used in nearly all cases, unless you want to ensure either your class is not derived from or that it remains separated from other code. An example of using a non-StandardDimension can be found in Codes. Codes have their own DIMENSION, as they should not be inherited from but may still be expanded upon through user-defined values (simply additional name <-> id definitions).
Definition at line 50 of file Identifiable.h.
typedef DIMENSION bio::physical::Identifiable< DIMENSION >::Id |
Definition at line 55 of file Identifiable.h.
typedef std::vector< Id > bio::physical::Identifiable< DIMENSION >::Ids |
Definition at line 56 of file Identifiable.h.
bio::physical::Identifiable< DIMENSION >::BIO_DISAMBIGUATE_ALL_CLASS_METHODS | ( | physical | , |
Identifiable< DIMENSION > | |||
) |
Ensure virtual methods point to Class implementations.
perspective |
References bio::physical::Identifiable< DIMENSION >::CloneIntoName(), and bio::VirtualBase::Initialize().
|
inline |
Definition at line 413 of file Identifiable.h.
References bio::string::CloneInto().
Referenced by bio::physical::Identifiable< DIMENSION >::BIO_DISAMBIGUATE_ALL_CLASS_METHODS().
Id bio::physical::Identifiable< DIMENSION >::m_id |
Definition at line 411 of file Identifiable.h.