Develop Biology
The language of life
bio::physical::Axis Class Reference

#include <Axis.h>

+ Inheritance diagram for bio::physical::Axis:

Public Member Functions

 Axis ()
 
virtual ~Axis ()
 
virtual Symmetryoperator() (std::string encoded) const
 
virtual std::string operator| (Wave *particle) const
 
virtual SymmetryRotate (std::string) const
 
virtual std::string Rotate (Symmetry *symmetry) const
 

Static Public Member Functions

static std::string Failed ()
 

Protected Member Functions

virtual std::string Encode (Symmetry *symmetry) const
 

Detailed Description

Definition at line 33 of file Axis.h.

Constructor & Destructor Documentation

◆ Axis()

bio::physical::Axis::Axis ( )

Definition at line 29 of file Axis.cpp.

30{
31
32}

◆ ~Axis()

bio::physical::Axis::~Axis ( )
virtual

Reimplemented in bio::chemical::Axis.

Definition at line 34 of file Axis.cpp.

35{
36
37}

Member Function Documentation

◆ Encode()

std::string bio::physical::Axis::Encode ( Symmetry symmetry) const
protectedvirtual

Encode a single Symmetry Override this to add handlers (e.g. a switch(symmetry->GetId()) for your own SymmetryTypes, then call the parent method to handle other SymmetryTypes. Decoding is not so easy and requires overloading Rotate(std::string) directly (if we know which parts of the string are which Symmetries, then there would be no need to decode at the Axis level).

Parameters
symmetry
Returns
the text corresponding to the given, singular Symmetry or Failed().

Definition at line 66 of file Axis.cpp.

67{
68 return Failed();
69}
static std::string Failed()
Definition: Axis.cpp:39

References Failed().

Referenced by bio::chemical::Axis::Rotate(), and Rotate().

◆ Failed()

std::string bio::physical::Axis::Failed ( )
static

Used as a bad return value by other methods.

Returns
"FAILED"

Definition at line 39 of file Axis.cpp.

40{
41 return "FAILED";
42}

Referenced by Encode(), and operator|().

◆ operator()()

Symmetry * bio::physical::Axis::operator() ( std::string  encoded) const
virtual

(*myWave) | jsonAxis("...");

Parameters
encoded
Returns
Rotate(encoded) or NULL.

Definition at line 61 of file Axis.cpp.

62{
63 return Rotate(encoded);
64}
virtual std::string Rotate(Symmetry *symmetry) const
Definition: Axis.cpp:44

References Rotate().

◆ operator|()

std::string bio::physical::Axis::operator| ( Wave particle) const
virtual

jsonAxis | myWave

Parameters
particle
Returns
Rotate(particle->Spin()) or Failed().

Definition at line 54 of file Axis.cpp.

55{
56 BIO_SANITIZE(particle, ,
57 return Failed());
58 return Rotate(particle->Spin());
59}
#define BIO_SANITIZE(test, success, failure)

References BIO_SANITIZE, Failed(), Rotate(), and bio::physical::Wave::Spin().

◆ Rotate() [1/2]

Symmetry * bio::physical::Axis::Rotate ( std::string  ) const
virtual

Express the given text into something intelligible by this system.

Returns
Symmetry* which can be Reified or NULL.

Definition at line 49 of file Axis.cpp.

50{
51 return NULL;
52}

◆ Rotate() [2/2]

std::string bio::physical::Axis::Rotate ( Symmetry symmetry) const
virtual

Express the given Symmetry into something intelligible by another system.

Parameters
symmetry
Returns
text, possibly a command (like mysql), structured values (like json), an entire program (like python), etc. or Failed().

Definition at line 44 of file Axis.cpp.

45{
46 return Encode(symmetry);
47}
virtual std::string Encode(Symmetry *symmetry) const
Definition: Axis.cpp:66

References Encode().

Referenced by operator()(), and operator|().


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