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

#include <Class.h>

Inherits bio::physical::Wave.

Inherited by bio::chemical::Class< LinearMotif< Organelle * > >, bio::chemical::Class< UnorderedMotif< Organelle * > >, bio::chemical::Class< LinearMotif< genetic::Plasmid * > >, bio::chemical::Class< UnorderedMotif< genetic::Plasmid * > >, bio::chemical::Class< LinearMotif< Tissue * > >, bio::chemical::Class< UnorderedMotif< Tissue * > >, bio::chemical::Class< LinearMotif< Organ * > >, bio::chemical::Class< UnorderedMotif< Organ * > >, bio::chemical::Class< LinearMotif< Cell * > >, bio::chemical::Class< UnorderedMotif< Cell * > >, bio::chemical::Class< LinearMotif< CONTENT_TYPE > >, bio::chemical::Class< Reactant >, bio::chemical::Class< Reactants >, bio::chemical::Class< LinearMotif< Substance * > >, bio::chemical::Class< UnorderedMotif< Substance * > >, bio::chemical::Class< Reaction >, bio::chemical::Class< Substance >, bio::chemical::Class< UnorderedMotif< Property > >, bio::chemical::Class< UnorderedMotif< State > >, bio::chemical::Class< LinearMotif< Symmetry * > >, bio::chemical::Class< UnorderedMotif< Symmetry * > >, bio::chemical::Class< Symmetry >, bio::chemical::Class< UnorderedMotif< CONTENT_TYPE > >, bio::chemical::Class< UnorderedMotif< TranscriptionFactor > >, bio::chemical::Class< LinearMotif< Plasmid * > >, bio::chemical::Class< UnorderedMotif< Plasmid * > >, bio::chemical::Class< LinearMotif< molecular::Protein * > >, bio::chemical::Class< UnorderedMotif< molecular::Protein * > >, bio::chemical::Class< LinearMotif< Gene * > >, bio::chemical::Class< UnorderedMotif< Gene * > >, bio::chemical::Class< LinearMotif< Surface * > >, bio::chemical::Class< UnorderedMotif< Surface * > >, bio::chemical::Class< Pathway >, bio::chemical::Class< LinearMotif< chemical::Reaction * > >, bio::chemical::Class< UnorderedMotif< chemical::Reaction * > >, bio::chemical::Class< LinearMotif< Protein * > >, bio::chemical::Class< UnorderedMotif< Protein * > >, bio::chemical::Class< LinearMotif< Molecule * > >, bio::chemical::Class< UnorderedMotif< Molecule * > >, bio::chemical::Class< LinearMotif< Organism * > >, bio::chemical::Class< UnorderedMotif< Organism * > >, bio::chemical::Class< LinearMotif< cellular::OrganSystem * > >, bio::chemical::Class< UnorderedMotif< cellular::OrganSystem * > >, bio::chemical::Class< T >, and bio::physical::Symmetry [private].

+ Collaboration diagram for bio::physical::Class< T >:

Public Member Functions

 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
 

Protected Attributes

T * m_object
 
- Protected Attributes inherited from bio::physical::Wave
Wavem_signal
 
Symmetrym_symmetry
 

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)
 

Detailed Description

template<typename T>
class bio::physical::Class< T >

A physical::Class is a Wave. That is all. Class in other namespaces will grow to include more complex, templated logic. This pattern prevents you from having to define virtual methods each of your child classes, so long as you always derive from the appropriate Class<T>.

Template Parameters
T

Definition at line 37 of file Class.h.

Constructor & Destructor Documentation

◆ Class()

template<typename T >
bio::physical::Class< T >::Class ( T *  object,
Symmetry symmetry = NULL 
)
inline

NOTE: you may wish to explicitly instantiate Wave in you ctor.

Parameters
object
symmetry

Definition at line 46 of file Class.h.

50 :
51 Wave(symmetry),
52 m_object(object)
53 {
54
55 }
Wave(Symmetry *symmetry=NULL)
Definition: Wave.cpp:32

◆ ~Class()

template<typename T >
virtual bio::physical::Class< T >::~Class ( )
inlinevirtual

Definition at line 60 of file Class.h.

61 {
62
63 }

Member Function Documentation

◆ AsWave() [1/2]

template<typename T >
virtual Wave * bio::physical::Class< T >::AsWave ( )
inlinevirtual

Used for resolving ambiguous inheritance without the need to explicitly derive from Wave.

Returns
this

Reimplemented from bio::physical::Wave.

Definition at line 99 of file Class.h.

100 {
101 return this;
102 }

Referenced by bio::genetic::RegisterPlasmid::Activate(), bio::chemical::LinearMotif< CONTENT_TYPE >::ForEachImplementation(), bio::chemical::PeriodicTableImplementation::RecordPropertiesOf(), bio::genetic::Insertion::Seek(), and bio::genetic::Localization::Seek().

◆ AsWave() [2/2]

template<typename T >
virtual const Wave * bio::physical::Class< T >::AsWave ( ) const
inlinevirtual

Used for resolving ambiguous inheritance without the need to explicitly derive from Wave.

Returns
this

Reimplemented from bio::physical::Wave.

Definition at line 108 of file Class.h.

109 {
110 return this;
111 }

◆ Clone()

template<typename T >
virtual Wave * bio::physical::Class< T >::Clone ( ) const
inlinevirtual

Template override for Clone so we don't have to define it everywhere.

Returns
a new T (and a new *this).

Reimplemented from bio::physical::Wave.

Definition at line 89 of file Class.h.

90 {
91 T* ret = new T(*m_object);
92 return Cast< Class< T >* >(ret); //2-step cast: 1st explicitly cast to *this; 2nd implicitly cast to Wave.
93 }

References bio::physical::Class< T >::m_object.

Referenced by bio::genetic::Plasmid::TranscribeFor().

◆ Convert()

template<typename T >
T * bio::physical::Class< T >::Convert ( Wave wave)
inline

If you have a Class object and need to convert from Wave to the furthest derived Class, use Convert.

Parameters
wave
Returns
the

Definition at line 79 of file Class.h.

80 {
81 return Cast< T* >(wave);
82 }

◆ operator T*()

template<typename T >
virtual bio::physical::Class< T >::operator T* ( )
inlinevirtual

Make it so we can treat *this as the calling T.

Returns
the m_object *this was created for.

Definition at line 69 of file Class.h.

70 {
71 return m_object;
72 }

◆ operator Wave *()

template<typename T >
virtual bio::physical::Class< T >::operator Wave * ( )
inlinevirtual

Wave conversion. When treating an object as a Wave*, always use the nearest Class, as that will allow you to access all other Waves in the object.

Returns
this.

Definition at line 118 of file Class.h.

119 {
120 return this;
121 }

Member Data Documentation

◆ m_object

template<typename T >
T* bio::physical::Class< T >::m_object
protected

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