Main Page Alphabetical List Compound List File List Compound Members File Members
GATResourceBroker.c File ReferenceSource file for the GATResourceBroker class.
More...
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include "GAT.h"
#include "GATInternal.h"
#include "GATRegistry.h"
#include "GATResourceBrokerCPI.h"
Include dependency graph for GATResourceBroker.c:
Go to the source code of this file.
|
Functions |
| | GATLIST_IMPLEMENT (extern, GATResource, GATList_GATResource, GATType_GATResource) |
| | GATOBJECT_DEFINE_VTABLE (GATResourceBroker) |
| | GATOBJECT_DEFINE_CONVERTERS (GATResourceBroker) struct GATResourceBroker_S |
| GATResult | GATResourceBroker_GetCPIInstanceData (GATResourceBroker object, void **data) |
| GATResult | GATResourceBroker_SetJobEnvironment (GATResourceBroker broker, GATJobDescription description, GATJobID_const gatjobid) |
| GATResourceBroker | GATResourceBroker_Create (GATContext context, GATPreferences_const preferences, GATString vo_name) |
| | GATResourceBroker_Create Create a new GATResourceBroker object.
|
| void | GATResourceBroker_Destroy (GATResourceBroker *object) |
| | void GATResourceBroker_Destroy(GATResourceBroker *resource)
|
| GATResult | GATResourceBroker_Equals (GATResourceBroker_const lhs, GATResourceBroker_const rhs, GATBool *isequal) |
| | GATResourceBroker_Equals Compare two GATResourceBroker objects.
|
| GATResult | GATResourceBroker_Clone (GATResourceBroker_const handle, GATResourceBroker *new_handle) |
| | GATResourceBroker_Clone Clone the given GATResourceBroker.
|
| GATType | GATResourceBroker_GetType (GATResourceBroker_const object) |
| | GATType GATResourceBroker_GetType(GATResourceBroker_const resource) Return the type of the GATResourceBroker.
|
| GATResult | GATResourceBroker_GetInterface (GATResourceBroker_const object, GATInterface iftype, void const **ifp) |
| | int GATResourceBroker_GetInterface(GATResourceBroker_const file, GATInterface iftype, void const **ifp) Get an interface supported by a GATObject
|
| GATResult | GATResourceBroker_ReserveResource_Description (GATResourceBroker broker, GATResourceDescription_const description, GATTime_const time_of_start, GATTimePeriod_const duration, GATReservation *reservation) |
| | GATResourceBroker_ReserveResource_Description reserve a resource matching the description.
|
| GATResult | GATResourceBroker_ReserveResource (GATResourceBroker broker, GATResource_const resource, GATTime_const time_of_start, GATTimePeriod_const duration, GATReservation *reservation) |
| | GATResourceBroker_ReserveResource Reserve a given resource.
|
| GATResult | GATResourceBroker_FindResources (GATResourceBroker broker, GATResourceDescription_const description, GATList_GATResource *resources) |
| | GATResourceBroker_FindResources Find a list of matching resources.
|
| GATResult | GATResourceBroker_SubmitJob (GATResourceBroker broker, GATJobDescription_const description, GATJob *job) |
| | GATResourceBroker_SubmitJob Submit a new job.
|
Variables |
| const char * | rcsid = "$Header: /export/cvs-gridlab/wp-1/Codes/GATEngine/C-reference/src/GATResourceBroker.c,v 1.18 2004/04/20 12:33:22 hartmutkaiser Exp $" |
| GATResourceBroker_vtable | GATResourceBroker__vtable |
Detailed Description
Source file for the GATResourceBroker class.
An instance of this class is used to broker Resources. A resource can either be a node or a component.
- Date:
-
Thu Oct 23 2003
- Version:
-
- Header:
-
/export/cvs-gridlab/wp-1/Codes/GATEngine/C-reference/src/GATResourceBroker.c,v 1.18 2004/04/20 12:33:22 hartmutkaiser Exp
Copyright (C) Hartmut Kaiser This file is part of the GAT Engine. Contributed by Hartmut Kaiser <hartmutkaiser [at] t-online [dot] de>.
Use, modification and distribution is subject to the Gridlab Software License. (See accompanying file GLlicense.txt or copy at http://www.gridlab.org/GLlicense.txt)
Definition in file GATResourceBroker.c.
Function Documentation
| GATLIST_IMPLEMENT |
( |
extern |
, |
|
|
GATResource |
, |
|
|
GATList_GATResource |
, |
|
|
GATType_GATResource |
|
|
) |
|
|
|
|
Definition at line 583 of file GATResourceBroker.c.
References GAT_CREATE_STATUS, GAT_INVALID_HANDLE, GAT_RETURN_STATUS, GAT_USES_STATUS, GATContext_internal_GetSelf(), GATJobDescription, GATJobDescription_internal_GetEnvironment(), GATJobID_const, GATResourceBroker, GATSelf_const, GATSelf_internal_GetGATJobId(), GATString_GetBuffer(), and GATTable_Add_String().
Referenced by GATResourceBroker_SubmitJob(). |
|
|
GATResourceBroker_Create Create a new GATResourceBroker object.
The function GATResourceBroker_Create creates a new GATResourceBroker object - Parameters:
-
| context |
The GAT context to use while the initialisation of the new object. |
| preferences |
The preferences to use while selecting the adaptor for the corresponding CPI. |
- Returns:
-
Returns a handle to the newly created GATResourceBroker object. Returns 0 (zero) if an error occurs.
Definition at line 94 of file GATResourceBroker.c.
References GAT_MEMORYFAILURE, GAT_NO_MATCHING_CPI, GAT_NO_REGISTERED_CPI, GAT_SUCCEEDED, GAT_SUCCESS, GATBool, GATContext_GetPreferences(), GATContext_internal_GetRegistry(), GATFalse, GATPreferences_const, GATRegistry_const, GATResourceBroker, GATResourceBroker__vtable, GATResourceBroker_Destroy(), GATResourceBrokerCPI_CreateInstance(), GATResult, GATString_Clone(), and GATTrue.
Referenced by main(). |
|
|
GATResourceBroker_Equals Compare two GATResourceBroker objects.
The function GATResourceBroker_Equals compares two objects of the GATResourceBroker type. - Parameters:
-
| lhs |
The first list to compare |
| rhs |
The second list to compare |
| isequal |
The pointer to the GATBool variable, which should receive the result if the comparision |
- Returns:
-
An error code.
Definition at line 210 of file GATResourceBroker.c.
References GAT_INVALID_HANDLE, GAT_INVALID_PARAMETER, GAT_SUCCEEDED, GAT_SUCCESS, GATBool, GATFalse, GATResourceBroker_const, GATResourceBrokerCPI_EqualsInstance(), GATResult, GATString_Equals(), and GATTrue. |
|
|
GATResourceBroker_Clone Clone the given GATResourceBroker.
The function GATResourceBroker_Clone generates a (deep) copy of the given GATResourceBroker. - Parameters:
-
| description |
The object to clone |
| new_object |
The pointer, through which the result is to be returned. |
- Returns:
-
An error type.
Definition at line 258 of file GATResourceBroker.c.
References assert, GAT_CREATE_STATUS, GAT_CURRENT_STATUS, GAT_FAILED, GAT_INVALID_HANDLE, GAT_INVALID_PARAMETER, GAT_MEMORYFAILURE, GAT_SUCCEEDED, GAT_USES_STATUS, GATResourceBroker, GATResourceBroker__vtable, GATResourceBroker_const, GATResourceBroker_Destroy(), GATResourceBrokerCPI_CloneInstance(), GATString_Clone(), and handle. |
|
|
int GATResourceBroker_GetInterface(GATResourceBroker_const file, GATInterface iftype, void const **ifp) Get an interface supported by a GATObject
The function GATResourceBroker_GetInterface allows to get a pointer to an additional interface supported by this GATResourceBroker. - 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 369 of file GATResourceBroker.c.
References GAT_CREATE_STATUS, GAT_INVALID_HANDLE, GAT_INVALID_PARAMETER, GAT_NO_INTERFACE, GAT_RETURN_STATUS, GAT_STATUS_APIENTRY, GAT_UNUSED_PARAMETER, GATInterface, and GATResourceBroker_const. |
|
|
GATResourceBroker_ReserveResource_Description reserve a resource matching the description.
The function GATResourceBroker_ReserveResource_Description tries to find a resource, which matches the provided description and returns a reservation for this resource. - Parameters:
-
| broker |
The resource broker to use for this operation. |
| description |
The resource description needed for selecting the required resource. |
| time |
The (optional) time, when the reservation has to start. |
| duration |
The (optional) time period for which to reserve the resource. |
| reservation |
The pointer to the GATReservation variable to use to return the resulting reservation. |
- Returns:
-
An error code.
Definition at line 413 of file GATResourceBroker.c.
References GAT_CREATE_STATUS, GAT_INVALID_HANDLE, GAT_RETURN_STATUS, GAT_STATUS_APIENTRY, GATReservation, GATResourceBroker, GATResourceBrokerCPI_ReserveResource_Description(), GATResourceDescription_const, GATTime_const, and GATTimePeriod_const. |
|
|
GATResourceBroker_ReserveResource Reserve a given resource.
The function GATResourceBroker_ReserveResource tries to reserve the given resource and returns a reservation for this resource. - Parameters:
-
| broker |
The resource broker to use for this operation. |
| context |
The associated GAT context. |
| resource |
The resource to reserve. |
| time |
The (optional) time, when the reservation has to start. |
| duration |
The (optional) time period for which to reserve the resource. |
| reservation |
The pointer to the GATReservation variable to use to return the resulting reservation. |
- Returns:
-
An error value.
Definition at line 446 of file GATResourceBroker.c.
References GAT_CREATE_STATUS, GAT_INVALID_HANDLE, GAT_RETURN_STATUS, GAT_STATUS_APIENTRY, GATReservation, GATResource_const, GATResourceBroker, GATResourceBrokerCPI_ReserveResource(), GATTime_const, and GATTimePeriod_const. |
|
|
GATResourceBroker_SubmitJob Submit a new job.
The function GATResourceBroker_SubmitJob submits a new job to the resource described by the given job description. - Parameters:
-
| broker |
The resource broker to use for this operation. |
| description |
The job description containing the information about the job iteslf and the resource to use. |
| job |
The pointer to a variable receiving the resulting GATJob object handle. |
- Returns:
-
An error value.
Definition at line 501 of file GATResourceBroker.c.
References GAT_CREATE_STATUS, GAT_INVALID_HANDLE, GAT_RETURN_STATUS, GAT_STATUS_APIENTRY, GATContext_internal_GetSelf(), GATJob, GATJob_internal_SetGATJobId(), GATJobDescription, GATJobDescription_Clone(), GATJobDescription_const, GATJobDescription_Destroy(), GATResourceBroker, GATResourceBroker_SetJobEnvironment(), GATResourceBrokerCPI_SubmitJob(), GATResult, GATSelf_const, GATSelf_internal_CreateGATJobId(), and GATString_Destroy().
Referenced by main(). |
Variable Documentation
const char* rcsid = "$Header: /export/cvs-gridlab/wp-1/Codes/GATEngine/C-reference/src/GATResourceBroker.c,v 1.18 2004/04/20 12:33:22 hartmutkaiser Exp $" [static]
|
|
| GATResourceBroker_vtable GATResourceBroker__vtable
|
|
|