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_AGREGAT_H
00026 #define _EYEDB_AGREGAT_H
00027
00028 namespace eyedb {
00029
00038 class Agregat : public Instance {
00039
00040
00041
00042
00043 public:
00049 Agregat(Database *db = 0, const Dataspace *dataspace = 0);
00050
00055 Agregat(const Agregat &o);
00056
00062 Agregat(const Agregat *o, Bool share = False);
00063
00068 Agregat& operator=(const Agregat &o);
00069
00076 Status setValue(Data data);
00077
00084 Status getValue(Data* data) const;
00085
00092 Status setItemSize(const Attribute* agreg, Size size);
00093
00100 Status getItemSize(const Attribute* agreg, Size* psize) const;
00101
00110 Status setItemValue(const Attribute* agreg, Data data, int nb=1, int from=0);
00111
00120 Status setItemOid(const Attribute* agreg, const Oid * poid, int nb=1, int from=0, Bool check_class = True);
00121
00130 Status getItemOid(const Attribute *agreg, Oid *poid, int nb = 1, int from = 0) const;
00131
00137 virtual Status realize(const RecMode* recmode = RecMode::NoRecurs);
00138
00144 virtual Status remove(const RecMode* recmode = RecMode::NoRecurs);
00145
00153 virtual Status trace(FILE* fd = stdout, unsigned int flags = 0,
00154 const RecMode * recmode = RecMode::FullRecurs) const;
00155
00160 virtual Agregat *asAgregat() {return this;}
00161
00166 virtual const Agregat *asAgregat() const {return this;}
00167
00170 virtual ~Agregat();
00171
00172
00173
00174
00175 protected:
00176 Status checkAgreg(const Attribute*) const;
00177 Status create();
00178 Status update();
00179 virtual void garbage();
00180 #ifdef GBX_NEW_CYCLE
00181 virtual void decrRefCountPropag();
00182 #endif
00183 void initialize(Database *);
00184
00185
00186
00187
00188 private:
00189 void copy(const Agregat *, Bool);
00190
00191 Status trace_realize(FILE*, int, unsigned int, const RecMode *) const;
00192 Status create_realize(Bool);
00193 Status update_realize(Bool);
00194
00195
00196
00197
00198 public:
00199 virtual void manageCycle(gbxCycleContext &);
00200
00201 Status realizePerform(const Oid& cloid,
00202 const Oid& objoid,
00203 AttrIdxContext &idx_ctx,
00204 const RecMode *);
00205 Status loadPerform(const Oid& cloid,
00206 LockMode,
00207 AttrIdxContext &idx_ctx,
00208 const RecMode* = RecMode::NoRecurs);
00209 Status removePerform(const Oid& cloid,
00210 const Oid& objoid,
00211 AttrIdxContext &idx_ctx,
00212 const RecMode *);
00213 };
00214
00215 class AgregatPtr : public InstancePtr {
00216
00217 public:
00218 AgregatPtr(Agregat *o = 0) : InstancePtr(o) { }
00219
00220 Agregat *getAgregat() {return dynamic_cast<Agregat *>(o);}
00221 const Agregat *getAgregat() const {return dynamic_cast<Agregat *>(o);}
00222
00223 Agregat *operator->() {return dynamic_cast<Agregat *>(o);}
00224 const Agregat *operator->() const {return dynamic_cast<Agregat *>(o);}
00225 };
00226
00227 typedef std::vector<AgregatPtr> AgregatPtrVector;
00228
00233 }
00234
00235 #endif