|
Last change
on this file was
5441,
checked in by westram, 17 years ago
|
|
|
-
Property svn:eol-style set to
native
-
Property svn:keywords set to
Author Date Id Revision
|
|
File size:
1.8 KB
|
| Line | |
|---|
| 1 | #ifndef PRD_SEARCHFIFO_HXX |
|---|
| 2 | #define PRD_SEARCHFIFO_HXX |
|---|
| 3 | |
|---|
| 4 | #ifndef PRD_GLOBALS_HXX |
|---|
| 5 | #include "PRD_Globals.hxx" |
|---|
| 6 | #endif |
|---|
| 7 | #ifndef PRD_NODE_HXX |
|---|
| 8 | #include "PRD_Node.hxx" |
|---|
| 9 | #endif |
|---|
| 10 | #ifndef PRD_RANGE_HXX |
|---|
| 11 | #include "PRD_Range.hxx" |
|---|
| 12 | #endif |
|---|
| 13 | |
|---|
| 14 | struct SearchParameter { |
|---|
| 15 | Node *node; // where am i currently in the tree |
|---|
| 16 | SearchParameter *next; |
|---|
| 17 | SearchParameter *previous; |
|---|
| 18 | }; |
|---|
| 19 | |
|---|
| 20 | class SearchFIFO { |
|---|
| 21 | private: |
|---|
| 22 | |
|---|
| 23 | SearchParameter *begin; // start of list of positions in tree |
|---|
| 24 | SearchParameter *end; // end of list of positions in tree |
|---|
| 25 | SearchParameter *current; // points to the currently examined position in the list |
|---|
| 26 | |
|---|
| 27 | Node *root; // rootnode of primertree to be searched in |
|---|
| 28 | bool expand_IUPAC_Codes; // enable/disable expasnion of IUPAC codes |
|---|
| 29 | PRD_Sequence_Pos min_distance_to_next_match; // if a match is found out of that distance its ignored (not deleted) |
|---|
| 30 | |
|---|
| 31 | void init( Node *root_, PRD_Sequence_Pos min_distance_to_next_match_, bool expand_IUPAC_Codes_ ); |
|---|
| 32 | void erase ( SearchParameter *param_ ); // erase the position from the list (tries not to invalidate current) |
|---|
| 33 | void push_front ( Node *child_of_current_ ); // append new position in front of the list |
|---|
| 34 | |
|---|
| 35 | public: |
|---|
| 36 | |
|---|
| 37 | SearchFIFO ( Node *root_, PRD_Sequence_Pos min_distance_to_next_match_, bool expand_IUPAC_Codes_ ); |
|---|
| 38 | SearchFIFO (); |
|---|
| 39 | ~SearchFIFO (); |
|---|
| 40 | |
|---|
| 41 | void push ( unsigned char base_ ); // append new position (node=root) to the end of the list |
|---|
| 42 | void iterateWith ( PRD_Sequence_Pos pos_, unsigned char base_ ); // tries to iterate all positions in the list with the given base |
|---|
| 43 | void flush (); // erase all positions of the list |
|---|
| 44 | void print (); // print all positions in the list |
|---|
| 45 | }; |
|---|
| 46 | |
|---|
| 47 | #else |
|---|
| 48 | #error PRD_SearchFIFO.hxx included twice |
|---|
| 49 | #endif // PRD_SEARCHFIFO_HXX |
|---|
Note: See
TracBrowser
for help on using the repository browser.