Develop Biology
The language of life
bio::physical::Identifiable< DIMENSION > Class Template Reference

#include <Identifiable.h>

+ Inheritance diagram for bio::physical::Identifiable< DIMENSION >:
+ Collaboration diagram for bio::physical::Identifiable< DIMENSION >:

Public Types

typedef DIMENSION Id
 
typedef std::vector< IdIds
 
- 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 PerspectiveGetPerspective () 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 WaveAsWave ()
 
virtual const WaveAsWave () const
 
virtual WaveClone () 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::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 Attributes

Id m_id
 

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)
 
- Protected Member Functions inherited from bio::physical::Observer< Perspective< DIMENSION > >
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 Attributes inherited from bio::VirtualBase
bool m_hasBeenInitialized
 
- Protected Attributes inherited from bio::physical::Class< Identifiable< DIMENSION > >
Identifiable< DIMENSION > * m_object
 
- Protected Attributes inherited from bio::physical::Wave
Wavem_signal
 
Symmetrym_symmetry
 

Detailed Description

template<typename DIMENSION>
class bio::physical::Identifiable< DIMENSION >

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.

Member Typedef Documentation

◆ Id

template<typename DIMENSION >
typedef DIMENSION bio::physical::Identifiable< DIMENSION >::Id

Definition at line 55 of file Identifiable.h.

◆ Ids

template<typename DIMENSION >
typedef std::vector< Id > bio::physical::Identifiable< DIMENSION >::Ids

Definition at line 56 of file Identifiable.h.

Member Function Documentation

◆ BIO_DISAMBIGUATE_ALL_CLASS_METHODS()

template<typename DIMENSION >
bio::physical::Identifiable< DIMENSION >::BIO_DISAMBIGUATE_ALL_CLASS_METHODS ( physical  ,
Identifiable< DIMENSION >   
)

Ensure virtual methods point to Class implementations.

Parameters
perspective

References bio::physical::Identifiable< DIMENSION >::CloneIntoName(), and bio::VirtualBase::Initialize().

◆ CloneIntoName()

template<typename DIMENSION >
void bio::physical::Identifiable< DIMENSION >::CloneIntoName ( Name  name)
inline

Definition at line 413 of file Identifiable.h.

414 {
415 #if BIO_MEMORY_OPTIMIZE_LEVEL == 0
416 if (m_name)
417 {
418 delete[] m_name;
419 }
421 name,
422 m_name
423 );
424 #endif
425 }
void CloneInto(const char *source, const char *&target)
Definition: String.cpp:236

References bio::string::CloneInto().

Referenced by bio::physical::Identifiable< DIMENSION >::BIO_DISAMBIGUATE_ALL_CLASS_METHODS().

Member Data Documentation

◆ m_id

template<typename DIMENSION >
Id bio::physical::Identifiable< DIMENSION >::m_id

Definition at line 411 of file Identifiable.h.


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