source: branches/profile/PRIMER_DESIGN/PRD_SearchFIFO.hxx

Last change on this file was 7623, checked in by westram, 13 years ago
  • merge from dev [7450] [7452] [7456] [7457] [7458] [7459] [7460] [7461] [7464] [7465] [7466] [7467] [7468] [7469] [7482]
    • tweaked compiler options
      • activated -Weffc++
        • postfilter warnings where Scott Meyers' advices are too general.
          • base classes should not always have virtual destructors, since that renders tiny classes useless and
          • members should not always be initialized via initialization list, since that often violates the DRY principle
        • fix gcc's inability to detect that Noncopyable implements a private copy-ctor and op=
        • this slows down complete ARB recompilation by ~5%
    • added -Wold-style-cast (inactive)
    • removed -Wno-non-template-friend added in [7447]
  • postcompile.pl
    • added option —original to show unmodified compiler output
  • declared op= for classes which had a copy-ctor
  • moved op= macros to arbtools.h
  • derived classes containing pointers from Noncopyable (use Noncopyable virtually) or
  • made them copyable if needed (awt_mask_item, KnownDB, Code, AWT_registered_itemtype, GEN_gene, PosGene, PartialSequence, PlugIn, Range, Convaln_exception)
  • other related changes
    • user mask destruction working now
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.4 KB
Line 
1// =============================================================== //
2//                                                                 //
3//   File      : PRD_SearchFIFO.hxx                                //
4//   Purpose   :                                                   //
5//                                                                 //
6//   Coded by Wolfram Foerster in February 2001                    //
7//   Institute of Microbiology (Technical University Munich)       //
8//   http://www.arb-home.de/                                       //
9//                                                                 //
10// =============================================================== //
11
12#ifndef PRD_SEARCHFIFO_HXX
13#define PRD_SEARCHFIFO_HXX
14
15#ifndef   PRD_NODE_HXX
16#include "PRD_Node.hxx"
17#endif
18#ifndef   PRD_RANGE_HXX
19#include "PRD_Range.hxx"
20#endif
21
22struct SearchParameter {
23    Node             *node;         // where am i currently in the tree
24    SearchParameter  *next;
25    SearchParameter  *previous;
26};
27
28class SearchFIFO : virtual Noncopyable {
29    SearchParameter *begin;     // start of list of positions in tree
30    SearchParameter *end;       // end of list of positions in tree
31    SearchParameter *current;   // points to the currently examined position in the list
32
33    Node             *root;     // rootnode of primertree to be searched in
34    bool              expand_IUPAC_Codes; // enable/disable expansion of IUPAC codes
35    PRD_Sequence_Pos  min_distance_to_next_match; // if a match is found out of that distance its ignored (not deleted)
36
37    void init(Node *root_, PRD_Sequence_Pos min_distance_to_next_match_, bool expand_IUPAC_Codes_);
38    void erase      (SearchParameter *param_);   // erase the position from the list (tries not to invalidate current)
39    void push_front (Node *child_of_current_);   // append new position in front of the list
40
41public:
42
43    SearchFIFO (Node *root_, PRD_Sequence_Pos min_distance_to_next_match_, bool expand_IUPAC_Codes_);
44    SearchFIFO ();
45    ~SearchFIFO ();
46
47    void push        (unsigned char base_);   // append new position (node=root) to the end of the list
48    void iterateWith (PRD_Sequence_Pos pos_, unsigned char base_);   // tries to iterate all positions in the list with the given base
49    void flush       ();        // erase all positions of the list
50    void print       ();        // print all positions in the list
51};
52
53#else
54#error PRD_SearchFIFO.hxx included twice
55#endif // PRD_SEARCHFIFO_HXX
Note: See TracBrowser for help on using the repository browser.