Main Page Alphabetical List Compound List File List Compound Members File Members
GATObject.c File Reference#include "xds_p.h"
#include "GAT.h"
#include "GATInternal.h"
#include "GATInterfaceMap.h"
Include dependency graph for GATObject.c:
Go to the source code of this file.
|
Compounds |
| struct | GATObject_S |
| struct | GATSerialise_S |
| struct | GATStreamable_S |
| struct | GATMonitorable_S |
| struct | GATResource_S |
Functions |
| | GATOBJECT_DEFINE_VTABLE (GATObject) |
| | GATSERIALISABLE_DEFINE_VTABLE (GATObject) |
| | GATSTREAMABLE_DEFINE_VTABLE (GATObject) |
| | GATMONITORABLE_DEFINE_VTABLE (GATObject) |
| | GATRESOURCE_DEFINE_VTABLE (GATObject) |
| GATType | GATObject_GetType (GATObject_const object) |
| | GATType GATObject_GetType(GATObject const object) Get the type from a GATObject.
|
| void | GATObject_Destroy (GATObject *object) |
| | void GATObject_Destroy(GATObject *object) Destroy a GATObject
|
| GATResult | GATObject_Equals (GATObject_const lhs, GATObject_const rhs, GATBool *isequal) |
| | int GATObject_Equals(GATObject const lhs, GATObject const rhs, GATBool *isequal) Compare to GATObject's
|
| GATResult | GATObject_Clone (GATObject_const object, GATObject *new_object) |
| | int GATObject_Clone(GATObject const object, GATObject *new_object) Clone a GATObject
|
| GATResult | GATObject_GetInterface (GATObject_const object, GATInterface iftype, void const **ifp) |
| | int GATObject_GetInterface(GATObject_const object, GATInterface iftype, void const **ifp) Get an interface supported by a GATObject
|
| GATResult | GATObject_GetCPIInstanceData (GATObject object, void **data) |
| | GATObject_GetCPIInstanceData Get an the CPI instance dat associated with this CPI object.
|
| GATObject | GATObject_ToGATObject (GATObject object) |
| GATObject_const | GATObject_ToGATObject_const (GATObject_const object) |
| GATResult | GATSerialisable_Serialise (GATObject object, GATObject stream, GATBool clear_dirty) |
| | int GATSerialisable_Serialise(GATObject object, GATObject stream, GATBool clear_dirty) Serialise a GATObject object
|
| GATObject | GATSerialisable_DeSerialise (GATContext context, GATObject stream, GATResult *result) |
| | GATObject GATSerialisable_DeSerialise(GATContext context, GATObject stream, GATBool clear_dirty) De-serialise a GATObject object.
|
| GATResult | GATSerialisable_GetIsDirty (GATObject_const object, GATBool *isdirty) |
| | int GATSerialisable_GetIsDirty(GATObject_const object, GATBool *isdirty) Return the status of the dirty flag of an object
|
| GATResult | GATStreamable_Read (GATObject object, void *buffer, GATuint32 size, GATuint32 *read_bytes) |
| | int GATStreamable_Read(GATObject object, void *buffer, GATuint32 size, GATuint32 *read_bytes) Read a given amount of bytes from the given stream
|
| GATResult | GATStreamable_Write (GATObject object, void const *buffer, GATuint32 size, GATuint32 *written_bytes) |
| | int GATStreamable_Write(GATObject object, void const *buffer, GATuint32 size, GATuint32 *written_bytes) Writes a given amount of bytes to the given stream
|
| GATResult | GATStreamable_Seek (GATObject object, GATOrigin origin, GATint32 offset, GATuint32 *new_position) |
| | int GATStreamable_Seek(GATObject object, GATOrigin origin, GATint32 offset, GATuint32 *new_position) Writes a given amount of bytes to the given stream
|
| GATResult | GATMonitorable_AddMetricListener (GATObject object, GATMetricListener listener, void *listener_data, GATMetric metric, GATuint32 *cookie) |
| GATResult | GATMonitorable_RegisterPolling (GATObject object, GATMetric metric, GATMetricEvent *event, GATuint32 *cookie) |
| GATResult | GATMonitorable_RemoveRegisteredMetric (GATObject object, GATMetric metric, GATuint32 cookie) |
| GATResult | GATMonitorable_GetMetrics (GATObject_const object, GATList_GATMetric *metrics) |
| GATResult | GATResource_GetResourceDescription (GATObject_const object, GATResourceDescription_const *description) |
| GATResult | GATResource_GetReservation (GATObject_const object, GATReservation_const *reservation) |
| GATResult | GATuint32_Serialise (GATuint32 data, GATObject stream) |
| | int GATuint32_Serialise(GATuint32 data, GATObject stream)
|
| GATResult | GATuint32_DeSerialise (GATObject stream, GATuint32 *data) |
| | int GATuint32_DeSerialize(GATuint32 data, GATObject stream)
|
Variables |
| const char * | rcsid = "$Header: /export/cvs-gridlab/wp-1/Codes/GATEngine/C-reference/src/GATObject.c,v 1.34 2004/04/18 18:35:10 hartmutkaiser Exp $" |
Function Documentation
|
|
GATType GATObject_GetType(GATObject const object) Get the type from a GATObject.
The function GATObject_GetType implements a generic way to return the actual type of a given GATObject. - Parameters:
-
| object |
The GATObject, for which its type has to be returned |
- Returns:
-
The
#GATType of the object under inspection
Definition at line 79 of file GATObject.c.
References GATObject_const, GATType, and GATType_NoType.
Referenced by GATAdvertService_Add(), GATJobDescription_Create_Description(), GATJobDescription_DeSerialise_Create(), GATResourceCPI_SerialiseCallback(), GATResourceDescription_GetType(), GATSerialisable_Serialise(), test_GATTable_Serialising(), test_positives(), test_remove_double(), test_remove_float(), test_remove_int(), test_remove_short(), test_remove_string(), test_remove_unknown(), test_std_file_attriutes(), and test_sw_attributes(). |
| void GATObject_Destroy |
( |
GATObject * |
object |
) |
|
|
|
|
void GATObject_Destroy(GATObject *object) Destroy a GATObject
The function GATObject_Destroy implements a generic way to destroy an arbitrary GATObject. - Parameters:
-
| object |
The GATObject, which has to be destroyed. |
Definition at line 97 of file GATObject.c.
Referenced by advertservice_adaptor_GATAdvertServiceCPI_GetAdvertisable(), GATEndpoint_DeSerialise(), GATFile_DeSerialise(), GATJob_DeSerialise(), GATJobDescription_DeSerialise(), GATJobDescription_Destroy(), GATList_DeSerialise_Items(), GATList_i_Destroy(), GATList_i_Erase(), GATLogicalFile_DeSerialise(), GATMetricEvent_Destroy(), GATSerialisable_DeSerialise(), GATTable_Add_GATObject(), GATTable_DeSerialise_Create(), GATTable_Destroy(), GATTable_Remove(), main(), resourcebroker_adaptor_ResourceBrokerCPI_FindResources(), and test_GATTable_Serialising(). |
|
|
int GATObject_Equals(GATObject const lhs, GATObject const rhs, GATBool *isequal) Compare to GATObject's
The function GATObject_Equals allows to compare generically two arbitrary GATObject's. - Parameters:
-
| lhs |
The first GATObject to compare. |
| rhs |
The second GATObject to compare. |
| isequal |
The pointer, through which the result is to be returned. |
- Returns:
-
An error code.
Definition at line 115 of file GATObject.c.
References GAT_INVALID_HANDLE, GAT_INVALID_PARAMETER, GATBool, GATFalse, GATObject_const, and GATResult.
Referenced by GATList_i_Compare(), GATMetricEvent_Equals(), and GATTable_Equals(). |
|
|
int GATObject_Clone(GATObject const object, GATObject *new_object) Clone a GATObject
The function GATObject_Clone allows to get a exact copy of an arbitrary GATObject. If the object to copy is a container object (i.e. GATTable, GATList or similar), all the contained therein elements are copied too. - Parameters:
-
| object |
The object to be copied. |
| new_object |
The pointer, through which the result is to be returned. |
- Returns:
-
An error type.
Definition at line 152 of file GATObject.c.
References GAT_INVALID_HANDLE, GATObject_const, and GATResult.
Referenced by GATList_i_Insert(), GATMetricEvent_Clone(), GATMetricEvent_Create_Continuous(), GATMetricEvent_Create_EventLike(), and GATTable_Add_GATObject(). |
|
|
int GATObject_GetInterface(GATObject_const object, GATInterface iftype, void const **ifp) Get an interface supported by a GATObject
The function GATObject_GetInterface allows to get a pointer to an additional interface supported by this GATObject. - Parameters:
-
| object |
The object to be asked for the new interface. |
| iftype |
The interface the object is to be asked for. |
| ifp |
The pointer, through which the result is to be returned. |
- Returns:
-
An error type.
Definition at line 174 of file GATObject.c.
References GAT_INVALID_HANDLE, GAT_NOTIMPL, GATInterface, GATObject_const, and GATResult.
Referenced by GATMonitorable_AddMetricListener(), GATMonitorable_GetMetrics(), GATMonitorable_RegisterPolling(), GATMonitorable_RemoveRegisteredMetric(), GATResource_GetReservation(), GATResource_GetResourceDescription(), GATSerialisable_GetIsDirty(), GATSerialisable_Serialise(), GATStreamable_Read(), GATStreamable_Seek(), and GATStreamable_Write(). |
|
|
GATObject_GetCPIInstanceData Get an the CPI instance dat associated with this CPI object.
The function GATObject_GetCPIInstanceData allows to get a pointer to the CPI instance data associated with the give object. Note, that this function returns meaningful result only for CPI objects. - Parameters:
-
| object |
The object to be asked for the new interface. |
| data |
The pointer to a variable, which should receive the reuslting CPI instance data. |
- Returns:
-
An error type.
Definition at line 206 of file GATObject.c.
References GATObject_S::__vtable, data, GAT_INVALID_HANDLE, GAT_NOTIMPL, and GATResult. |
|
|
int GATSerialisable_Serialise(GATObject object, GATObject stream, GATBool clear_dirty) Serialise a GATObject object
The function GATSerialisable_Serialise serialises the given GATObject object into the given stream in a generic way. - Parameters:
-
| object |
The GATObject object to serialise. |
| stream |
The stream interface to use for the serialisation. |
| clear_dirty |
If the clear_dirty parameter is set to GATTrue, the internal dirty flag of this object is to be reset. |
- Returns:
-
An error code.
Definition at line 250 of file GATObject.c.
References GATSerialise_S::__vtable, GAT_NOTIMPL, GAT_SUCCESS, GATBool, GATInterface_ISerialisable, GATObject_GetInterface(), GATObject_GetType(), GATResult, GATuint32, and GATuint32_Serialise().
Referenced by advertservice_adaptor_GATAdvertServiceCPI_Add(), GATList_i_SerialiseItems(), main(), test_GATTable_Serialising(), verify_GATList_GATint32_serialization(), verify_GATList_GATList_GATint32_serialization(), verify_GATList_String_serialization(), verify_generic_serialisation(), and xml_encode_object(). |
|
|
GATObject GATSerialisable_DeSerialise(GATContext context, GATObject stream, GATBool clear_dirty) De-serialise a GATObject object.
The function GATSerialisable_DeSerialise de-serialises a streamed GATObject object from the given stream in a generic way. It constructs a new instance of the de-serialised object. - Parameters:
-
| context |
The GAT context to be used for object construction. |
| stream |
The stream interface to use for the serialisation. |
| result |
The pointer to a variable, which receives the status code of the operation. |
- Returns:
-
The newly constructed object.
Definition at line 293 of file GATObject.c.
References GAT_SUCCESS, GATObject_Destroy(), GATObject_Get_GATSerialisable(), GATResult, GATType, GATType_NoType, GATuint32, and GATuint32_DeSerialise().
Referenced by advertservice_adaptor_GATAdvertServiceCPI_GetAdvertisable(), GATList_DeSerialise_Items(), main(), test_GATTable_Serialising(), verify_GATList_String_serialization(), verify_generic_serialisation(), and xml_decode_object(). |
|
|
int GATStreamable_Read(GATObject object, void *buffer, GATuint32 size, GATuint32 *read_bytes) Read a given amount of bytes from the given stream
The function GATStreamable_Read tries to read from the given stream the given amount of data in a generic way. - Parameters:
-
| object |
The object, which GATStreamable interface to use to access the stream |
| buffer |
The buffer to read the data to. |
| size |
The size of the buffer (maximum amount of data to read). |
| read_bytes |
The pointer to a variable, which receives the number of bytes, actually returned in the buffer. This value is valid only, if no error occurs (optional, may be zero). |
- Returns:
-
An error code.
Definition at line 377 of file GATObject.c.
References GATStreamable_S::__vtable, GAT_NOTIMPL, GAT_SUCCESS, GATInterface_IStreamable, GATObject_GetInterface(), GATResult, GATuint32, and size.
Referenced by GATList_i_DeSerialise(), GATTable_DeSerialise(), GATuint32_DeSerialise(), and GATXds_DeSerialiseObject(). |
|
|
int GATStreamable_Write(GATObject object, void const *buffer, GATuint32 size, GATuint32 *written_bytes) Writes a given amount of bytes to the given stream
The function GATStreamable_Write tries to write to the given stream the given amount of data in a generic way. - Parameters:
-
| object |
The object, which GATStreamable interface to use to access the stream |
| buffer |
The buffer containing the data to write to the stream. |
| size |
The size of the buffer (amount of data to write). |
| written_bytes |
The pointer to a variable, which receives the number of bytes actually written. This value is valid only, if no error occurs (optional, may be zero). |
- Returns:
-
An error code.
Definition at line 415 of file GATObject.c.
References GATStreamable_S::__vtable, GAT_NOTIMPL, GAT_SUCCESS, GATInterface_IStreamable, GATObject_GetInterface(), GATResult, GATuint32, and size.
Referenced by GATList_i_Serialise(), GATTable_Serialise(), GATuint32_Serialise(), and GATXds_SerialiseObject(). |
|
|
int GATStreamable_Seek(GATObject object, GATOrigin origin, GATint32 offset, GATuint32 *new_position) Writes a given amount of bytes to the given stream
The function GATStreamable_Write tries to write to the given stream the given amount of data in a generic way. - Parameters:
-
| object |
The object, which GATStreamable interface to use to access the stream |
| origin |
The point inside the stream, relative to which the pointer positioning is to be done. |
| offset |
The amount of bytes the logical position inside the stream is to be moved. |
| new_position |
The pointer to a variable, which receives the new logical position inside the stream object (optional, may be zero). |
- Returns:
-
An error code.
Definition at line 454 of file GATObject.c.
References GATStreamable_S::__vtable, GAT_NOTIMPL, GAT_SUCCESS, GATint32, GATInterface_IStreamable, GATObject_GetInterface(), GATOrigin, GATResult, and GATuint32.
Referenced by GATEndpoint_DeSerialise_Create(), GATFile_DeSerialise_Create(), GATJob_DeSerialise_Create(), GATList_i_DeSerialise(), GATLogicalFile_DeSerialise_Create(), GATResource_DeSerialise_Create(), GATTable_DeSerialise(), GATuint32_DeSerialise(), and GATXds_DeSerialiseObject(). |
|
|
int GATuint32_Serialise(GATuint32 data, GATObject stream)
The GATuint32_Serialise function serialises a GATuint32 value into the given stream. - Parameters:
-
| data |
The GATuint32 data item to serialise (write). |
| stream |
The stream to use for serialisation. |
- Returns:
-
An error code.
Definition at line 626 of file GATObject.c.
References assert, data, GAT_FAIL, GATResult, GATStreamable_Write(), GATuint32, and XDS_TO_GAT.
Referenced by endpoint_adaptor_EndpointCPI_Serialise(), GATJobCPIInstance_Data_Serialize(), GATSerialisable_Serialise(), and xml_encode_object(). |
|
|
int GATuint32_DeSerialize(GATuint32 data, GATObject stream)
The GATuint32_DeSerialize function de-serialises a GATuint32 value into the given stream. - Parameters:
-
| stream |
The stream to use for serialisation. |
| data |
The GATuint32 data item to de-serialise (read). |
- Returns:
-
An error code.
Definition at line 662 of file GATObject.c.
References data, GAT_SUCCESS, GATOrigin_Current, GATResult, GATStreamable_Read(), GATStreamable_Seek(), GATuint32, and XDS_TO_GAT.
Referenced by endpoint_adaptor_EndpointCPI_DeSerialise(), GATSerialisable_DeSerialise(), and xml_decode_object(). |
Variable Documentation
const char* rcsid = "$Header: /export/cvs-gridlab/wp-1/Codes/GATEngine/C-reference/src/GATObject.c,v 1.34 2004/04/18 18:35:10 hartmutkaiser Exp $" [static]
|
|
|