00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #if !defined(_GATINTERNAL_H_)
00018 #define _GATINTERNAL_H_
00019
00020 #include "GATObject.h"
00021 #include "GATInterfaceMap.h"
00022 #include "GATMonitorable.h"
00023
00024
00025 typedef struct GATSelfCPI_S *GATSelfCPI;
00026 typedef struct GATSelfCPI_S const *GATSelfCPI_const;
00027
00028
00029
00030
00031 #define GATOBJECT_DEFINE_VTABLE(type) \
00032 typedef GATType (* type ## _GetTypeProc)(type ## _const); \
00033 typedef void (* type ## _DestroyProc)(type *); \
00034 typedef GATResult (* type ## _EqualsProc)(type ## _const, type ## _const, \
00035 GATBool *); \
00036 typedef GATResult (* type ## _CloneProc)(type ## _const, type *); \
00037 typedef GATResult (* type ## _GetInterfaceProc)(type ## _const, \
00038 GATInterface, void const **); \
00039 typedef GATResult (* type ## _GetCPIInstanceDataProc)(type, void **data); \
00040 \
00041 typedef struct type ## _vtable_S { \
00042 type ## _GetTypeProc get_type; \
00043 type ## _DestroyProc destroy; \
00044 type ## _EqualsProc equals; \
00045 type ## _CloneProc clone; \
00046 type ## _GetInterfaceProc get_interface; \
00047 type ## _GetCPIInstanceDataProc get_instancedata; \
00048 } type ## _vtable \
00049
00050
00051
00052 #define GATSERIALISABLE_DEFINE_VTABLE(type) \
00053 typedef GATResult (* type ## _SerialiseProc)(type, GATObject, GATBool); \
00054 typedef type (* type ## _DeSerialiseProc)(GATContext, GATObject, GATResult *); \
00055 typedef GATResult (* type ## _GetIsDirtyProc)(type ## _const, GATBool *); \
00056 \
00057 typedef struct type ## _ISerialisable_vtable_S { \
00058 type ## _SerialiseProc serialise; \
00059 type ## _DeSerialiseProc deserialise; \
00060 type ## _GetIsDirtyProc isdirty; \
00061 } type ## _ISerialisable_vtable \
00062
00063
00064
00065 #define GATSTREAMABLE_DEFINE_VTABLE(type) \
00066 typedef GATResult (* type ## _ReadProc)(type, void *, GATuint32, \
00067 GATuint32 *); \
00068 typedef GATResult (* type ## _WriteProc)(type, void const *, GATuint32, \
00069 GATuint32 *); \
00070 typedef GATResult (* type ## _SeekProc)(type, GATOrigin, GATint32, \
00071 GATuint32 *); \
00072 typedef GATResult (* type ## _CloseProc)(type); \
00073 \
00074 typedef struct type ## _IStreamable_vtable_S { \
00075 type ## _ReadProc sread; \
00076 type ## _WriteProc swrite; \
00077 type ## _SeekProc seek; \
00078 type ## _CloseProc closestream; \
00079 } type ## _IStreamable_vtable \
00080
00081
00082
00083
00084 #define GATASYNCSTREAMABLE_DEFINE_VTABLE(type) \
00085 typedef GATResult (* type ## _ReadProcA)(type, void *, GATuint32, \
00086 GATuint32 *); \
00087 typedef GATResult (* type ## _WriteProcA)(type, void const *, GATuint32, \
00088 GATuint32 *); \
00089 typedef GATResult (* type ## _SeekProcA)(type, GATOrigin, GATint32, \
00090 GATuint32 *); \
00091 typedef GATResult (* type ## _CloseProcA)(type); \
00092 typedef GATResult (* type ## _IReadProcA)(type, void *, GATuint32); \
00093 typedef GATResult (* type ## _ReadFinishProcA)(type, GATBool *, \
00094 GATuint32 *); \
00095 typedef GATResult (* type ## _ReadTestProcA)(type, GATBool *); \
00096 typedef GATResult (* type ## _IWriteProcA)(type, void const *, GATuint32); \
00097 typedef GATResult (* type ## _WriteFinishProcA)(type, GATuint32 *); \
00098 typedef GATResult (* type ## _WriteTestProcA)(type, GATuint32 *); \
00099 \
00100 typedef struct type ## _IAsyncStreamable_vtable_S { \
00101 type ## _ReadProcA sread; \
00102 type ## _WriteProcA swrite; \
00103 type ## _SeekProcA seek; \
00104 type ## _CloseProcA closestream; \
00105 type ## _IReadProcA iread; \
00106 type ## _ReadFinishProcA read_finish; \
00107 type ## _ReadTestProcA read_test; \
00108 type ## _IWriteProcA iwrite; \
00109 type ## _WriteFinishProcA write_finish; \
00110 type ## _WriteTestProcA write_test; \
00111 } type ## _IAsyncStreamable_vtable \
00112
00113
00114
00115 #define GATMONITORABLE_DEFINE_VTABLE(type) \
00116 typedef GATResult (* type ## AddMetricListenerProc)(type, GATMetricListener,\
00117 void *, GATMetric, GATuint32 *); \
00118 typedef GATResult (* type ## RegisterPollingProc)(type, GATMetric, \
00119 GATMetricEvent *, GATuint32 *); \
00120 typedef GATResult (* type ## RemoveRegisteredMetricProc)(type, GATMetric, \
00121 GATuint32); \
00122 typedef GATResult (* type ## GetMetricsProc)(type ## _const, \
00123 GATList_GATMetric *); \
00124 \
00125 typedef struct type ## _IMonitorable_vtable_S { \
00126 type ## AddMetricListenerProc addlistener; \
00127 type ## RegisterPollingProc registerpolling; \
00128 type ## RemoveRegisteredMetricProc removemetric; \
00129 type ## GetMetricsProc getmetrics; \
00130 } type ## _IMonitorable_vtable \
00131
00132
00133
00134 #define GATRESOURCE_DEFINE_VTABLE(type) \
00135 typedef GATResult (* type ## GetResourceDescription)(type ## _const, \
00136 GATResourceDescription_const *); \
00137 typedef GATResult (* type ## GetReservation)(type ## _const, \
00138 GATReservation_const *); \
00139 \
00140 typedef struct type ## _IResource_vtable_S { \
00141 type ## GetResourceDescription getresourcedescription; \
00142 type ## GetReservation getreservation; \
00143 } type ## _IResource_vtable; \
00144
00145
00146
00147
00148
00149 #define GAT_UNUSED_PARAMETER(x) { if (x && !x) {int a = 1; a++; }}
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167 GATuint32 GATMetric_i_GetTypeSize(void);
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180 GATMeasurementType GATMetric_GetMeasurementType(GATMetric_const metric);
00181
00182
00183
00184 typedef GATResult (* GATMetricEvent_GetValueProc)(void *, GATType, void *,
00185 GATuint32);
00186
00187
00188 GATResult
00189 GATRegistry_internal_AddGATSelfToCPIList(GATRegistry registry,
00190 GATSelfCPI cpi, GATSelf object);
00191
00192 GATResult
00193 GATRegistry_internal_RemoveGATSelfFromCPIList(GATRegistry registry,
00194 GATSelfCPI cpi, GATSelf object);
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208 GATSelf
00209 GATContext_internal_GetSelf(GATContext self);
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220 GATRegistry
00221 GATContext_internal_GetRegistry(GATContext self);
00222
00223
00224
00225 GATResult
00226 GATSelf_internal_GetGATJobId(GATSelf_const self, GATContext context,
00227 GATString_const *gatjobid);
00228
00229 GATResult
00230 GATSelf_internal_CreateGATJobId(GATSelf_const self, GATContext context,
00231 GATString *gatjobid);
00232
00233 GATSelf
00234 GATSelf_internal_GetInstance(GATContext error_context);
00235
00236 GATRegistry
00237 GATSelf_internal_GetRegistry(GATSelf self);
00238
00239 GATResult
00240 GATSelf_internal_AddContext(GATSelf self, GATContext context);
00241
00242 void
00243 GATSelf_internal_RemoveContext(GATSelf self, GATContext context);
00244
00245
00246
00247
00248
00249
00250
00251
00252
00253
00254
00255
00256
00257
00258 GATResult
00259 GATJob_internal_SetGATJobId(GATJob job, GATString_const gatjobid);
00260
00261
00262
00263
00264
00265
00266
00267
00268
00269
00270
00271
00272
00273
00274 GATResult
00275 GATJobDescription_internal_GetEnvironment(GATJobDescription jd,
00276 GATTable *env);
00277
00278
00279
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289
00290
00291
00292 GATResult
00293 GATTable_internal_Get_GATObjectRef(GATTable_const table, const void *key,
00294 GATObject *object);
00295
00296
00297
00298
00299
00300
00301
00302
00303
00304
00305
00306
00307
00308
00309 GATResult
00310 GATSoftwareDescription_internal_GetAttributesRef(
00311 GATSoftwareDescription_const object, GATTable *attr);
00312
00313
00314 #endif