00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #if !defined(_GATRESOURCE_H_)
00018 #define _GATRESOURCE_H_
00019
00020
00021 #include "GATObject.h"
00022 #include "GATType.h"
00023 #include "GATMonitorable.h"
00024 #include "GATResourceDescription.h"
00025 #include "GATSoftwareDescription.h"
00026
00027
00028 #define GATRESOURCE_PROTOTYPE(type) \
00029 GATOBJECT_DECLARE_CONVERTERS(type); \
00030 GATOBJECT_DECLARE_CONVERTERS_QUALIFIED_EX(extern, type, GATResource); \
00031 \
00032 type type ## _Create(GATContext context, GATPreferences_const prefs, \
00033 void *instance_data); \
00034 void type ## _Destroy(type *object); \
00035 GATResult type ## _Equals(type ## _const lhs, type ## _const rhs, \
00036 GATBool *isequal); \
00037 GATResult type ## _Clone(type ## _const object, type *new_object); \
00038 GATType type ## _GetType(type ## _const object); \
00039 GATResult type ## _GetInterface(type ## _const object, GATInterface iftype, \
00040 void const **ifp); \
00041 \
00042 GATResult type ## _GetResourceDescription(type ## _const object, \
00043 type ## Description_const *); \
00044 GATResult type ## _GetReservation(type ## _const object, \
00045 GATReservation_const *); \
00046 \
00047 GATResult type ## _AddMetricListener(type object, GATMetricListener listener,\
00048 void *listener_data, GATMetric metric, GATuint32 *cookie); \
00049 GATResult type ## _RegisterPolling(type object, GATMetric metric, \
00050 GATMetricEvent *event, GATuint32 *cookie); \
00051 GATResult type ## _RemoveRegisteredMetric(type object, GATMetric metric, \
00052 GATuint32 cookie); \
00053 GATResult type ## _GetMetrics(type ## _const object, \
00054 GATList_GATMetric *metrics); \
00055 \
00056 GATResult type ## _Serialise(type object, GATObject stream, \
00057 GATBool clear_dirty); \
00058 type type ## _DeSerialise(GATContext context, GATObject stream, \
00059 GATResult *result); \
00060 GATResult type ## _GetIsDirty(type ## _const object, GATBool *isdirty) \
00061
00062
00063
00064 #define GATRESOURCE_VERSION1 0x0100
00065 #define GATRESOURCE_LASTVERSION GATRESOURCE_VERSION1
00066 #define GATRESOURCE_MINOR_MASK 0x00ff
00067
00068
00069
00070 #ifdef __cplusplus
00071 extern "C" {
00072 #endif
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092 GATResult
00093 GATResource_Clone(GATResource_const handle, GATResource *new_handle);
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106 void
00107 GATResource_Destroy(GATResource *object);
00108
00109 GATResult
00110 GATResource_Equals(GATResource_const lhs, GATResource_const rhs,
00111 GATBool *isequal);
00112
00113 GATType
00114 GATResource_GetType(GATResource_const object);
00115
00116 GATResult
00117 GATResource_GetInterface(GATResource_const object, GATInterface iftype,
00118 void const **ifp);
00119
00120
00121
00122 GATResult
00123 GATResource_Serialise(GATResource file, GATObject stream,
00124 GATBool clear_dirty);
00125
00126 GATResource
00127 GATResource_DeSerialise(GATContext context, GATObject stream,
00128 GATResult *result);
00129
00130 GATResult
00131 GATResource_GetIsDirty(GATResource_const object, GATBool *isdirty);
00132
00133
00134 GATOBJECT_DECLARE_CONVERTERS(GATResource);
00135
00136 GATRESOURCE_PROTOTYPE(GATSoftwareResource);
00137 GATRESOURCE_PROTOTYPE(GATHardwareResource);
00138
00139 #ifdef __cplusplus
00140 }
00141 #endif
00142
00143 #endif