GridLab
Grid Application Toolkit

A simple API for Grid Applications
GAT

Menu



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

GATJobDescription.h

Go to the documentation of this file.
00001 /** @file GATJobDescription.h
00002  *  Header file for the GATJobDescription class.
00003  *
00004  *  An instance of this class describes a job to be run.
00005  *
00006  *  @date Thu Oct 23 2003
00007  *
00008  *  @version $Header: /export/cvs-gridlab/wp-1/Codes/GATEngine/C-reference/src/GATJobDescription.h,v 1.8 2004/03/24 19:30:58 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(_GATJOBDESCRIPTION_H_)
00020 #define  _GATJOBDESCRIPTION_H_
00021 
00022 /* GAT Header Files */
00023 #include "GATObject.h"
00024 #include "GATType.h"
00025 #include "GATSoftwareDescription.h"
00026 #include "GATResourceDescription.h"
00027 
00028 /* Structures, unions and enums */
00029 #include "GATContext.h"
00030 
00031 #ifdef __cplusplus
00032 extern "C" {
00033 #endif
00034 
00035 /* Declare the converters to/from GATObject */
00036 GATOBJECT_DECLARE_CONVERTERS(GATJobDescription);
00037 
00038 /** GATJobDescription_Create
00039  *  @brief Create a new GATJobDescription object
00040  *
00041  *  The function @c GATJobDescription_Create creates a new 
00042  *  GATJobDescription object
00043  *
00044  *  @param context The GAT context to use while thie initialisation of the 
00045  *        new object.
00046  *  @param software The software description of the job to describe.
00047  *  @param resource The resource description for the job to describe.
00048  *
00049  *  @return Returns a handle to the newly created GATJobDescription object.
00050  *        Returns 0 (zero) if an error occurs.
00051  */
00052 GATJobDescription 
00053 GATJobDescription_Create_Description(GATContext context, 
00054   GATSoftwareDescription_const software, 
00055   GATResourceDescription_const resource);
00056 
00057 /** GATJobDescription_Create
00058  *  @brief Create a new GATJobDescription object
00059  *
00060  *  The function @c GATJobDescription_Create creates a new 
00061  *  GATJobDescription object
00062  *
00063  *  @param context The GAT context to use while thie initialisation of the 
00064  *        new object.
00065  *  @param software The software description of the job to describe.
00066  *  @param resource The resource for the job to describe.
00067  *
00068  *  @return Returns a handle to the newly created GATJobDescription object.
00069  *        Returns 0 (zero) if an error occurs.
00070  */
00071 GATJobDescription 
00072 GATJobDescription_Create(GATContext context, 
00073   GATSoftwareDescription_const software, GATResource_const resource);
00074 
00075 /** void GATJobDescription_Destroy(GATJobDescription *resource)
00076  *
00077  *  The function GATJobDescription_Destroy is the destructor used to
00078  *  free all the memory allocated by an GATJobDescription instance.
00079  *
00080  *  @param object The pointer to the GATJobDescription to destroy
00081  */
00082 void
00083   GATJobDescription_Destroy(GATJobDescription *object);
00084 
00085 /** GATJobDescription_Equals
00086  *  @brief Compare two GATJobDescription objects
00087  *
00088  *  The function @c GATJobDescription_Equals compares two objects of the
00089  *  @c GATJobDescription type.
00090  *
00091  *  @param lhs The first list to compare
00092  *  @param rhs The second list to compare
00093  *  @param isequal The pointer to the location, where the outcome of the 
00094  *        function has to be stored.
00095  *
00096  *  @return An error code.
00097  */
00098 GATResult
00099   GATJobDescription_Equals(GATJobDescription_const lhs,
00100     GATJobDescription_const rhs, GATBool *isequal);
00101 
00102 /** GATJobDescription_Clone
00103  *  @brief Clone the given GATJobDescription
00104  *
00105  *  The function @c GATJobDescription_Clone generates a (deep) copy of 
00106  *  the given GATJobDescription. 
00107  *
00108  *  @param description The object to clone
00109  *  @param new_object The pointer, through which the result is to be 
00110  *        returned.
00111  *
00112  *  @return An error type.
00113  */
00114 GATResult
00115   GATJobDescription_Clone(GATJobDescription_const object, 
00116     GATJobDescription *new_object);
00117 
00118 /** GATType GATJobDescription_GetType(GATJobDescription_const resource)
00119  *  @brief Return the type of the GATJobDescription
00120  *
00121  *  The function @c GATJobDescription_GetType always returns 
00122  *  @c #GATType_GATJobDescription. 
00123  *
00124  *  @param object The object to inspect
00125  *
00126  *  @return Returns always @c #GATType_GATJobDescription. 
00127  */
00128 GATType
00129   GATJobDescription_GetType(GATJobDescription_const object);
00130 
00131 /** GATResult GATJobDescription_GetInterface(GATJobDescription_const file, GATInterface iftype, void const **ifp)
00132  *  @brief Get an interface supported by a GATObject
00133  *
00134  *  The function GATJobDescription_GetInterface allows to get a pointer to an 
00135  *  additional interface supported by this GATJobDescription.
00136  *
00137  *  @param object The object to be asked for the new interface.
00138  *  @param iftype The interface the object is to be asked for.
00139  *  @param ifp The pointer, through which the result is to be returned.
00140  *
00141  *  @return An error type.
00142  */
00143 GATResult  
00144 GATJobDescription_GetInterface(GATJobDescription_const object, 
00145   GATInterface iftype, void const **ifp);
00146 
00147 
00148 /* JobDescription API */
00149 
00150 /* Return the software description describing this job */
00151 GATSoftwareDescription_const
00152   GATJobDescription_GetSoftwareDescription(GATJobDescription_const object);
00153 
00154 /* Return the of the resources the job can be run on */
00155 GATResourceDescription_const
00156   GATJobDescription_GetResourceDescription(GATJobDescription_const object);
00157   
00158 /* Return the resource the job SHOULD be run on */
00159 GATResource_const
00160   GATJobDescription_GetResource(GATJobDescription_const object);
00161 
00162 
00163 /* Serialisation API */
00164   
00165 #define GATJOBDESCRIPTION_VERSION1    0x0100
00166 #define GATJOBDESCRIPTION_LASTVERSION GATJOBDESCRIPTION_VERSION1
00167 #define GATJOBDESCRIPTION_MINOR_MASK  0x00ff
00168 
00169 /** GATResult  GATJobDescription_Serialise(GATJobDescription file, GATObject stream, GATBool clear_dirty)
00170  *  @brief Serialise a GATJobDescription object
00171  *
00172  *  The function GATJobDescription_Serialise serialises the given 
00173  *  GATJobDescription object into the given stream. 
00174  *
00175  *  @param object The GATJobDescription object to serialise.
00176  *  @param stream The stream interface to use for the serialisation.
00177  *  @param clear_dirty If the clear_dirty parameter is set to GATTrue, the 
00178  *        internal dirty flag of this object is to be reset (no used here)
00179  *
00180  *  @return An error code.
00181  */
00182 GATResult  
00183   GATJobDescription_Serialise(GATJobDescription object, GATObject stream, 
00184     GATBool clear_dirty);
00185 
00186 /** GATJobDescription GATJobDescription_DeSerialise(GATContext context, GATObject stream, GATBool clear_dirty)
00187  *  @brief De-serialise a GATJobDescription object
00188  *
00189  *  The function GATJobDescription_DeSerialise de-serialises a streamed 
00190  *  GATJobDescription object from the given stream  It constructs a new 
00191  *  instance of the de-serialised object.
00192  *
00193  *  @param context The GAT context to be used for object construction.
00194  *  @param stream The stream interface to use for the serialisation.
00195  *  @param result The pointer to a variable, which receives the status code of
00196  *        the operation.
00197  *
00198  *  @return The newly constructed GATJobDescription object.
00199  */
00200 GATJobDescription 
00201   GATJobDescription_DeSerialise(GATContext context, GATObject stream, 
00202     GATResult *result);
00203 
00204 /** GATJobDescription_GetIsDirty
00205  *  
00206  *  The function GATJobDescription_GetIsDirty retrieves the status of the dirty 
00207  *  flag of this GATJobDescription object.
00208  *
00209  *  @param object The GATJobDescription object to inspect for its dirty status.
00210  *  @param isdirty The pointer to a variable, which receives the dirty status.
00211  *
00212  *  @return An error code.
00213  */
00214 GATResult  
00215   GATJobDescription_GetIsDirty(GATJobDescription_const object, GATBool *isdirty);
00216 
00217 #ifdef __cplusplus
00218 } /* extern "C" */
00219 #endif
00220 
00221 #endif /* !defined(_GATJOBDESCRIPTION_H_) */