source: branches/profile/ARBDB/gb_compress.h

Last change on this file was 9838, checked in by westram, 11 years ago
  • reintegrated branch 'db'
    • GBDATA now is a base class of GBENTRY (new) and GBCONTAINER
      • moved code into classes GBENTRY, GBCONTAINER and GB_MAIN_TYPE
      • several functions now exist 2 (or 3) times (for GBENTRY and GBCONTAINER, and some for GBDATA as well)
      • several functions changed their interface (caller has to explicitely pass GBENTRY or GBCONTAINER)
    • dropped support for ARB DB-version 0
  • adds:
File size: 1.4 KB
Line 
1// =============================================================== //
2//                                                                 //
3//   File      : gb_compress.h                                     //
4//   Purpose   :                                                   //
5//                                                                 //
6//   Institute of Microbiology (Technical University Munich)       //
7//   http://www.arb-home.de/                                       //
8//                                                                 //
9// =============================================================== //
10
11#ifndef GB_COMPRESS_H
12#define GB_COMPRESS_H
13
14#ifndef GB_STORAGE_H
15#include "gb_storage.h"
16#endif
17
18#define GB_COMPRESSION_TAGS_SIZE_MAX 100
19
20enum gb_compress_list_commands {
21    GB_CS_OK   = 0,
22    GB_CS_SUB  = 1,
23    GB_CS_ID   = 2,
24    GB_CS_END  = 3,
25    GB_CD_NODE = 4
26};
27
28struct gb_compress_tree {
29    char              leaf;
30    gb_compress_tree *son[2];
31};
32
33struct gb_compress_list {
34    gb_compress_list_commands command;
35
36    int  value;
37    int  bitcnt;
38    int  bits;
39    int  mask;
40    long count;
41
42    gb_compress_list *son[2];
43};
44
45extern int gb_convert_type_2_sizeof[];
46extern int gb_convert_type_2_appendix_size[];
47
48inline size_t GBENTRY::uncompressed_size() const {
49    return size() * gb_convert_type_2_sizeof[type()] + gb_convert_type_2_appendix_size[type()];
50}
51
52#else
53#error gb_compress.h included twice
54#endif // GB_COMPRESS_H
Note: See TracBrowser for help on using the repository browser.