ARB
gb_ts.h
Go to the documentation of this file.
1 // =============================================================== //
2 // //
3 // File : gb_ts.h //
4 // Purpose : gb_transaction_save //
5 // //
6 // Institute of Microbiology (Technical University Munich) //
7 // http://www.arb-home.de/ //
8 // //
9 // =============================================================== //
10 
11 #ifndef GB_TS_H
12 #define GB_TS_H
13 
14 #ifndef GB_DATA_H
15 #include "gb_data.h"
16 #endif
17 
18 
21  unsigned char memsize;
22  unsigned char size;
23 };
24 
25 struct GB_INTern2 {
27 };
28 
30  char *data;
31  long memsize;
32  long size;
33 };
34 
39 };
40 
45  short refcount; // number of references to this object
46 
47  bool stored_external() const { return flags2.extern_data; }
48 };
49 
51 inline long GB_GETSIZE_TS(gb_transaction_save *ts) { return ts->stored_external() ? ts->info.ex.size : ts->info.istr.size; }
52 inline long GB_GETMEMSIZE_TS(gb_transaction_save *ts) { return ts->stored_external() ? ts->info.ex.memsize : ts->info.istr.memsize; }
53 inline char *GB_GETDATA_TS(gb_transaction_save *ts) { return ts->stored_external() ? ts->info.ex.data : &(ts->info.istr.data[0]); }
54 
55 inline void GB_FREE_TRANSACTION_SAVE(GBDATA *gbd) {
56  if (gbd->ext && gbd->ext->old) {
58  gbd->ext->old = NULp;
59  }
60 }
61 
62 #else
63 #error gb_ts.h included twice
64 #endif // GB_TS_H
char data[SIZOFINTERN]
Definition: gb_ts.h:20
GB_TYPES GB_TYPE_TS(gb_transaction_save *ts)
Definition: gb_ts.h:50
GB_INTern_strings2 istr
Definition: gb_ts.h:36
gb_flag_types2 flags2
Definition: gb_ts.h:43
long GB_GETSIZE_TS(gb_transaction_save *ts)
Definition: gb_ts.h:51
gb_extern_data2 ex
Definition: gb_ts.h:38
unsigned int type
Definition: gb_data.h:66
gb_flag_types flags
Definition: gb_ts.h:42
char data[SIZOFINTERN]
Definition: gb_ts.h:26
char * GB_GETDATA_TS(gb_transaction_save *ts)
Definition: gb_ts.h:53
short refcount
Definition: gb_ts.h:45
gb_data_base_type_union2 info
Definition: gb_ts.h:44
unsigned char size
Definition: gb_ts.h:22
unsigned char memsize
Definition: gb_ts.h:21
unsigned int extern_data
Definition: gb_data.h:84
#define SIZOFINTERN
Definition: gb_data.h:25
gb_db_extended * ext
Definition: gb_data.h:132
long memsize
Definition: gb_ts.h:31
bool stored_external() const
Definition: gb_ts.h:47
gb_transaction_save * old
Definition: gb_data.h:60
#define NULp
Definition: cxxforward.h:116
GB_TYPES
Definition: arbdb.h:62
char * data
Definition: gb_ts.h:30
void gb_del_ref_gb_transaction_save(gb_transaction_save *ts)
Definition: ad_core.cxx:591
void GB_FREE_TRANSACTION_SAVE(GBDATA *gbd)
Definition: gb_ts.h:55
long GB_GETMEMSIZE_TS(gb_transaction_save *ts)
Definition: gb_ts.h:52
long size
Definition: gb_ts.h:32