Develop Biology
The language of life
bio::chemical::LinearStructureInterface Class Reference

#include <LinearStructureInterface.h>

+ Inheritance diagram for bio::chemical::LinearStructureInterface:
+ Collaboration diagram for bio::chemical::LinearStructureInterface:

Public Member Functions

 LinearStructureInterface ()
 
virtual ~LinearStructureInterface ()
 
template<typename T >
Emission ForEach (ExcitationBase *excitation)
 
template<typename T >
GetById (StandardDimension id)
 
template<typename T >
const T GetById (StandardDimension id) const
 
template<typename T >
GetByName (Name name)
 
template<typename T >
const T GetByName (Name name) const
 
template<typename T >
GetOrCreateById (StandardDimension id)
 
template<typename T >
GetOrCreateByName (Name name)
 
template<typename T >
Code Insert (T toAdd, const Position position=BOTTOM, const StandardDimension optionalPositionArg=0, const bool transferSubContents=false)
 
- Public Member Functions inherited from bio::ThreadSafe
 ThreadSafe ()
 
 ThreadSafe (const ThreadSafe &toCopy)
 
virtual ~ThreadSafe ()
 
void LockThread () const
 
void UnlockThread () const
 
- Public Member Functions inherited from bio::chemical::Atom
 Atom (const Atom &other)
 
virtual ~Atom ()
 
template<typename T >
As ()
 
template<typename T >
const T As () const
 
template<typename T >
AsBonded ()
 
template<typename T >
const T AsBonded () const
 
template<typename T >
AsBondedQuantum ()
 
template<typename T >
const T AsBondedQuantum () const
 
virtual Code Attenuate (const Wave *other)
 
 BIO_DISAMBIGUATE_ALL_CLASS_METHODS (physical, Atom) explicit Atom()
 
template<typename T >
bool BreakBond (T toDisassociate, BondType type=bond_type::Unknown())
 
virtual Code Disattenuate (const Wave *other)
 
template<typename T >
bool FormBond (T toBond, BondType type=bond_type::Unknown())
 
BondsGetAllBonds ()
 
const BondsGetAllBonds () const
 
WaveGetBonded (Valence position)
 
const WaveGetBonded (Valence position) const
 
template<typename T >
Valence GetBondPosition () const
 
Valence GetBondPosition (AtomicNumber bondedId) const
 
Valence GetBondPosition (Name typeName) const
 
template<typename T >
BondType GetBondType () const
 
BondType GetBondType (Valence position) const
 
template<typename T >
 operator T ()
 
virtual Code Reify (physical::Symmetry *symmetry)
 
virtual physical::SymmetrySpin () const
 
- Public Member Functions inherited from bio::physical::Class< Atom >
 Class (Atom *object, Symmetry *symmetry=NULL)
 
virtual ~Class ()
 
virtual WaveAsWave ()
 
virtual const WaveAsWave () const
 
virtual WaveClone () const
 
Atom * Convert (Wave *wave)
 
virtual operator Atom * ()
 
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
 

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::chemical::Atom
virtual bool BreakBondImplementation (Wave *toDisassociate, AtomicNumber id, BondType type)
 
virtual bool FormBondImplementation (Wave *toBond, AtomicNumber id, BondType type)
 
- Protected Attributes inherited from bio::chemical::Atom
Bonds m_bonds
 
- Protected Attributes inherited from bio::physical::Class< Atom >
Atom * m_object
 
- Protected Attributes inherited from bio::physical::Wave
Wavem_signal
 
Symmetrym_symmetry
 

Detailed Description

Interface methods for all LinearMotif classes.

Definition at line 34 of file LinearStructureInterface.h.

Constructor & Destructor Documentation

◆ LinearStructureInterface()

bio::chemical::LinearStructureInterface::LinearStructureInterface ( )
inline

Definition at line 42 of file LinearStructureInterface.h.

43 {
44 }

◆ ~LinearStructureInterface()

virtual bio::chemical::LinearStructureInterface::~LinearStructureInterface ( )
inlinevirtual

Definition at line 49 of file LinearStructureInterface.h.

50 {
51 }

Member Function Documentation

◆ ForEach()

template<typename T >
Emission bio::chemical::LinearStructureInterface::ForEach ( ExcitationBase excitation)
inline

Performs the given Reaction on all contents.

Parameters
excitation

Definition at line 236 of file LinearStructureInterface.h.

239 {
240 Emission ret;
241 LockThread();
242 LinearMotif< T >* implementer = this->AsBonded< LinearMotif< T >* >();
243 if (implementer)
244 {
245 ret = implementer->ForEachImplementation(excitation);
246 }
247 UnlockThread();
248 return ret;
249 }
void LockThread() const
Definition: ThreadSafe.cpp:84
void UnlockThread() const
Definition: ThreadSafe.cpp:97

References bio::chemical::LinearMotif< CONTENT_TYPE >::ForEachImplementation(), bio::ThreadSafe::LockThread(), and bio::ThreadSafe::UnlockThread().

◆ GetById() [1/2]

template<typename T >
T bio::chemical::LinearStructureInterface::GetById ( StandardDimension  id)
inline

Gets a T* by its id.

Template Parameters
T
Parameters
id
Returns
a T of the given id or NULL; NULL if T is invalid.

Definition at line 93 of file LinearStructureInterface.h.

94 {
95 T ret = NULL;
96 LockThread();
97 LinearMotif< T >* implementer = this->AsBonded< LinearMotif< T >* >();
98 if (implementer)
99 {
100 ret = implementer->GetByIdImplementation(
101 id
102 );
103 }
104 UnlockThread();
105 return ret;
106 }

References bio::chemical::LinearMotif< CONTENT_TYPE >::GetByIdImplementation(), bio::ThreadSafe::LockThread(), and bio::ThreadSafe::UnlockThread().

◆ GetById() [2/2]

template<typename T >
const T bio::chemical::LinearStructureInterface::GetById ( StandardDimension  id) const
inline

Gets a const T* by its id.

Template Parameters
T
Parameters
id
Returns
a T of the given id or NULL; NULL if T is invalid.

Definition at line 115 of file LinearStructureInterface.h.

118 {
119 T ret = NULL;
120 LockThread();
121 LinearMotif< T >* implementer = this->AsBonded< LinearMotif< T >* >();
122 if (implementer)
123 {
124 ret = implementer->GetByIdImplementation(
125 id
126 );
127 }
128 UnlockThread();
129 return ret;
130 }

References bio::chemical::LinearMotif< CONTENT_TYPE >::GetByIdImplementation(), bio::ThreadSafe::LockThread(), and bio::ThreadSafe::UnlockThread().

◆ GetByName() [1/2]

template<typename T >
T bio::chemical::LinearStructureInterface::GetByName ( Name  name)
inline

Gets a T* by its name.

Template Parameters
T
Parameters
name
Returns
a T of the given id or NULL; NULL if T is invalid.

Definition at line 139 of file LinearStructureInterface.h.

142 {
143 T ret = NULL;
144 LockThread();
145 LinearMotif< T >* implementer = this->AsBonded< LinearMotif< T >* >();
146 if (implementer)
147 {
148 ret = implementer->GetByNameImplementation(
149 name
150 );
151 }
152 UnlockThread();
153 return ret;
154 }

References bio::chemical::LinearMotif< CONTENT_TYPE >::GetByNameImplementation(), bio::ThreadSafe::LockThread(), and bio::ThreadSafe::UnlockThread().

◆ GetByName() [2/2]

template<typename T >
const T bio::chemical::LinearStructureInterface::GetByName ( Name  name) const
inline

Gets a const T* by its name.

Template Parameters
T
Parameters
name
Returns
a T of the given id or NULL; NULL if T is invalid.

Definition at line 163 of file LinearStructureInterface.h.

166 {
167 T ret = NULL;
168 LockThread();
169 LinearMotif< T >* implementer = this->AsBonded< LinearMotif< T >* >();
170 if (implementer)
171 {
172 ret = implementer->GetByNameImplementation(
173 name
174 );
175 }
176 UnlockThread();
177 return ret;
178 }

References bio::chemical::LinearMotif< CONTENT_TYPE >::GetByNameImplementation(), bio::ThreadSafe::LockThread(), and bio::ThreadSafe::UnlockThread().

◆ GetOrCreateById()

template<typename T >
T bio::chemical::LinearStructureInterface::GetOrCreateById ( StandardDimension  id)
inline

Tries to find a Content of the given id in *this and, optionally, the Contents beneath. If such an object doesn't exist, one is created from its Wave.

Template Parameters
T
Parameters
id
Returns
A T* of the given id; NULL if T is invalid.

Definition at line 188 of file LinearStructureInterface.h.

191 {
192 T ret = NULL;
193 LockThread();
194 LinearMotif< T >* implementer = this->AsBonded< LinearMotif< T >* >();
195 if (implementer)
196 {
197 ret = implementer->GetOrCreateByIdImplementation(
198 id
199 );
200 }
201 UnlockThread();
202 return ret;
203 }

References bio::chemical::LinearMotif< CONTENT_TYPE >::GetOrCreateByIdImplementation(), bio::ThreadSafe::LockThread(), and bio::ThreadSafe::UnlockThread().

◆ GetOrCreateByName()

template<typename T >
T bio::chemical::LinearStructureInterface::GetOrCreateByName ( Name  name)
inline

Tries to find a Content of the given name in *this and, optionally, the Contents beneath. If such an object doesn't exist, one is created from its Wave.

Template Parameters
T
Parameters
name
Returns
A T* of the given id; NULL if T is invalid.

Definition at line 213 of file LinearStructureInterface.h.

216 {
217 T ret = NULL;
218 LockThread();
219 LinearMotif< T >* implementer = this->AsBonded< LinearMotif< T >* >();
220 if (implementer)
221 {
222 ret = implementer->GetOrCreateByNameImplementation(
223 name
224 );
225 }
226 UnlockThread();
227 return ret;
228 }

References bio::chemical::LinearMotif< CONTENT_TYPE >::GetOrCreateByNameImplementation(), bio::ThreadSafe::LockThread(), and bio::ThreadSafe::UnlockThread().

◆ Insert()

template<typename T >
Code bio::chemical::LinearStructureInterface::Insert ( toAdd,
const Position  position = BOTTOM,
const StandardDimension  optionalPositionArg = 0,
const bool  transferSubContents = false 
)
inline

Inserts toAdd into *this at then indicated position. Removes any conflicting Contents of the same Id as toAdd.

Template Parameters
Tthe type of Content
Parameters
toAddwhat to add.
positionwhere toAdd is inserted (e.g. the TOP or BOTTOM).
optionalPositionArgIf a position is specified, the optionalPositionArg is the id of the Content referenced (e.g. BEFORE, MyContentId()).
transferSubContentsallows all of the Contents within a Content that conflicts with toAdd to be copied into toAdd, before the conflicting Content is deleted (similar to renaming an upper directory while preserving it's contents).

Definition at line 63 of file LinearStructureInterface.h.

69 {
70 Code ret = code::GeneralFailure();
71 LockThread();
72 LinearMotif< T >* implementer = this->AsBonded< LinearMotif< T >* >();
73 if (implementer)
74 {
75 ret = implementer->InsertImplementation(
76 toAdd,
77 position,
78 optionalPositionArg,
79 transferSubContents
80 );
81 }
83 return ret;
84 }
Code GeneralFailure()

References bio::code::GeneralFailure(), bio::chemical::LinearMotif< CONTENT_TYPE >::InsertImplementation(), bio::ThreadSafe::LockThread(), and bio::ThreadSafe::UnlockThread().


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