5 #ifndef BPP_SEQ_CONTAINER_SEQUENCECONTAINERITERATOR_H
6 #define BPP_SEQ_CONTAINER_SEQUENCECONTAINERITERATOR_H
9 #include "../Sequence.h"
10 #include "../SequenceIterator.h"
18 template<
class SequenceType,
class HashType = std::
string>
19 class AbstractTemplateSequenceContainerIterator :
20 public virtual TemplateSequenceIteratorInterface<const SequenceType>
23 const TemplateSequenceContainerInterface<SequenceType, HashType>* sequences_;
24 size_t currentPosition_;
27 AbstractTemplateSequenceContainerIterator(
const TemplateSequenceContainerInterface<SequenceType, HashType>& sequences) :
28 sequences_(&sequences),
33 AbstractTemplateSequenceContainerIterator(
const AbstractTemplateSequenceContainerIterator& atsi) :
34 sequences_(atsi.sequences_),
35 currentPosition_(atsi.currentPosition_)
38 AbstractSequenceContainerIterator& operator=(
const AbstractTemplateSequenceContainerIterator& atsi)
40 sequences_ = atsi.sequences_;
41 currentPosition_ = atsi.currentPosition_;
45 virtual ~AbstractTemplateSequenceContainerIterator() {}
51 template<
class SequenceType,
class HashType = std::
string>
52 class SimpleTemplateSequenceContainerIterator :
53 public AbstractTemplateSequenceContainerIterator<SequenceType, HashType>
56 SimpleSequenceContainerIterator(
const TemplateSequenceContainerInterface<SequenceType, HashType>& sequences) :
57 AbstractTemplateSequenceContainerIterator<SequenceType, HashType>(&sequences) {}
59 virtual ~SimpleTemplateSequenceContainerIterator() {}
62 const SequenceType& nextSequence()
override
65 const Sequence& seq = sequences_->sequence(currentPosition_);
70 bool hasMoreSequences()
const override
72 return currentPosition_ < sequences_->getNumberOfSequences();
This alphabet is used to deal NumericAlphabet.