00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef _H_object
00023 #define _H_object
00024
00025 typedef struct defclassModule DEFCLASS_MODULE;
00026 typedef struct defclass DEFCLASS;
00027 typedef struct packedClassLinks PACKED_CLASS_LINKS;
00028 typedef struct classLink CLASS_LINK;
00029 typedef struct slotName SLOT_NAME;
00030 typedef struct slotDescriptor SLOT_DESC;
00031 typedef struct messageHandler HANDLER;
00032 typedef struct instance INSTANCE_TYPE;
00033 typedef struct instanceSlot INSTANCE_SLOT;
00034
00035
00036
00037
00038 #define MAX_TRAVERSALS 256
00039 #define TRAVERSAL_BYTES 32
00040
00041 #define VALUE_REQUIRED 0
00042 #define VALUE_PROHIBITED 1
00043 #define VALUE_NOT_REQUIRED 2
00044
00045 #ifndef _H_constrct
00046 #include "constrct.h"
00047 #endif
00048 #ifndef _H_constrnt
00049 #include "constrnt.h"
00050 #endif
00051 #ifndef _H_moduldef
00052 #include "moduldef.h"
00053 #endif
00054 #ifndef _H_evaluatn
00055 #include "evaluatn.h"
00056 #endif
00057 #ifndef _H_expressn
00058 #include "expressn.h"
00059 #endif
00060 #ifndef _H_multifld
00061 #include "multifld.h"
00062 #endif
00063 #ifndef _H_symbol
00064 #include "symbol.h"
00065 #endif
00066
00067 #ifndef _H_match
00068 #include "match.h"
00069 #endif
00070 #ifndef _H_pattern
00071 #include "pattern.h"
00072 #endif
00073
00074 #define GetInstanceSlotLength(sp) GetMFLength(sp->value)
00075
00076 struct packedClassLinks
00077 {
00078 long classCount;
00079 DEFCLASS **classArray;
00080 };
00081
00082 struct defclassModule
00083 {
00084 struct defmoduleItemHeader header;
00085 };
00086
00087 struct defclass
00088 {
00089 struct constructHeader header;
00090 unsigned installed : 1;
00091 unsigned system : 1;
00092 unsigned abstract : 1;
00093 unsigned reactive : 1;
00094 unsigned traceInstances : 1;
00095 unsigned traceSlots : 1;
00096 unsigned id;
00097 unsigned busy,
00098 hashTableIndex;
00099 PACKED_CLASS_LINKS directSuperclasses,
00100 directSubclasses,
00101 allSuperclasses;
00102 SLOT_DESC *slots,
00103 **instanceTemplate;
00104 unsigned *slotNameMap;
00105 short slotCount;
00106 short localInstanceSlotCount;
00107 short instanceSlotCount;
00108 short maxSlotNameID;
00109 INSTANCE_TYPE *instanceList,
00110 *instanceListBottom;
00111 HANDLER *handlers;
00112 unsigned *handlerOrderMap;
00113 short handlerCount;
00114 DEFCLASS *nxtHash;
00115 BITMAP_HN *scopeMap;
00116 char traversalRecord[TRAVERSAL_BYTES];
00117 };
00118
00119 struct classLink
00120 {
00121 DEFCLASS *cls;
00122 struct classLink *nxt;
00123 };
00124
00125 struct slotName
00126 {
00127 unsigned hashTableIndex,
00128 use;
00129 short id;
00130 SYMBOL_HN *name,
00131 *putHandlerName;
00132 struct slotName *nxt;
00133 long bsaveIndex;
00134 };
00135
00136 struct instanceSlot
00137 {
00138 SLOT_DESC *desc;
00139 unsigned valueRequired : 1;
00140 unsigned override : 1;
00141 unsigned short type;
00142 void *value;
00143 };
00144
00145 struct slotDescriptor
00146 {
00147 unsigned shared : 1;
00148 unsigned multiple : 1;
00149 unsigned composite : 1;
00150 unsigned noInherit : 1;
00151 unsigned noWrite : 1;
00152 unsigned initializeOnly : 1;
00153 unsigned dynamicDefault : 1;
00154 unsigned defaultSpecified : 1;
00155 unsigned noDefault : 1;
00156 unsigned reactive : 1;
00157 unsigned publicVisibility : 1;
00158 unsigned createReadAccessor : 1;
00159 unsigned createWriteAccessor : 1;
00160 unsigned overrideMessageSpecified : 1;
00161 DEFCLASS *cls;
00162 SLOT_NAME *slotName;
00163 SYMBOL_HN *overrideMessage;
00164 void *defaultValue;
00165 CONSTRAINT_RECORD *constraint;
00166 unsigned sharedCount;
00167 long bsaveIndex;
00168 INSTANCE_SLOT sharedValue;
00169 };
00170
00171 struct instance
00172 {
00173 struct patternEntity header;
00174 void *partialMatchList;
00175 INSTANCE_SLOT *basisSlots;
00176 unsigned installed : 1;
00177 unsigned garbage : 1;
00178 unsigned initSlotsCalled : 1;
00179 unsigned initializeInProgress : 1;
00180 unsigned reteSynchronized : 1;
00181 SYMBOL_HN *name;
00182 int depth;
00183 unsigned hashTableIndex;
00184 unsigned busy;
00185 DEFCLASS *cls;
00186 INSTANCE_TYPE *prvClass,*nxtClass,
00187 *prvHash,*nxtHash,
00188 *prvList,*nxtList;
00189 INSTANCE_SLOT **slotAddresses,
00190 *slots;
00191 };
00192
00193 struct messageHandler
00194 {
00195 unsigned system : 1;
00196 unsigned type : 2;
00197 unsigned mark : 1;
00198 unsigned trace : 1;
00199 unsigned busy;
00200 SYMBOL_HN *name;
00201 DEFCLASS *cls;
00202 short minParams;
00203 short maxParams;
00204 short localVarCount;
00205 EXPRESSION *actions;
00206 char *ppForm;
00207 struct userData *usrData;
00208 };
00209
00210 #endif
00211
00212
00213
00214
00215