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_COLL_SET_H
00026 #define _EYEDB_COLL_SET_H
00027
00028 namespace eyedb {
00029
00038 class CollSet : public Collection {
00039
00040
00041
00042
00043 public:
00052 CollSet(Database *db, const char *n, Class *mc = NULL,
00053 Bool isref = True,
00054 const IndexImpl *idximpl = 0);
00055
00064 CollSet(Database *db, const char *n, Class *mc, int dim,
00065 const IndexImpl *idximpl = 0);
00066
00071 CollSet(const CollSet &o);
00072
00078 CollSet& operator=(const CollSet &o);
00079
00084 virtual Object *clone() const {return new CollSet(*this);}
00085
00092 virtual CollSet *asCollSet() {return this;}
00093
00098 virtual const CollSet *asCollSet() const {return this;}
00099
00100
00101
00102
00103 private:
00104 void init();
00105
00106 const char *getClassName() const;
00107 CollSet(const char *, Class *,
00108 const Oid&, const Oid&, int,
00109 int, int, const IndexImpl *,
00110 Object *, Bool, Bool, Data, Size);
00111 friend class CollectionPeer;
00112
00113
00114
00115
00116 public:
00117 CollSet(const char *, Class * = NULL, Bool = True,
00118 const IndexImpl * = 0);
00119 CollSet(const char *, Class *, int,
00120 const IndexImpl * = 0);
00121
00122 Status insert_p(const Oid &item_oid, Bool noDup = False);
00123 Status insert_p(const Object *item_o, Bool noDup = False);
00124 Status insert_p(Data data, Bool noDup = False, Size size = defaultSize);
00125 };
00126
00127 class CollSetPtr : public CollectionPtr {
00128
00129 public:
00130 CollSetPtr(CollSet *o = 0) : CollectionPtr(o) { }
00131
00132 CollSet *getCollSet() {return dynamic_cast<CollSet *>(o);}
00133 const CollSet *getCollSet() const {return dynamic_cast<CollSet *>(o);}
00134
00135 CollSet *operator->() {return dynamic_cast<CollSet *>(o);}
00136 const CollSet *operator->() const {return dynamic_cast<CollSet *>(o);}
00137 };
00138
00139 typedef std::vector<CollSetPtr> CollSetPtrVector;
00140
00145 }
00146
00147 #endif