source: branches/profile/NALIGNER/ali_pathmap.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.0 KB
Line 
1// =============================================================== //
2//                                                                 //
3//   File      : ali_pathmap.hxx                                   //
4//   Purpose   :                                                   //
5//                                                                 //
6//   Institute of Microbiology (Technical University Munich)       //
7//   http://www.arb-home.de/                                       //
8//                                                                 //
9// =============================================================== //
10
11#ifndef ALI_PATHMAP_HXX
12#define ALI_PATHMAP_HXX
13
14#ifndef ALI_TARRAY_HXX
15#include "ali_tarray.hxx"
16#endif
17
18#define ALI_UNDEF 0x00
19#define ALI_LEFT        0x01
20#define ALI_DIAG  0x02
21#define ALI_UP    0x04
22#define ALI_LUP   0x08
23
24// Structure for a long up pointer (a multi gap)
25struct ali_pathmap_up_pointer {
26    unsigned long start;
27    unsigned char operation;
28};
29
30class ALI_PATHMAP : virtual Noncopyable {
31    unsigned long width, height;
32    unsigned long height_real;
33    unsigned char **pathmap;
34    ALI_TARRAY<ali_pathmap_up_pointer> ****up_pointers;
35    unsigned char **optimized;
36
37public:
38
39    ALI_PATHMAP(unsigned long width, unsigned long height);
40    ~ALI_PATHMAP();
41
42    void set(unsigned long x, unsigned long y, unsigned char val,
43             ALI_TARRAY<ali_pathmap_up_pointer> *up_pointer = 0);
44    void get(unsigned long x, unsigned long y, unsigned char *val,
45             ALI_TARRAY<ali_pathmap_up_pointer> **up_pointer);
46    unsigned char get_value(unsigned long x, unsigned long y) {
47        if (x >= width || y >= height)
48            ali_fatal_error("Out of range", "ALI_PATHMAP::get_value()");
49        if (y & 0x01)
50            return (*pathmap)[x*height_real + y/2] & 0x0f;
51        else
52            return (*pathmap)[x*height_real + y/2] >> 4;
53    }
54    void optimize(unsigned long x);
55    void print();
56};
57
58#else
59#error ali_pathmap.hxx included twice
60#endif // ALI_PATHMAP_HXX
Note: See TracBrowser for help on using the repository browser.