ARB
gb_header.h
Go to the documentation of this file.
1 // =============================================================== //
2 // //
3 // File : gb_header.h //
4 // Purpose : //
5 // //
6 // Institute of Microbiology (Technical University Munich) //
7 // http://www.arb-home.de/ //
8 // //
9 // =============================================================== //
10 
11 #ifndef GB_HEADER_H
12 #define GB_HEADER_H
13 
14 #ifndef GB_DATA_H
15 #include "gb_data.h"
16 #endif
17 
18 
20  unsigned int flags : GB_MAX_USERS; // public
21  unsigned int key_quark : 24; // == 0 -> invalid
22  unsigned int changed : 3;
23  unsigned int ever_changed : 1; // is this element ever changed
24 
25  void set_change(GB_CHANGE val) {
26  changed = val;
27  ever_changed = 1;
28  }
29  void inc_change(GB_CHANGE val) {
30  if (changed<unsigned(val)) set_change(val);
31  }
32 };
33 
34 struct gb_header_list { // public fast flags
37  /* pointer to data
38  if 0 & !key_index -> free data
39  if 0 & key_index -> data only in server */
40 };
41 
43  return GB_RESOLVE(GBDATA*, (&(hl)), rel_hl_gbd);
44 }
46  GB_SETREL(&hl, rel_hl_gbd, gbd);
47 }
48 
50 
51 // ---------------------------------
52 // container element access
53 
55  return GB_HEADER_LIST_GBD(GB_DATA_LIST_HEADER((gbc)->d)[idx]);
56 }
57 inline GBDATA *GBCONTAINER_ELEM(GBCONTAINER *gbc, int idx) {
58  return (idx<gbc->d.nheader) ? EXISTING_GBCONTAINER_ELEM(gbc, idx) : NULp;
59 }
60 inline void SET_GBCONTAINER_ELEM(GBCONTAINER *gbc, int idx, GBDATA *gbd) {
62 }
63 
64 
65 #else
66 #error gb_header.h included twice
67 #endif // GB_HEADER_H
GB_CHANGE
Definition: gb_local.h:73
void SET_GBCONTAINER_ELEM(GBCONTAINER *gbc, int idx, GBDATA *gbd)
Definition: gb_header.h:60
void inc_change(GB_CHANGE val)
Definition: gb_header.h:29
GBDATA * GB_HEADER_LIST_GBD(gb_header_list &hl)
Definition: gb_header.h:42
CONSTEXPR_INLINE gb_header_list * GB_DATA_LIST_HEADER(gb_data_list &dl)
Definition: gb_data.h:105
gb_header_flags & GB_ARRAY_FLAGS(GBDATA *gbd)
Definition: gb_header.h:49
long GB_REL_GBDATA
Definition: gb_memory.h:56
#define GB_MAX_USERS
Definition: gb_local.h:23
void SET_GB_HEADER_LIST_GBD(gb_header_list &hl, GBDATA *gbd)
Definition: gb_header.h:45
unsigned int key_quark
Definition: gb_header.h:21
GBDATA * EXISTING_GBCONTAINER_ELEM(GBCONTAINER *gbc, int idx)
Definition: gb_header.h:54
CONSTEXPR_INLINE GBCONTAINER * GB_FATHER(GBDATA *gbd)
Definition: gb_data.h:271
GB_REL_GBDATA rel_hl_gbd
Definition: gb_header.h:36
#define GB_SETREL(struct_add, member_name, address)
Definition: gb_memory.h:82
unsigned int ever_changed
Definition: gb_header.h:23
long index
Definition: gb_data.h:133
unsigned int changed
Definition: gb_header.h:22
GBDATA * GBCONTAINER_ELEM(GBCONTAINER *gbc, int idx)
Definition: gb_header.h:57
#define NULp
Definition: cxxforward.h:97
gb_data_list d
Definition: gb_data.h:246
#define GB_RESOLVE(typ, struct_add, member_name)
Definition: gb_memory.h:77
gb_header_flags flags
Definition: gb_header.h:35
void set_change(GB_CHANGE val)
Definition: gb_header.h:25
unsigned int flags
Definition: gb_header.h:20