source: tags/svn.1.5.4/NALIGNER/ali_pt.hxx

Last change on this file was 8100, checked in by westram, 13 years ago

merge from ptpan_back [8016] [8017] [8021] [8051] [8067]

  • added method to get status of GB_shell object
  • removed possibility to execute command via DB-server - always use GB_system instead
  • valgrinded external tools called by arb_test
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.5 KB
Line 
1// =============================================================== //
2//                                                                 //
3//   File      : ali_pt.hxx                                        //
4//   Purpose   :                                                   //
5//                                                                 //
6//   Institute of Microbiology (Technical University Munich)       //
7//   http://www.arb-home.de/                                       //
8//                                                                 //
9// =============================================================== //
10
11#ifndef ALI_PT_HXX
12#define ALI_PT_HXX
13
14#ifndef ALI_OTHER_STUFF_HXX
15#include "ali_other_stuff.hxx"
16#endif
17#ifndef ALI_TLIST_HXX
18#include "ali_tlist.hxx"
19#endif
20#ifndef ALI_SEQUENCE_HXX
21#include "ali_sequence.hxx"
22#endif
23#ifndef CLIENT_H
24#include <client.h>
25#endif
26
27enum ALI_PT_MODE { ServerMode, SpecifiedMode };
28
29struct ALI_PT_CONTEXT {
30    char *servername;
31    GBDATA *gb_main;
32
33    int matches_min;
34    float percent_min;
35    unsigned long fam_list_max;
36    unsigned long ext_list_max;
37
38    char *use_specified_family;
39};
40
41// class of family members
42class ali_pt_member : virtual Noncopyable {
43public:
44    char *name;
45    int matches;
46
47    ali_pt_member(char *speciesname, int number_of_matches) {
48        name = speciesname;
49        matches = number_of_matches;
50    }
51    ~ali_pt_member() {
52        if (name)
53            free((char *) name);
54    }
55};
56
57
58// Class for accessing the PT server
59class ALI_PT : virtual Noncopyable {
60private:
61    ALI_PT_MODE mode;
62
63    char *specified_family;
64    unsigned long fam_list_max;
65    unsigned long ext_list_max;
66    float percent_min;
67    int matches_min;
68
69    aisc_com *link;
70    T_PT_LOCS locs;
71    T_PT_MAIN com;
72
73    ALI_TLIST<ali_pt_member *> *family_list;
74    ALI_TLIST<ali_pt_member *> *extension_list;
75
76
77    int init_communication();
78    char *get_family_member(char *specified_family, unsigned long number);
79    char *get_extension_member(char *specified_family, unsigned long number);
80    int open(char *servername);
81    void close();
82
83public:
84    ALI_PT(ALI_PT_CONTEXT *context);
85    ~ALI_PT();
86
87    int find_family(ALI_SEQUENCE *sequence, int find_type = 1);
88
89    ALI_TLIST<ali_pt_member *> *get_family_list();
90    ALI_TLIST<ali_pt_member *> *get_extension_list();
91
92    int first_family_(char **seq_name, int *matches);
93    int next_family_(char **seq_name, int *matches);
94};
95
96#else
97#error ali_pt.hxx included twice
98#endif // ALI_PT_HXX
Note: See TracBrowser for help on using the repository browser.