00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef _GATOBJECT_H_
00022 #define _GATOBJECT_H_ 1
00023
00024 #include "GATType.h"
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 #define GATOBJECT_DECLARE_CONVERTERS_QUALIFIED_EX(qualifier, type, base) \
00035 qualifier type base ## _To ## type(base object); \
00036 qualifier base type ## _To ## base(type derived); \
00037 qualifier type ## _const base ## _To ## type ## _const( \
00038 base ## _const object); \
00039 qualifier base ## _const type ## _To ## base ## _const( \
00040 type ## _const derived) \
00041
00042
00043 #define GATOBJECT_DECLARE_CONVERTERS_QUALIFIED(qualifier, type) \
00044 GATOBJECT_DECLARE_CONVERTERS_QUALIFIED_EX(qualifier, type, GATObject) \
00045
00046
00047 #define GATOBJECT_DECLARE_CONVERTERS(type) \
00048 GATOBJECT_DECLARE_CONVERTERS_QUALIFIED(extern, type) \
00049
00050
00051
00052 #define GATOBJECT_DEFINE_CONVERTERS_QUALIFIED_EX( \
00053 qualifier, type, gattype, base) \
00054 \
00055 qualifier type base ## _To ## type(base object) \
00056 { \
00057 return (gattype == GATObject_GetType(base ## _ToGATObject(object))) ? \
00058 (type)object : 0; \
00059 } \
00060 \
00061 qualifier base type ## _To ## base(type derived) \
00062 { \
00063 return (base) derived; \
00064 } \
00065 \
00066 qualifier type ## _const base ## _To ## type ## _const( \
00067 base ## _const object) \
00068 { \
00069 return (gattype == GATObject_GetType(base ## _ToGATObject_const(object))) ? \
00070 (type ## _const) object : 0; \
00071 } \
00072 \
00073 qualifier base ## _const type ## _To ## base ## _const( \
00074 type ## _const derived) \
00075 { \
00076 return (base ## _const) derived; \
00077 } \
00078
00079
00080 #define GATOBJECT_DEFINE_CONVERTERS_QUALIFIED(qualifier, type, gattype) \
00081 GATOBJECT_DEFINE_CONVERTERS_QUALIFIED_EX( \
00082 qualifier, type, gattype, GATObject) \
00083
00084
00085 #define GATOBJECT_DEFINE_CONVERTERS(type) \
00086 GATOBJECT_DEFINE_CONVERTERS_QUALIFIED(extern, type, GATType_ ## type) \
00087
00088
00089 #ifdef __cplusplus
00090 extern "C" {
00091 #endif
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105 GATType GATObject_GetType(GATObject_const object);
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115 void GATObject_Destroy(GATObject *object);
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129 GATResult GATObject_Equals(GATObject_const lhs, GATObject_const rhs,
00130 GATBool *isequal);
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144 GATResult GATObject_Clone(GATObject_const object, GATObject *result);
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158 GATResult GATObject_GetInterface(GATObject_const object, GATInterface iftype,
00159 void const **ifp);
00160
00161 GATResult GATObject_GetCPIInstanceData(GATObject object, void **data);
00162
00163
00164 GATObject GATObject_ToGATObject(GATObject object);
00165 GATObject_const GATObject_ToGATObject_const(GATObject_const object);
00166
00167
00168 GATResult
00169 GATSerialisable_Serialise(GATObject object, GATObject stream,
00170 GATBool clear_dirty);
00171 GATObject
00172 GATSerialisable_DeSerialise(GATContext context, GATObject stream, GATResult *result);
00173 GATResult
00174 GATSerialisable_GetIsDirty(GATObject_const object, GATBool *isdirty);
00175
00176
00177 GATResult
00178 GATStreamable_Read(GATObject object, void *buffer,
00179 GATuint32 size, GATuint32 *read_bytes);
00180 GATResult
00181 GATStreamable_Write(GATObject object, void const *buffer,
00182 GATuint32 size, GATuint32 *written_bytes);
00183 GATResult
00184 GATStreamable_Seek(GATObject object, GATOrigin origin, GATint32 offset,
00185 GATuint32 *new_position);
00186
00187
00188 GATResult
00189 GATMonitorable_AddMetricListener(GATObject object,
00190 GATMetricListener listener, void *listener_data, GATMetric metric,
00191 GATuint32 *cookie);
00192
00193 GATResult
00194 GATMonitorable_RegisterPolling(GATObject object,
00195 GATMetric metric, GATMetricEvent *event, GATuint32 *cookie);
00196
00197 GATResult
00198 GATMonitorable_RemoveRegisteredMetric(GATObject object,
00199 GATMetric metric, GATuint32 cookie);
00200
00201 struct GATList_GATMetric_handle;
00202 GATResult
00203 GATMonitorable_GetMetrics(GATObject_const object,
00204 struct GATList_GATMetric_handle **metrics);
00205
00206
00207 GATResult
00208 GATResource_GetResourceDescription(GATObject_const object,
00209 GATResourceDescription_const *description);
00210
00211 GATResult
00212 GATResource_GetReservation(GATObject_const object,
00213 GATReservation_const *reservation);
00214
00215
00216 GATResult
00217 GATuint32_Serialise(GATuint32 data, GATObject stream);
00218 GATResult
00219 GATuint32_DeSerialise(GATObject stream, GATuint32 *data);
00220
00221 #ifdef __cplusplus
00222 }
00223 #endif
00224
00225 #endif