1 | #ifndef PS_PG_TREE_FUNCTIONS_HXX |
---|
2 | #define PS_PG_TREE_FUNCTIONS_HXX |
---|
3 | |
---|
4 | #ifndef PS_DEFS_HXX |
---|
5 | #include "ps_defs.hxx" |
---|
6 | #endif |
---|
7 | #ifndef PS_ASSERT_HXX |
---|
8 | #include "ps_assert.hxx" |
---|
9 | #endif |
---|
10 | #ifndef ARBDB_H |
---|
11 | #include <arbdb.h> |
---|
12 | #endif |
---|
13 | |
---|
14 | // API for Probe-Group-Database format |
---|
15 | |
---|
16 | // db-structure of group_tree: |
---|
17 | // |
---|
18 | // <root> |
---|
19 | // | |
---|
20 | // | |
---|
21 | // "group_tree" |
---|
22 | // | |
---|
23 | // | |
---|
24 | // "node" <more nodes...> |
---|
25 | // | | | |
---|
26 | // | | | |
---|
27 | // | | "group" (contains all probes for this group; may be missing) |
---|
28 | // | | |
---|
29 | // | "num" (contains species-number (created by PG_SpeciesName2SpeciesID)) |
---|
30 | // | |
---|
31 | // "node" <more nodes...> |
---|
32 | // |
---|
33 | // Notes: - the "node"s contained in the path from "group_tree" to any "group" |
---|
34 | // describes the members of the group |
---|
35 | |
---|
36 | |
---|
37 | |
---|
38 | inline GBDATA *PG_get_first_probe(GBDATA *pb_group) { |
---|
39 | return GB_entry(pb_group, "probe"); |
---|
40 | } |
---|
41 | |
---|
42 | inline GBDATA *PG_get_next_probe(GBDATA *pb_probe) { |
---|
43 | ps_assert(GB_has_key(pb_probe, "probe")); |
---|
44 | return GB_nextEntry(pb_probe); |
---|
45 | } |
---|
46 | |
---|
47 | inline const char *PG_read_probe(GBDATA *pb_probe) { |
---|
48 | return GB_read_char_pntr(pb_probe); |
---|
49 | } |
---|
50 | |
---|
51 | inline GBDATA *PS_get_first_node(GBDATA *pb_nodecontainer) { |
---|
52 | return GB_entry(pb_nodecontainer, "node"); |
---|
53 | } |
---|
54 | |
---|
55 | inline GBDATA *PS_get_next_node(GBDATA *pb_node) { |
---|
56 | ps_assert(GB_has_key(pb_node, "node")); |
---|
57 | return GB_nextEntry(pb_node); |
---|
58 | } |
---|
59 | |
---|
60 | #else |
---|
61 | #error ps_pg_tree_functions.hxx included twice |
---|
62 | #endif // PS_PG_TREE_FUNCTIONS_HXX |
---|