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

#include <Quantum.h>

+ Inheritance diagram for bio::physical::Quantum< T >:
+ Collaboration diagram for bio::physical::Quantum< T >:

Public Member Functions

 Quantum (const Quantum< T > &other)
 
 Quantum (const T &assignment)
 
virtual ~Quantum ()
 
 BIO_DISAMBIGUATE_ALL_CLASS_METHODS (physical, Quantum< T >) Quantum()
 
 operator T () const
 
 operator T* ()
 
virtual Code Reify (Symmetry *symmetry)
 
virtual SymmetrySpin () const
 
- Public Member Functions inherited from bio::physical::Class< Quantum< T > >
 Class (Quantum< T > *object, Symmetry *symmetry=NULL)
 
virtual ~Class ()
 
virtual WaveAsWave ()
 
virtual const WaveAsWave () const
 
virtual WaveClone () const
 
Quantum< T > * Convert (Wave *wave)
 
virtual operator Quantum< 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_quantized
 
- Protected Attributes inherited from bio::physical::Class< Quantum< T > >
Quantum< 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::Quantum< T >

Quanta are simple Waves intended for built-in types. They allow anything to be treated as a Biological Wave. Iff you cannot derive from Wave, use Quantum<> instead. Each Quantum<T> will store a pointer to a T which it will new on creation and delete on destruction.

Template Parameters
T

Definition at line 41 of file Quantum.h.

Constructor & Destructor Documentation

◆ Quantum() [1/2]

template<typename T >
bio::physical::Quantum< T >::Quantum ( const T &  assignment)
inline
Parameters
assignment

Definition at line 70 of file Quantum.h.

71 :
72 physical::Class< Quantum< T > >(
73 this,
74 new Symmetry(
75 TypeName< T >().c_str(),
77 m_quantized(new T(assignment))
78 {
79 }
SymmetryType DefineVariable()

◆ Quantum() [2/2]

template<typename T >
bio::physical::Quantum< T >::Quantum ( const Quantum< T > &  other)
inline
Parameters
other

Definition at line 84 of file Quantum.h.

85 :
86 physical::Class< Quantum< T > >(
87 this,
88 new Symmetry(
89 TypeName< T >().c_str(),
91 m_quantized(new T(other))
92 {
93
94 }

◆ ~Quantum()

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

Definition at line 99 of file Quantum.h.

100 {
101 delete this->m_quantized;
102 }

References bio::physical::Quantum< T >::m_quantized.

Member Function Documentation

◆ BIO_DISAMBIGUATE_ALL_CLASS_METHODS()

template<typename T >
bio::physical::Quantum< T >::BIO_DISAMBIGUATE_ALL_CLASS_METHODS ( physical  ,
Quantum< T >   
)
inline

Ensure virtual methods point to Class implementations.

Definition at line 49 of file Quantum.h.

56 :
57 physical::Class< Quantum< T > >(
58 this,
59 new Symmetry(
60 TypeName< T >().c_str(),
62 m_quantized(new T())
63 {
64
65 }

◆ operator T()

template<typename T >
bio::physical::Quantum< T >::operator T ( ) const
inline

Read only access to the value of *this. For ease of use.

Returns
*this as a T.

Definition at line 118 of file Quantum.h.

119 {
121 return *this->m_quantized,
122 return T());
123 }
#define BIO_SANITIZE(test, success, failure)

References BIO_SANITIZE, and bio::physical::Quantum< T >::m_quantized.

◆ operator T*()

template<typename T >
bio::physical::Quantum< T >::operator T* ( )
inline

this can be treated as a T directly.

Returns
this as a T.

Definition at line 108 of file Quantum.h.

109 {
110 return this->m_quantized;
111 }

References bio::physical::Quantum< T >::m_quantized.

◆ Reify()

template<typename T >
virtual Code bio::physical::Quantum< T >::Reify ( Symmetry symmetry)
inlinevirtual

Required method from Wave. See that class for details. Reconstruct *this from the given Symmetry.

Parameters
symmetry

Reimplemented from bio::physical::Wave.

Definition at line 140 of file Quantum.h.

141 {
142 BIO_SANITIZE(symmetry, ,
143 return code::BadArgument1());
144 //Wave::Reify(symmetry); //this does nothing useful.
145 *this->m_quantized = symmetry->GetValue();
146 return code::Success();
147 }
Code BadArgument1()
Code Success()

References bio::code::BadArgument1(), BIO_SANITIZE, bio::physical::Symmetry::GetValue(), bio::physical::Quantum< T >::m_quantized, and bio::code::Success().

◆ Spin()

template<typename T >
virtual Symmetry * bio::physical::Quantum< T >::Spin ( ) const
inlinevirtual

Required method from Wave. See that class for details.

Returns
a Symmetrical image of *this

Reimplemented from bio::physical::Wave.

Definition at line 129 of file Quantum.h.

130 {
131 this->m_symmetry->AccessValue()->Set(*this->m_quantized);
132 return this->Wave::Spin();
133 }
void Set(T in)
Definition: ByteStream.h:147
virtual ByteStream * AccessValue()
Definition: Symmetry.cpp:130
virtual Symmetry * Spin() const
Definition: Wave.cpp:59
Symmetry * m_symmetry
Definition: Wave.h:272

References bio::physical::Symmetry::AccessValue(), bio::physical::Quantum< T >::m_quantized, bio::physical::Wave::m_symmetry, bio::ByteStream::Set(), and bio::physical::Wave::Spin().

Member Data Documentation

◆ m_quantized


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