#include <BALL/CONCEPT/enumerator.h>
Classes | |
class | IteratorTraits_ |
Public Types | |
Type definitions | |
typedef void(* | MutatorFunction )(Variant &, const Variant &) |
typedef std::vector< Variant > | VariantVector |
typedef std::pair < SiteIterator, VariantVector > | Site |
typedef std::list< Site > | SiteList |
typedef ForwardIterator < Enumerator< Container, SiteIterator, Variant > , Container, EnumeratorIndex *, IteratorTraits_ > | Iterator |
typedef ConstForwardIterator < Enumerator< Container, SiteIterator, Variant > , Container, EnumeratorIndex *, IteratorTraits_ > | ConstIterator |
Public Member Functions | |
Constructors and Destructors | |
Enumerator () | |
Enumerator (Container &container) | |
Enumerator (Container &container, MutatorFunction mutator) | |
~Enumerator () | |
Accessors | |
void | addVariants (const SiteIterator &it, const VariantVector &variants) |
void | deleteVariants (const SiteIterator &it, const VariantVector &variants) |
Size | countVariants () |
Container & | getCurrent () |
void | createCombination (const Position index) throw (Exception::IndexOverflow) |
void | createCombination (const EnumeratorIndex &index) throw (EnumeratorIndex::IncompatibleIndex) |
Iterators | |
Iterator | begin () |
Iterator | end () |
ConstIterator | begin () const |
ConstIterator | end () const |
Protected Member Functions | |
void | mutate_ (SiteIterator &it, const Variant &v) |
Static Protected Member Functions | |
static void | defaultAssign_ (Variant &a, const Variant &b) |
Protected Attributes | |
Container & | container_ |
MutatorFunction | mutator_ |
SiteList | variant_sites_ |
EnumeratorIndex | position_ |
bool | is_valid_position_ |
Friends | |
class | IteratorTraits_ |
Enumerator class. The EnumeratorIndex class is designed to enumerate all possible combinations of things. Applications are e.g. the enumeration of all possible sequences defined through a multisequence or enumerating all possible rotamers of a peptide or a bindings site.
Container
it operates on (e.g. the String representing the sequence or the protein containing the amino acids)SiteIterator
(i.e. an iterator pointing to a defined position within the container)Variant
type (i.e. the type of the object to be enumerated). It has to be the same type as the dereferenced SiteIterator
.In the case of a string sequence that has to be mutated, the Container
is of class String , the SiteIterator
is of type String::Iterator
, and Variant
is obviously of type char
.
Definition at line 293 of file enumerator.h.
typedef ConstForwardIterator<Enumerator<Container, SiteIterator, Variant>, Container, EnumeratorIndex*, IteratorTraits_> BALL::Enumerator< Container, SiteIterator, Variant >::ConstIterator |
Constant forward iterator
Definition at line 337 of file enumerator.h.
typedef ForwardIterator<Enumerator<Container, SiteIterator, Variant>, Container, EnumeratorIndex*, IteratorTraits_> BALL::Enumerator< Container, SiteIterator, Variant >::Iterator |
Mutable forward iterator
Definition at line 332 of file enumerator.h.
typedef void(* BALL::Enumerator< Container, SiteIterator, Variant >::MutatorFunction)(Variant &, const Variant &) |
Site mutator function. A function used to assing one variant of a site in the container to another. In the trivial case, this is just the assignment operator (as implemented in the default case), but more involved enumeration problems (e.g. side chain rotamer enumeration) might require additional code for the assignment of the true variant.
Definition at line 312 of file enumerator.h.
typedef std::pair<SiteIterator, VariantVector> BALL::Enumerator< Container, SiteIterator, Variant >::Site |
A combination of a site position and all its possible variants.
Definition at line 322 of file enumerator.h.
typedef std::list<Site> BALL::Enumerator< Container, SiteIterator, Variant >::SiteList |
A list of sites.
Definition at line 327 of file enumerator.h.
typedef std::vector<Variant> BALL::Enumerator< Container, SiteIterator, Variant >::VariantVector |
A vector containing all possible variants for a specific site.
Definition at line 317 of file enumerator.h.
BALL::Enumerator< Container, SiteIterator, Variant >::Enumerator | ( | ) | [inline] |
Default Constructor
Definition at line 645 of file enumerator.h.
BALL::Enumerator< Container, SiteIterator, Variant >::Enumerator | ( | Container & | container | ) | [inline] |
Detailed Constructor. The mutator function is set to a default mutator, using the assignment operator for Variant
.
container | a Container class to be mutated |
Definition at line 653 of file enumerator.h.
BALL::Enumerator< Container, SiteIterator, Variant >::Enumerator | ( | Container & | container, | |
MutatorFunction | mutator | |||
) |
Detailed Constructor
container | a Container class to be mutated | |
mutator | the function defining the mutations to be applied |
BALL::Enumerator< Container, SiteIterator, Variant >::~Enumerator | ( | ) | [inline] |
Default Destructor
Definition at line 366 of file enumerator.h.
void BALL::Enumerator< Container, SiteIterator, Variant >::addVariants | ( | const SiteIterator & | it, | |
const VariantVector & | variants | |||
) | [inline] |
Add variants to the list of variants
Definition at line 378 of file enumerator.h.
BALL_INLINE Enumerator< Container, VariantConstIterator, Variant >::ConstIterator BALL::Enumerator< Container, VariantConstIterator, Variant >::begin | ( | ) | const [inline] |
Definition at line 731 of file enumerator.h.
BALL_INLINE Enumerator< Container, SiteIterator, Variant >::Iterator BALL::Enumerator< Container, SiteIterator, Variant >::begin | ( | ) | [inline] |
Definition at line 715 of file enumerator.h.
Size BALL::Enumerator< Container, SiteIterator, Variant >::countVariants | ( | ) | [inline] |
Count all variants.
Definition at line 402 of file enumerator.h.
void BALL::Enumerator< Container, SiteIterator, Variant >::createCombination | ( | const EnumeratorIndex & | index | ) | throw (EnumeratorIndex::IncompatibleIndex) [inline] |
Create a combination denoted by an instance of EnumeratorIndex.
index | the instance of EnumeratorIndex that describes the combination to be created |
Definition at line 695 of file enumerator.h.
void BALL::Enumerator< Container, SiteIterator, Variant >::createCombination | ( | const Position | index | ) | throw (Exception::IndexOverflow) [inline] |
Create a combination denoted by its number.
index | the number of the combination to be created |
Definition at line 680 of file enumerator.h.
static void BALL::Enumerator< Container, SiteIterator, Variant >::defaultAssign_ | ( | Variant & | a, | |
const Variant & | b | |||
) | [inline, static, protected] |
Definition at line 626 of file enumerator.h.
void BALL::Enumerator< Container, SiteIterator, Variant >::deleteVariants | ( | const SiteIterator & | it, | |
const VariantVector & | variants | |||
) | [inline] |
Delete variants from the list of variants
Definition at line 387 of file enumerator.h.
BALL_INLINE Enumerator< Container, VariantConstIterator, Variant >::ConstIterator BALL::Enumerator< Container, VariantConstIterator, Variant >::end | ( | ) | const [inline] |
Definition at line 739 of file enumerator.h.
BALL_INLINE Enumerator< Container, SiteIterator, Variant >::Iterator BALL::Enumerator< Container, SiteIterator, Variant >::end | ( | ) | [inline] |
Definition at line 723 of file enumerator.h.
BALL_INLINE Container & BALL::Enumerator< Container, SiteIterator, Variant >::getCurrent | ( | ) | [inline] |
Access the current content
Definition at line 673 of file enumerator.h.
void BALL::Enumerator< Container, SiteIterator, Variant >::mutate_ | ( | SiteIterator & | it, | |
const Variant & | v | |||
) | [inline, protected] |
Definition at line 631 of file enumerator.h.
friend class IteratorTraits_ [friend] |
Definition at line 457 of file enumerator.h.
Container& BALL::Enumerator< Container, SiteIterator, Variant >::container_ [protected] |
Definition at line 637 of file enumerator.h.
bool BALL::Enumerator< Container, SiteIterator, Variant >::is_valid_position_ [protected] |
Definition at line 641 of file enumerator.h.
MutatorFunction BALL::Enumerator< Container, SiteIterator, Variant >::mutator_ [protected] |
Definition at line 638 of file enumerator.h.
EnumeratorIndex BALL::Enumerator< Container, SiteIterator, Variant >::position_ [protected] |
Definition at line 640 of file enumerator.h.
SiteList BALL::Enumerator< Container, SiteIterator, Variant >::variant_sites_ [protected] |
Definition at line 639 of file enumerator.h.