GridLab
Grid Application Toolkit

A simple API for Grid Applications
GAT

Menu



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

GATResourceCPI.c File Reference

Source file for the GATResourceCPI class. More...

#include <stdio.h>
#include <stdlib.h>
#include "GATErrors.h"
#include "GATResourceCPI.h"

Include dependency graph for GATResourceCPI.c:

Include dependency graph

Go to the source code of this file.

Compounds

struct  GATResourceCPI_S

Functions

GATBool GATResourceCPI_IsValidData_V1 (GATResourceCPI_Data *data)
GATResourceCPI GATResourceCPI_Create (unsigned long int version, GATResourceCPI_Data *data)
 GATResourceCPI_Create The GATResourceCPI constructor.

void GATResourceCPI_Destroy (GATResourceCPI *object)
 GATResourceCPI_Destroy The GATResourceCPI destructor.

GATResult GATResourceCPI_CreateInstance (GATResourceCPI cpi, GATResourceCPI_Instance *instance_data, void *initialisation_data)
 GATResourceCPI_CreateInstance Create a new CPI object instance.

void GATResourceCPI_DestroyInstance (GATResourceCPI cpi, GATResourceCPI_Instance *instance_data)
 GATResourceCPI_DestroyInstance Create a new CPI object instance.

GATResult GATResourceCPI_EqualsInstance (GATResourceCPI cpi, GATResourceCPI_Instance const *lhs, GATResourceCPI_Instance const *rhs, GATBool *isequal)
 GATResourceCPI_EqualsInstance Compares two CPI object instances.

GATResult GATResourceCPI_CloneInstance (GATResourceCPI cpi, GATResourceCPI_Instance const *instance_data, GATResourceCPI_Instance *new_instance_data)
 GATResourceCPI_CloneInstance Clones a CPI object instance.

GATResult GATResourceCPI_GetResourceDescription (GATResourceCPI cpi, GATResourceCPI_Instance const *instance_data, GATResourceDescription_const *description)
 GATResourceCPI_GetResourceDescription Returns the associated resource description.

GATResult GATResourceCPI_GetReservation (GATResourceCPI cpi, GATResourceCPI_Instance const *instance_data, GATReservation_const *reservation)
 GATResourceCPI_GetReservation Returns the associated reservation.

GATResult GATResourceCPI_GetMetrics (GATResourceCPI cpi, GATResourceCPI_Instance const *data, GATList_GATMetric *metrics)
 GATResourceCPI_GetMetrics.

GATResult GATResourceCPI_GetMetricEvent (GATResourceCPI cpi, GATResourceCPI_Instance const *data, GATMetric metric, GATMetricEvent *event)
 GATResourceCPI_GetMetricEvent.

GATResult GATResourceCPI_Serialise (GATResourceCPI cpi, GATResourceCPI_Instance const *data, GATObject stream, GATBool clear_dirty)
 GATResourceCPI_Serialise Serialise the instance data.

GATResult GATResourceCPI_DeSerialise (GATResourceCPI cpi, GATObject stream, GATResourceCPI_Instance *data)
 GATResourceCPI_DeSerialise De-serialise the instance data.


Variables

const char * rcsid = "$Header: /export/cvs-gridlab/wp-1/Codes/GATEngine/C-reference/src/GATResourceCPI.c,v 1.9 2004/04/02 12:31:58 hartmutkaiser Exp $"


Detailed Description

Source file for the GATResourceCPI class.

Date:
Sat Oct 25 2003
Version:
Header:
/export/cvs-gridlab/wp-1/Codes/GATEngine/C-reference/src/GATResourceCPI.c,v 1.9 2004/04/02 12:31:58 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 GATResourceCPI.c.


Function Documentation

GATBool GATResourceCPI_IsValidData_V1 GATResourceCPI_Data   data [static]
 

Definition at line 347 of file GATResourceCPI.c.

References GATResourceCPI_Data::clone_instance, GATResourceCPI_Data::create_instance, data, GATResourceCPI_Data::deserialise, GATResourceCPI_Data::destroy, GATResourceCPI_Data::destroy_instance, GATResourceCPI_Data::equals_instance, GATFalse, GATTrue, GATResourceCPI_Data::get_metric_event, GATResourceCPI_Data::get_metrics, GATResourceCPI_Data::get_reservation, GATResourceCPI_Data::get_resource_description, and GATResourceCPI_Data::serialise.

Referenced by GATResourceCPI_Create().

GATResourceCPI GATResourceCPI_Create unsigned long int    version,
GATResourceCPI_Data   data
 

GATResourceCPI_Create The GATResourceCPI constructor.

new_cpi is the constructor for GATResourceCPI objects.

Parameters:
version  Version of the GATResourceCPI_Data structure
data  Pointer to adaptor CPI instance data structure.
Returns:
A new GATResourceCPI

Definition at line 73 of file GATResourceCPI.c.

References GATResourceCPI_S::clone_instance, GATResourceCPI_Data::clone_instance, GATResourceCPI_S::create_instance, GATResourceCPI_Data::create_instance, data, GATResourceCPI_S::data, GATResourceCPI_Data::data, GATResourceCPI_S::deserialise, GATResourceCPI_Data::deserialise, GATResourceCPI_S::destroy, GATResourceCPI_Data::destroy, GATResourceCPI_S::destroy_instance, GATResourceCPI_Data::destroy_instance, GATResourceCPI_S::equals_instance, GATResourceCPI_Data::equals_instance, GATResourceCPI_IsValidData_V1(), GATRESOURCECPI_VERSION, GATTrue, GATResourceCPI_S::get_metric_event, GATResourceCPI_Data::get_metric_event, GATResourceCPI_S::get_metrics, GATResourceCPI_Data::get_metrics, GATResourceCPI_S::get_reservation, GATResourceCPI_Data::get_reservation, GATResourceCPI_S::get_resource_description, GATResourceCPI_Data::get_resource_description, GATResourceCPI_S::serialise, GATResourceCPI_Data::serialise, GATResourceCPI_S::service_actions, and GATResourceCPI_Data::service_actions.

Referenced by resourcebroker_adaptor_Register_GATResourceCPI().

void GATResourceCPI_Destroy GATResourceCPI   object
 

GATResourceCPI_Destroy The GATResourceCPI destructor.

This is the destructor for GATResourceCPI objects.

Parameters:
this  An old GATResourceCPI

Definition at line 135 of file GATResourceCPI.c.

Referenced by resourcebroker_adaptor_Register_GATResourceCPI().

GATResult GATResourceCPI_CreateInstance GATResourceCPI    cpi,
GATResourceCPI_Instance   instance_data,
void *    initialisation_data
 

GATResourceCPI_CreateInstance Create a new CPI object instance.

Calls the adaptor to create a new CPI object instance.

Parameters:
this  The CPI object.
context  a GATContext
instance_data  The instance data of the attached CPI object
Returns:
An error code.

Definition at line 158 of file GATResourceCPI.c.

References cpi, GATResourceCPI_S::create_instance, and GATResourceCPI_S::data.

Referenced by GATResource_Impl_Create().

void GATResourceCPI_DestroyInstance GATResourceCPI    cpi,
GATResourceCPI_Instance   instance_data
 

GATResourceCPI_DestroyInstance Create a new CPI object instance.

Calls the adaptor to destroy a CPI object instance.

Parameters:
this  The CPI object.
instance_data  The instance data of the attached CPI object

Definition at line 173 of file GATResourceCPI.c.

References cpi, GATResourceCPI_S::data, and GATResourceCPI_S::destroy_instance.

Referenced by GATResource_Destroy().

GATResult GATResourceCPI_EqualsInstance GATResourceCPI    cpi,
GATResourceCPI_Instance const *    lhs,
GATResourceCPI_Instance const *    rhs,
GATBool   isequal
 

GATResourceCPI_EqualsInstance Compares two CPI object instances.

Calls the adaptor to compare two CPI object instances.

Parameters:
this  The CPI object.
lhs  The instance data of the left CPI object
rhs  The instance data of the right CPI object
isequal  The pointer to the variable, where the result is to be returned to.
Returns:
An error code.

Definition at line 193 of file GATResourceCPI.c.

References cpi, GATResourceCPI_S::data, GATResourceCPI_S::equals_instance, and GATBool.

Referenced by GATResource_Equals().

GATResult GATResourceCPI_CloneInstance GATResourceCPI    cpi,
GATResourceCPI_Instance const *    instance_data,
GATResourceCPI_Instance   new_instance_data
 

GATResourceCPI_CloneInstance Clones a CPI object instance.

Calls the adaptor to clone a CPI object instance.

Parameters:
this  The CPI object.
instance_data  The instance data of the CPI object to clone.
new_instance_data  The new instance data is to be returned here.
Returns:
An error code.

Definition at line 212 of file GATResourceCPI.c.

References GATResourceCPI_S::clone_instance, cpi, and GATResourceCPI_S::data.

Referenced by GATResource_Clone().

GATResult GATResourceCPI_GetResourceDescription GATResourceCPI    cpi,
GATResourceCPI_Instance const *    instance_data,
GATResourceDescription_const   description
 

GATResourceCPI_GetResourceDescription Returns the associated resource description.

The function GATResourceCPI_GetResourceDescription calls the adaptor to get the resource description associated with this GATResource.

Parameters:
this  The CPI object.
instance_data  The instance data of the CPI object.
description  The pointer to the variable, which receives the resulting resource description.
Returns:
An error code.

Definition at line 236 of file GATResourceCPI.c.

References cpi, GATResourceCPI_S::data, GATResourceDescription_const, and GATResourceCPI_S::get_resource_description.

Referenced by GATResource_Impl_GetResourceDescription().

GATResult GATResourceCPI_GetReservation GATResourceCPI    cpi,
GATResourceCPI_Instance const *    instance_data,
GATReservation_const   reservation
 

GATResourceCPI_GetReservation Returns the associated reservation.

The function GATResourceCPI_GetReservation calls the adaptor to get the reservation associated with this GATResource.

Parameters:
this  The CPI object.
instance_data  The instance data of the CPI object.
reservation  The pointer to a variable, which receives the resulting reservation.
Returns:
An error code.

Definition at line 257 of file GATResourceCPI.c.

References cpi, GATResourceCPI_S::data, GATReservation_const, and GATResourceCPI_S::get_reservation.

Referenced by GATResource_Impl_GetReservation().

GATResult GATResourceCPI_GetMetrics GATResourceCPI    cpi,
GATResourceCPI_Instance const *    data,
GATList_GATMetric *    metrics
 

GATResourceCPI_GetMetrics.

The function GATResourceCPI_GetMetrics returns the list of metrics supported by this adaptor.

Parameters:
cpi  The CPI object.
instance_data  The instance data of the attached CPI object
The  pointer to the variable, which receives the resulting list of metrics.
Returns:
An error code.

Definition at line 278 of file GATResourceCPI.c.

References cpi, data, GATResourceCPI_S::data, and GATResourceCPI_S::get_metrics.

Referenced by GATResource_DeSerialise_Create(), and GATResource_Impl_Create().

GATResult GATResourceCPI_GetMetricEvent GATResourceCPI    cpi,
GATResourceCPI_Instance const *    data,
GATMetric    metric,
GATMetricEvent   event
 

GATResourceCPI_GetMetricEvent.

The function GATResourceCPI_GetMetricEvent returns the metric event, which is associated with the given metric.

Parameters:
cpi  The CPI object.
instance_data  The instance data of the attached CPI object
metric  The continuous metric, for which the metric event is to be returned.
event  The pointer to the variable, which receives the resulting metric event.
Returns:
An error code.

Definition at line 299 of file GATResourceCPI.c.

References cpi, data, GATResourceCPI_S::data, GATMetric, and GATResourceCPI_S::get_metric_event.

Referenced by GATResource_Impl_RegisterPolling().

GATResult GATResourceCPI_Serialise GATResourceCPI    cpi,
GATResourceCPI_Instance const *    data,
GATObject    stream,
GATBool    clear_dirty
 

GATResourceCPI_Serialise Serialise the instance data.

Calls the adaptor to serialise the instance data.

Parameters:
this  The CPI object.
instance_data  The instance data of the attached CPI object
stream  The stream to use be used for serialisation.
Returns:
An error code.

Definition at line 318 of file GATResourceCPI.c.

References cpi, data, GATResourceCPI_S::data, GATBool, and GATResourceCPI_S::serialise.

Referenced by GATResourceCPI_SerialiseCallback().

GATResult GATResourceCPI_DeSerialise GATResourceCPI    cpi,
GATObject    stream,
GATResourceCPI_Instance   data
 

GATResourceCPI_DeSerialise De-serialise the instance data.

Call the adaptor to de-serialise the instance data.

Parameters:
context  The GAT context to be used for object construction.
stream  The stream interface to use for the serialisation.
instance_data  The pointer to a variable, which contains the client data of the new object. The member instance data of this object may receive the pointer to the new instance data of the CPI object.
Returns:
An error code.

Definition at line 338 of file GATResourceCPI.c.

References cpi, data, GATResourceCPI_S::data, and GATResourceCPI_S::deserialise.

Referenced by GATResource_DeSerialise_Create().


Variable Documentation

const char* rcsid = "$Header: /export/cvs-gridlab/wp-1/Codes/GATEngine/C-reference/src/GATResourceCPI.c,v 1.9 2004/04/02 12:31:58 hartmutkaiser Exp $" [static]
 

Definition at line 17 of file GATResourceCPI.c.