GridLab
Grid Application Toolkit

A simple API for Grid Applications
GAT

Menu



Main Page   Alphabetical List   Compound List   File List   Compound Members   File Members  

GATResourceCPIInstanceData.h

Go to the documentation of this file.
00001 /** @file GATResourceCPIInstanceData.h
00002  *  Header file for the GATResourceCPIInstance_Data class, which represents the 
00003  *  internal data stored by the ResourceCPI provider for the resource broker 
00004  *  adaptor.
00005  *
00006  *  @date Thu Nov 27 2003
00007  *
00008  *  @version $Header: /export/cvs-gridlab/wp-1/Codes/GATEngine/C-reference/adaptors/resourcebroker/GATResourceCPIInstanceData.h,v 1.4 2004/03/30 12:02:19 hartmutkaiser Exp $
00009  *
00010  *  Copyright (C) Hartmut Kaiser
00011  *  This file is part of the GAT Engine.
00012  *  Contributed by Hartmut Kaiser <hartmutkaiser [at] t-online [dot] de>.
00013  *
00014  *  Use, modification and distribution is subject to the Gridlab Software
00015  *  License. (See accompanying file GLlicense.txt or copy at
00016  *  http://www.gridlab.org/GLlicense.txt)
00017  */
00018 
00019 #if !defined(_GATRESOURCECPIINSTANCEDATA_H_)
00020 #define _GATRESOURCECPIINSTANCEDATA_H_
00021 
00022 #include "GAT.h"
00023 
00024 /* Instance data */
00025 typedef struct GATResourceCPIInstance_Data 
00026 {
00027   GATResourceDescription rd;   /* resource description of the resource to create */
00028 } GATResourceCPIInstance_Data;
00029 
00030 /* Instance data */
00031 
00032 /** GATResourceCPIInstance_Data_Create
00033  *
00034  *  The function GATResourceCPIInstance_Data_Create creates a new instance of
00035  *  the internal GATResource data.
00036  *
00037  *  @param rd The description of the GATResource to create.
00038  *
00039  *  @return The pointer to the newly created and initialised data structure.
00040  */
00041 GATResourceCPIInstance_Data *
00042   GATResourceCPIInstance_Data_Create(GATResourceDescription_const rd);
00043 
00044 /** GATResourceCPIInstance_Data_Destroy
00045  *
00046  *  The function GATResourceCPIInstance_Data_Destroy is called to free all the
00047  *  memory associated with the given instance data item.
00048  *
00049  *  @param instance_data The pointer to a variable holding the old instance 
00050  *        data item, this is set to zero on exit.
00051  */
00052 void 
00053   GATResourceCPIInstance_Data_Destroy(GATResourceCPIInstance_Data **);
00054 
00055 /** GATResourceCPIInstance_Data_Clone
00056  *
00057  *  The function GATResourceCPIInstance_Data_Clone is called to make a copy of 
00058  *  the given instance data item.
00059  *
00060  *  @param instance_data The instance data item to copy.
00061  *  @param new_instance_Data The pointer to a variable, which receives the 
00062  *        newly created copy of the instance data item.
00063  *
00064  *  @return An error code.
00065  */
00066 GATResult 
00067   GATResourceCPIInstance_Data_Clone(GATResourceCPIInstance_Data const *, 
00068     GATResourceCPIInstance_Data **);
00069 
00070 /** GATResourceCPIInstance_Data_Equals
00071  *
00072  *  The function GATResourceCPIInstance_Data_Equals is called, whenever the 
00073  *  engine needs to compare for equality two different instance data items.
00074  *
00075  *  @param lhs The first instance data item to compare.
00076  *  @param rhs The second instance data item to compare.
00077  *  @param isequal The pointer to a variable, which receives the result of the
00078  *        compare operation.
00079  *
00080  *  @result An error code.
00081  */
00082 GATResult 
00083   GATResourceCPIInstance_Data_Equals(GATResourceCPIInstance_Data const *, 
00084     GATResourceCPIInstance_Data const *, GATBool *);
00085 
00086 /** GATResourceCPIInstance_Data_GetResourceDescription
00087  *
00088  *  The function GATResourceCPIInstance_Data_GetResourceDescription may be used
00089  *  to access the associated resource description of the target resource.
00090  *
00091  *  @param instance_data The instance data item, for which the resource 
00092  *        description is to be retrieved.
00093  *  @param description The pointer to a variable, which receives the resulting 
00094  *        resource description.
00095  *
00096  *  @return An error code.
00097  */
00098 GATResult
00099   GATResourceCPIInstance_Data_GetResourceDescription(
00100     GATResourceCPIInstance_Data const *instance_data, 
00101     GATResourceDescription_const *description);
00102 
00103 /** GATResourceCPIInstance_Data_Serialize
00104  *
00105  *  The function GATResourceCPIInstance_Data_Serialize is called by the engine, 
00106  *  whenever the instance specific data has to be serialised. The function 
00107  *  should serialise into the given stream all the instance specific data of 
00108  *  the object.
00109  *
00110  *  @param instance_data The instance data item to serialise.
00111  *  @param stream The stream to be used for serialisation of the instance data.
00112  *  @param clear_dirty If the clear_dirty parameter is set to GATTrue, the 
00113  *        internal dirty flag of this object is to be reset.
00114  *
00115  *  @return An error code.
00116  */
00117 GATResult 
00118   GATResourceCPIInstance_Data_Serialize(
00119     GATResourceCPIInstance_Data const *instance_data, GATObject stream,
00120     GATBool clear_dirty);
00121   
00122 /** GATResourceCPIInstance_Data_DeSerialize
00123  *
00124  *  The function GATResourceCPIInstance_Data_DeSerialize is called by the engine, 
00125  *  whenever the client requested a DeSerialise operation for
00126  *  a corresponding object. The function should deserialise all the instance 
00127  *  specific data of the object from the given stream.
00128  *
00129  *  @param context The GATContext to use to instantiate new GAT objects.
00130  *  @param stream The stream to use to get the serialised data from.
00131  *  @param instance_data The pointer to a variable, which receives the new
00132  *        instance data deserialised from the given steam.
00133  *
00134  *  @return An error code.
00135  */
00136 GATResult 
00137   GATResourceCPIInstance_Data_DeSerialize(GATContext context, GATObject stream, 
00138     GATResourceCPIInstance_Data **instance_data);
00139 
00140 #endif /* _GATRESOURCECPIINSTANCEDATA_H_ */