00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef _EYEDB_ITERATOR_ATOM_H
00026 #define _EYEDB_ITERATOR_ATOM_H
00027
00028 namespace eyedb {
00029
00030 #define NEW_ITER_ATOM
00031 enum IteratorAtomType {
00032 #ifdef NEW_ITER_ATOM
00033 IteratorAtom_INT16 = 1,
00034 IteratorAtom_INT32,
00035 IteratorAtom_INT64,
00036 IteratorAtom_CHAR,
00037 IteratorAtom_DOUBLE,
00038 IteratorAtom_STRING,
00039 IteratorAtom_OID,
00040 IteratorAtom_IDR
00041 #else
00042 IteratorAtom_NULL = 1,
00043 IteratorAtom_NIL,
00044 IteratorAtom_BOOL,
00045 IteratorAtom_INT16,
00046 IteratorAtom_INT32,
00047 IteratorAtom_INT64,
00048 IteratorAtom_CHAR,
00049 IteratorAtom_DOUBLE,
00050 IteratorAtom_STRING,
00051 IteratorAtom_IDENT,
00052 IteratorAtom_OID,
00053 IteratorAtom_IDR,
00054 IteratorAtom_LISTSEP
00055 #endif
00056 };
00057
00058 struct IteratorAtom {
00059 IteratorAtomType type;
00060
00061 char *fmt_str;
00062
00063 union {
00064 eyedblib::int16 i16;
00065 eyedblib::int32 i32;
00066 eyedblib::int64 i64;
00067 char c;
00068 double d;
00069 char *str;
00070 eyedbsm::Oid oid;
00071 struct {
00072 Size size;
00073 Data idr;
00074 } data;
00075 #ifndef NEW_ITER_ATOM
00076 Bool b;
00077 char *ident;
00078 Bool open;
00079 #endif
00080 };
00081
00082 IteratorAtom();
00083 IteratorAtom(const IteratorAtom&);
00084
00085 Value* toValue() const;
00086
00087 operator Value *() {
00088 return toValue();
00089 }
00090
00091 void print(FILE * = stdout);
00092 char *getString();
00093 int getSize() const;
00094
00095 IteratorAtom &operator =(const IteratorAtom &);
00096 void code(Data *, Offset *, Size *);
00097 void decode(Data, Offset *);
00098
00099 void garbage();
00100 IteratorAtom *next;
00101
00102 static void makeValueArray(IteratorAtom **atoms, int count,
00103 ValueArray &valarray);
00104 ~IteratorAtom();
00105 };
00106
00107 }
00108
00109 #endif