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_H
00026 #define _EYEDB_ITERATOR_H
00027
00028 namespace eyedb {
00029
00030
00031
00032
00033
00034
00035
00036
00037 class IteratorAtom;
00038
00039 class Iterator {
00040
00041
00042
00043
00044 public:
00045 Iterator(Class *, Bool include_subclasses = False);
00046 Iterator(const Collection *, Bool index = False);
00047 Iterator(Database *, const Attribute *, int, Data, int);
00048 Iterator(Database *, const Attribute *, int,
00049 Data, Data, Bool, Bool, int);
00050
00051 Status getStatus() const;
00052
00053 int getCount() const {return _count;}
00054
00055 Status scanNext(Bool &found, Oid &);
00056 Status scanNext(Bool &found, ObjectPtr &,
00057 const RecMode * = RecMode::NoRecurs);
00058 Status scanNext(Bool &found, Object *&,
00059 const RecMode * = RecMode::NoRecurs);
00060 Status scanNext(Bool &found, Value &);
00061
00062
00063 Status scanNext(Bool *found, Oid *);
00064 Status scanNext(Bool *found, Object **,
00065 const RecMode * = RecMode::NoRecurs);
00066 Status scanNext(Bool *found, Value *);
00067
00068 Status scan(ObjectPtrVector &, const RecMode * = RecMode::NoRecurs);
00069 Status scan(ObjectPtrVector &, unsigned int max,
00070 unsigned int start = 0, const RecMode * = RecMode::NoRecurs);
00071 Status scan(ObjectArray &, const RecMode * = RecMode::NoRecurs);
00072 Status scan(ObjectArray &, unsigned int max,
00073 unsigned int start = 0, const RecMode * = RecMode::NoRecurs);
00074 Status scan(OidArray &, unsigned int max = ~0,
00075 unsigned int start = 0);
00076 Status scan(ValueArray &, unsigned int max = ~0,
00077 unsigned int start = 0);
00078 ~Iterator();
00079
00080
00081
00082
00083 private:
00084 Status status;
00085 int curqid;
00086 int nqids;
00087 int *qid;
00088 Database *db;
00089 int curatom, readatom;
00090 int buff_len;
00091 IteratorAtom *buffatom;
00092 Bool state;
00093 void init(Database *);
00094 int _count;
00095 SchemaInfo *schinfo;
00096
00097 public:
00098 Status scanNext(Bool *found, IteratorAtom *);
00099 Status scan(int *count, IteratorAtom **);
00100 static Status initDatabase(Database *);
00101 };
00102
00103 extern void oqml_initialize();
00104 extern void oqml_release();
00105
00106 }
00107
00108 #endif