Develop Biology
The language of life
bio::chemical::UnorderedMotif< CONTENT_TYPE > Class Template Reference

#include <UnorderedMotif.h>

+ Inheritance diagram for bio::chemical::UnorderedMotif< CONTENT_TYPE >:
+ Collaboration diagram for bio::chemical::UnorderedMotif< CONTENT_TYPE >:

Public Types

typedef physical::Arrangement< CONTENT_TYPE > Contents
 
- Public Types inherited from bio::physical::Identifiable< StandardDimension >
typedef StandardDimension Id
 
typedef std::vector< IdIds
 
- Public Types inherited from bio::physical::Observer< Perspective< StandardDimension > >
typedef Perspective< StandardDimension > Perspective
 

Public Member Functions

 UnorderedMotif (const Contents *contents)
 
 UnorderedMotif (const UnorderedMotif< CONTENT_TYPE > *toCopy)
 
virtual ~UnorderedMotif ()
 
virtual CONTENT_TYPE AddImplementation (const CONTENT_TYPE content)
 
 BIO_DISAMBIGUATE_ALL_CLASS_METHODS (chemical, UnorderedMotif< CONTENT_TYPE >) UnorderedMotif()
 
virtual void ClearImplementation ()
 
virtual unsigned long GetCountImplementation () const
 
virtual unsigned int GetNumMatchingImplementation (const Container *other) const
 
virtual std::string GetStringFromImplementation (std::string separator=", ")
 
virtual bool HasAllImplementation (const Container *contents) const
 
virtual bool HasImplementation (const CONTENT_TYPE content) const
 
virtual void ImportImplementation (const UnorderedMotif< CONTENT_TYPE > *other)
 
virtual CONTENT_TYPE RemoveImplementation (const CONTENT_TYPE content)
 
- Public Member Functions inherited from bio::chemical::Class< UnorderedMotif< CONTENT_TYPE > >
 BIO_DISAMBIGUATE_ALL_CLASS_METHODS (physical, UnorderedMotif< CONTENT_TYPE >) Class(UnorderedMotif< CONTENT_TYPE > *object
 
- Public Member Functions inherited from bio::physical::Class< T >
 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
 
- Public Member Functions inherited from bio::physical::Identifiable< StandardDimension >
 BIO_DISAMBIGUATE_ALL_CLASS_METHODS (physical, Identifiable< StandardDimension >) explicit Identifiable(Perspective< StandardDimension > *perspective
 
void CloneIntoName (Name name)
 
- Public Member Functions inherited from bio::physical::Observer< Perspective< StandardDimension > >
 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< StandardDimension > >
 Class (Identifiable< StandardDimension > *object, Symmetry *symmetry=NULL)
 
virtual ~Class ()
 
virtual WaveAsWave ()
 
virtual const WaveAsWave () const
 
virtual WaveClone () const
 
Identifiable< StandardDimension > * Convert (Wave *wave)
 
virtual operator Identifiable< StandardDimension > * ()
 
virtual operator Wave * ()
 
- Public Member Functions inherited from bio::log::Writer
 Writer (Engine *logEngine, Filter logFilter)
 
virtual ~Writer ()
 
 BIO_DISAMBIGUATE_ALL_CLASS_METHODS (physical, Writer) Writer()
 
void ExternalLog (Filter logFilter, Level level, const char *format,...) const
 
EngineGetLogEngine ()
 
const EngineGetLogEngine () const
 
bool HasLogEngine () const
 
virtual void SetLogEngine (Engine *logEngine)
 
- Public Member Functions inherited from bio::physical::Filterable
 Filterable (Filter filter)
 
virtual ~Filterable ()
 
 BIO_DISAMBIGUATE_ALL_CLASS_METHODS (physical, Filterable) Filterable()
 
Filter GetFilter () const
 
virtual void InitializeImplementation (ByteStreams args)
 
virtual Code Reify (Symmetry *symmetry)
 
virtual void SetFilter (Filter filter)
 
virtual SymmetrySpin () const
 
- Public Member Functions inherited from bio::physical::Class< Filterable >
 Class (Filterable *object, Symmetry *symmetry=NULL)
 
virtual ~Class ()
 
virtual WaveAsWave ()
 
virtual const WaveAsWave () const
 
virtual WaveClone () const
 
FilterableConvert (Wave *wave)
 
virtual operator Filterable * ()
 
virtual operator Wave * ()
 
- Public Member Functions inherited from bio::physical::Class< Writer >
 Class (Writer *object, Symmetry *symmetry=NULL)
 
virtual ~Class ()
 
virtual WaveAsWave ()
 
virtual const WaveAsWave () const
 
virtual WaveClone () const
 
Writer * Convert (Wave *wave)
 
virtual operator Wave * ()
 
virtual operator Writer * ()
 
- 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::chemical::AbstractMotif
 AbstractMotif ()
 
virtual ~AbstractMotif ()
 
virtual void ClearImplementation ()
 
virtual ContainerGetAllImplementation ()
 
virtual const ContainerGetAllImplementation () const
 
virtual unsigned long GetCountImplementation () const
 
virtual std::string GetStringFromImplementation (std::string separator=", ")
 
virtual void ImportImplementation (const void *other)
 

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)
 
- Static Public Member Functions inherited from bio::chemical::AbstractMotif
static Properties GetClassProperties ()
 
- Public Attributes inherited from bio::chemical::Class< UnorderedMotif< CONTENT_TYPE > >
physical::Perspective< StandardDimension > Filter filter
 
physical::Perspective< StandardDimension > * perspective
 
- Public Attributes inherited from bio::physical::Identifiable< StandardDimension >
Id m_id
 
- Protected Member Functions inherited from bio::physical::Observer< Perspective< StandardDimension > >
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 Member Functions inherited from bio::log::Writer
virtual void InitializeImplementation (ByteStreams args)
 
void Log (Level level, const char *format,...) const
 
- 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::physical::Class< T >
T * m_object
 
- Protected Attributes inherited from bio::physical::Wave
Wavem_signal
 
Symmetrym_symmetry
 
- Protected Attributes inherited from bio::VirtualBase
bool m_hasBeenInitialized
 
- Protected Attributes inherited from bio::physical::Class< Identifiable< StandardDimension > >
Identifiable< StandardDimension > * m_object
 
- Protected Attributes inherited from bio::physical::Filterable
Filter m_filter
 
- Protected Attributes inherited from bio::physical::Class< Filterable >
Filterablem_object
 
- Protected Attributes inherited from bio::physical::Class< Writer >
Writer * m_object
 
- 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::chemical::AbstractMotif
Containerm_contents
 

Detailed Description

template<typename CONTENT_TYPE>
class bio::chemical::UnorderedMotif< CONTENT_TYPE >

UnorderedMotif classes have Content classes stored within them. They are simple containers.

Definition at line 40 of file UnorderedMotif.h.

Member Typedef Documentation

◆ Contents

template<typename CONTENT_TYPE >
typedef physical::Arrangement< CONTENT_TYPE > bio::chemical::UnorderedMotif< CONTENT_TYPE >::Contents

Definition at line 46 of file UnorderedMotif.h.

Constructor & Destructor Documentation

◆ UnorderedMotif() [1/2]

template<typename CONTENT_TYPE >
bio::chemical::UnorderedMotif< CONTENT_TYPE >::UnorderedMotif ( const Contents contents)
inline
Parameters
contents

Definition at line 67 of file UnorderedMotif.h.

68 :
69 chemical::Class< UnorderedMotif< CONTENT_TYPE > >(this) //TODO: Define Symmetry.
70 {
71 this->m_contents = new Contents(*contents);
72 }
physical::Arrangement< CONTENT_TYPE > Contents

References bio::chemical::AbstractMotif::m_contents.

◆ UnorderedMotif() [2/2]

template<typename CONTENT_TYPE >
bio::chemical::UnorderedMotif< CONTENT_TYPE >::UnorderedMotif ( const UnorderedMotif< CONTENT_TYPE > *  toCopy)
inline
Parameters
toCopy

Definition at line 77 of file UnorderedMotif.h.

78 :
79 chemical::Class< UnorderedMotif< CONTENT_TYPE > >(this) //TODO: Define Symmetry.
80 {
81 this->m_contents = new Contents(*toCopy->m_contents);
82 }

References bio::chemical::AbstractMotif::m_contents.

◆ ~UnorderedMotif()

template<typename CONTENT_TYPE >
virtual bio::chemical::UnorderedMotif< CONTENT_TYPE >::~UnorderedMotif ( )
inlinevirtual

Definition at line 87 of file UnorderedMotif.h.

88 {
89 //NOTE: Children are responsible for clearing m_contents (e.g. through ClearImplementation()).
90 }

Member Function Documentation

◆ AddImplementation()

template<typename CONTENT_TYPE >
virtual CONTENT_TYPE bio::chemical::UnorderedMotif< CONTENT_TYPE >::AddImplementation ( const CONTENT_TYPE  content)
inlinevirtual

Adds content to *this.

Parameters
content
Returns
the added content or 0.

Reimplemented in bio::chemical::LinearMotif< CONTENT_TYPE >.

Definition at line 114 of file UnorderedMotif.h.

115 {
116 CONTENT_TYPE ret = this->m_contents->Access(this->m_contents->Add(content));
117 return ret;
118 }
virtual ByteStream Access(const Index index)
Definition: Container.cpp:185
virtual Index Add(const ByteStream content)
Definition: Container.cpp:129

References bio::Container::Access(), bio::Container::Add(), and bio::chemical::AbstractMotif::m_contents.

Referenced by bio::chemical::UnorderedStructureInterface::Add().

◆ BIO_DISAMBIGUATE_ALL_CLASS_METHODS()

template<typename CONTENT_TYPE >
bio::chemical::UnorderedMotif< CONTENT_TYPE >::BIO_DISAMBIGUATE_ALL_CLASS_METHODS ( chemical  ,
UnorderedMotif< CONTENT_TYPE >   
)
inline

Ensure virtual methods point to Class implementations.

Definition at line 51 of file UnorderedMotif.h.

58 :
59 chemical::Class< UnorderedMotif< CONTENT_TYPE > >(this) //TODO: Define Symmetry.
60 {
61 this->m_contents = new Contents(4);
62 }

References bio::chemical::AbstractMotif::m_contents.

◆ ClearImplementation()

◆ GetCountImplementation()

template<typename CONTENT_TYPE >
virtual unsigned long bio::chemical::UnorderedMotif< CONTENT_TYPE >::GetCountImplementation ( ) const
inlinevirtual

Implementation for counting Contents.

Returns
the number of Contents in *this.

Reimplemented from bio::chemical::AbstractMotif.

Definition at line 104 of file UnorderedMotif.h.

105 {
106 return this->m_contents->GetNumberOfElements();
107 }
virtual Index GetNumberOfElements() const
Definition: Container.cpp:84

References bio::Container::GetNumberOfElements(), and bio::chemical::AbstractMotif::m_contents.

Referenced by bio::chemical::UnorderedStructureInterface::GetCount().

◆ GetNumMatchingImplementation()

template<typename CONTENT_TYPE >
virtual unsigned int bio::chemical::UnorderedMotif< CONTENT_TYPE >::GetNumMatchingImplementation ( const Container other) const
inlinevirtual

Gives the number of matching contents between *this & other.

Parameters
other
Returns
quantity overlap with other.

Definition at line 159 of file UnorderedMotif.h.

160 {
161 BIO_SANITIZE(other, ,
162 return 0);
163
164 unsigned int ret = 0;
165 for (
166 SmartIterator otr = other->End();
167 !otr.IsAtBeginning();
168 --otr
169 )
170 {
171 if (this->HasImplementation(*otr))
172 {
173 ++ret;
174 }
175 }
176 return ret;
177 }
#define BIO_SANITIZE(test, success, failure)
virtual bool HasImplementation(const CONTENT_TYPE content) const

References BIO_SANITIZE, bio::Container::End(), bio::chemical::UnorderedMotif< CONTENT_TYPE >::HasImplementation(), and bio::SmartIterator::IsAtBeginning().

Referenced by bio::chemical::UnorderedStructureInterface::GetNumMatching(), and bio::chemical::UnorderedMotif< CONTENT_TYPE >::HasAllImplementation().

◆ GetStringFromImplementation()

template<typename CONTENT_TYPE >
virtual std::string bio::chemical::UnorderedMotif< CONTENT_TYPE >::GetStringFromImplementation ( std::string  separator = ", ")
inlinevirtual

Get the Contents of *this as a string.

Parameters
separatore.g. ", ", the default, or just " ".
Returns
the Contents of *this as a string.

Reimplemented from bio::chemical::AbstractMotif.

Reimplemented in bio::chemical::LinearMotif< CONTENT_TYPE >, bio::chemical::LinearMotif< Organelle * >, bio::chemical::LinearMotif< genetic::Plasmid * >, bio::chemical::LinearMotif< Tissue * >, bio::chemical::LinearMotif< Organ * >, bio::chemical::LinearMotif< Cell * >, bio::chemical::LinearMotif< Substance * >, bio::chemical::LinearMotif< Symmetry * >, bio::chemical::LinearMotif< Plasmid * >, bio::chemical::LinearMotif< molecular::Protein * >, bio::chemical::LinearMotif< Gene * >, bio::chemical::LinearMotif< Surface * >, bio::chemical::LinearMotif< chemical::Reaction * >, bio::chemical::LinearMotif< Protein * >, bio::chemical::LinearMotif< Molecule * >, bio::chemical::LinearMotif< Organism * >, and bio::chemical::LinearMotif< cellular::OrganSystem * >.

Definition at line 196 of file UnorderedMotif.h.

197 {
198 std::string ret = "";
199 SmartIterator cnt = this->m_contents->Begin();
200 while (true)
201 {
202 ret += string::From< CONTENT_TYPE >(*cnt);
203 ++cnt;
204 if (cnt.IsAtEnd())
205 {
206 break;
207 }
208 ret += separator;
209 }
210 return ret;
211 }
virtual SmartIterator Begin() const
Definition: Container.cpp:295

References bio::Container::Begin(), bio::SmartIterator::IsAtEnd(), and bio::chemical::AbstractMotif::m_contents.

Referenced by bio::chemical::UnorderedStructureInterface::GetStringFrom().

◆ HasAllImplementation()

template<typename CONTENT_TYPE >
virtual bool bio::chemical::UnorderedMotif< CONTENT_TYPE >::HasAllImplementation ( const Container contents) const
inlinevirtual

Check for all contents

Parameters
contents
Returns
whether or not the given contents exists in *this

Definition at line 184 of file UnorderedMotif.h.

185 {
186 BIO_SANITIZE(contents, ,
187 return false);
188 return this->GetNumMatchingImplementation(contents) == contents->GetNumberOfElements();
189 }
virtual unsigned int GetNumMatchingImplementation(const Container *other) const

References BIO_SANITIZE, bio::Container::GetNumberOfElements(), and bio::chemical::UnorderedMotif< CONTENT_TYPE >::GetNumMatchingImplementation().

Referenced by bio::chemical::UnorderedStructureInterface::HasAll().

◆ HasImplementation()

template<typename CONTENT_TYPE >
virtual bool bio::chemical::UnorderedMotif< CONTENT_TYPE >::HasImplementation ( const CONTENT_TYPE  content) const
inlinevirtual

Check for content.

Parameters
content
Returns
whether or not the given content exists in *this

Definition at line 137 of file UnorderedMotif.h.

138 {
139 return this->m_contents->Has(content);
140 }
bool Has(const ByteStream content) const
Definition: Container.cpp:232

References bio::Container::Has(), and bio::chemical::AbstractMotif::m_contents.

Referenced by bio::chemical::UnorderedMotif< CONTENT_TYPE >::GetNumMatchingImplementation(), and bio::chemical::UnorderedStructureInterface::Has().

◆ ImportImplementation()

template<typename CONTENT_TYPE >
virtual void bio::chemical::UnorderedMotif< CONTENT_TYPE >::ImportImplementation ( const UnorderedMotif< CONTENT_TYPE > *  other)
inlinevirtual

Copy the contents of another container into *this.

Parameters
other

Definition at line 146 of file UnorderedMotif.h.

147 {
148 BIO_SANITIZE(other, ,
149 return);
150
151 this->m_contents->Import(other->GetAllImplementation());
152 }
virtual void Import(const Container *other)
Definition: Container.cpp:251

References BIO_SANITIZE, bio::chemical::AbstractMotif::GetAllImplementation(), bio::Container::Import(), and bio::chemical::AbstractMotif::m_contents.

Referenced by bio::chemical::UnorderedStructureInterface::Import().

◆ RemoveImplementation()

template<typename CONTENT_TYPE >
virtual CONTENT_TYPE bio::chemical::UnorderedMotif< CONTENT_TYPE >::RemoveImplementation ( const CONTENT_TYPE  content)
inlinevirtual

Removes content from *this and deletes it.

Parameters
content

Definition at line 124 of file UnorderedMotif.h.

125 {
126 Index toErase = this->m_contents->SeekTo(content);
127 CONTENT_TYPE ret = this->m_contents->Access(toErase);
128 this->m_contents->Erase(toErase);
129 return ret;
130 }
Index SeekTo(const ByteStream content) const
Definition: Container.cpp:209
virtual bool Erase(Index index)
Definition: Container.cpp:237
uint32_t Index
Definition: Types.h:57

References bio::Container::Access(), bio::Container::Erase(), bio::chemical::AbstractMotif::m_contents, and bio::Container::SeekTo().

Referenced by bio::chemical::UnorderedStructureInterface::Remove().


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