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 #include "eyedb_p.h"
00026 #include <iostream>
00027
00028 namespace eyedb {
00029
00030 extern void oqlctbMake(Object **);
00031 extern void utilsMake(Object **);
00032
00033
00034
00035
00036
00037 StructClass::StructClass(const char *s, Class *p) :
00038 AgregatClass(s, p)
00039 {
00040 parent = (p ? p : Struct_Class);
00041 setClass(StructClass_Class);
00042 type = _StructClass_Type;
00043 }
00044
00045 StructClass::StructClass(const char *s, const Oid *poid) :
00046 AgregatClass(s, poid)
00047 {
00048 parent = 0;
00049 setClass(StructClass_Class);
00050 type = _StructClass_Type;
00051 }
00052
00053 StructClass::StructClass(Database *_db, const char *s,
00054 Class *p) : AgregatClass(_db, s, p)
00055 {
00056 parent = (p ? p : Struct_Class);
00057 setClass(StructClass_Class);
00058 type = _StructClass_Type;
00059 }
00060
00061 StructClass::StructClass(Database *_db, const char *s,
00062 const Oid *poid) : AgregatClass(_db, s, poid)
00063 {
00064 parent = 0;
00065 setClass(StructClass_Class);
00066 type = _StructClass_Type;
00067 }
00068
00069
00070 extern void sysclsMake(Object **);
00071
00072 Object *StructClass::newObj(Database *_db) const
00073 {
00074 if (!idr_objsz)
00075 return 0;
00076
00077 Struct *t = new Struct(_db);
00078
00079 ObjectPeer::make(t, this, 0, _Struct_Type, idr_objsz,
00080 idr_psize, idr_vsize);
00081 newObjRealize(t);
00082
00083
00084
00085
00086
00087
00088 if (!ObjectPeer::isGRTObject(t)) {
00089 sysclsMake((Object **)&t);
00090 oqlctbMake((Object **)&t);
00091 utilsMake((Object **)&t);
00092 }
00093 return t;
00094 }
00095
00096 StructClass::StructClass(const Oid &_oid, const char *_name)
00097 : AgregatClass(_oid, _name)
00098 {
00099 type = _StructClass_Type;
00100 }
00101
00102 Status
00103 StructClass::loadComplete(const Class *cl)
00104 {
00105 assert(cl->asStructClass());
00106 Status s = Class::loadComplete(cl);
00107 if (s) return s;
00108 return Success;
00109 }
00110
00111 Object *StructClass::newObj(Data data, Bool _copy) const
00112 {
00113 if (!idr_objsz)
00114 return 0;
00115
00116 Struct *t = new Struct();
00117
00118 ObjectPeer::make(t, this, data, _Struct_Type, idr_objsz,
00119 idr_psize, idr_vsize, _copy);
00120 newObjRealize(t);
00121
00122
00123
00124 if (!ObjectPeer::isGRTObject(t)) {
00125 sysclsMake((Object **)&t);
00126 oqlctbMake((Object **)&t);
00127 utilsMake((Object **)&t);
00128 }
00129
00130 return t;
00131 }
00132 }