ARB
PRD_SequenceIterator.hxx
Go to the documentation of this file.
1 #ifndef PRD_SEQUENCEITERATOR_HXX
2 #define PRD_SEQUENCEITERATOR_HXX
3 
4 #ifndef PRD_GLOBALS_HXX
5 #include "PRD_Globals.hxx"
6 #endif
7 
9 private:
10 
11  const char *sequence; // sequence of bases to be iterated
12  int max_length; // maximum count of bases returned (afterwards only EOS is returned)
13  int stop_position; // stop at this position even if not yet max_length bases delivered
14  int direction; // direction to walk through sequence (FORWARD / BACKWARD)
15 
16 public:
17  static const int IGNORE = -1; // may be used at max_length_ or stop_pos_ parameter
18  static const char EOS = '\x00'; // = End Of Sequence
19  static const int FORWARD = 1; // may be used at direction_ parameter
20  static const int BACKWARD = -1; // may be used at direction_ parameter
21 
22  PRD_Sequence_Pos pos; // current index in sequence .. position of last returned base
23  int delivered; // current count of returned bases
24 
25  SequenceIterator (const char *sequence_, PRD_Sequence_Pos start_pos_, PRD_Sequence_Pos stop_pos_, int max_length_, int direction_);
26  SequenceIterator (const char *sequence);
27 
28  void restart (PRD_Sequence_Pos start_pos_, PRD_Sequence_Pos stop_pos_, int max_length_, int direction_);
29  unsigned char nextBase();
30 };
31 
32 #else
33 #error PRD_SequenceIterator.hxx included twice
34 #endif // PRD_SEQUENCEITERATOR_HXX
unsigned char nextBase()
SequenceIterator(const char *sequence_, PRD_Sequence_Pos start_pos_, PRD_Sequence_Pos stop_pos_, int max_length_, int direction_)
PRD_Sequence_Pos pos
void restart(PRD_Sequence_Pos start_pos_, PRD_Sequence_Pos stop_pos_, int max_length_, int direction_)
static const int FORWARD
static const int BACKWARD
long int PRD_Sequence_Pos
Definition: PRD_Globals.hxx:21
static const char EOS
static const int IGNORE