GridLab
Grid Application Toolkit

A simple API for Grid Applications
GAT

Menu



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

GATMetric.c File Reference

Source file for the GATMetric class. More...

#include <stdlib.h>
#include <string.h>
#include "GAT.h"
#include "GATInternal.h"
#include "GATUtil.h"

Include dependency graph for GATMetric.c:

Include dependency graph

Go to the source code of this file.

Functions

 GATOBJECT_DEFINE_VTABLE (GATMetric)
 GATOBJECT_DEFINE_CONVERTERS (GATMetric) struct GATMetric_S
GATMetric GATMetric_Create (char const *name, GATTable parameters, GATMeasurementType type, GATType datatype, char const *unit)
 GATMetric_Create Create a new GATMetric object.

void GATMetric_Destroy (GATMetric *object)
 GATMetric_Destroy The GATMetric destructor.

GATResult GATMetric_Equals (GATMetric_const lhs, GATMetric_const rhs, GATBool *isequal)
 int GATMetric_Equals(GATMetric_const lhs, GATMetric_const rhs, GATBool *isequal) Compares two GATMetric objects

GATResult GATMetric_Clone (GATMetric_const handle, GATMetric *new_handle)
 int GATMetric_Clone(GATMetric_const filehandle, GATMetric *new_file) Clone the given GATMetric

GATType GATMetric_GetType (GATMetric_const description)
 int GATMetric_GetType(GATMetric_const file) Return the type of the GATMetric

GATResult GATMetric_GetInterface (GATMetric_const metric, GATInterface iftype, void const **ifp)
 int GATMetric_GetInterface(GATMetric_const table, GATInterface iftype, void const **ifp) Get an interface supported by a GATList

GATuint32 GATMetric_i_GetTypeSize (void)
 GATMetric_i_GetTypeSize.

char const * GATMetric_GetName (GATMetric_const metric)
 GATMetric_GetName.

char const * GATMetric_GetUnit (GATMetric_const metric)
 GATMetric_GetUnit.

GATType GATMetric_GetValueType (GATMetric_const metric)
 GATMetric_GetValueType.

GATResult GATMetric_GetParameters (GATMetric_const metric, GATTable *table)
 GATMetric_GetParameters.

GATType GATMetric_GetParameterTypeByName (GATMetric_const metric, char const *name)
 GATMetric_GetParameterTypeByName.

GATResult GATMetric_GetParameterByName (GATMetric_const metric, char const *name, GATType type, void *buffer, GATuint32 size)
 GATMetric_GetParameterByName.

GATMeasurementType GATMetric_GetMeasurementType (GATMetric_const metric)
 GATMetric_GetMeasurementType.

GATResult GATMetric_CreateMetric (GATStaticMetric const *data, GATMetric *metric)
 GATMetric_CreateMetric.

GATResult GATMetric_CreateListOfMetrics (GATStaticMetric *data, GATuint32 count, GATList_GATMetric *list)
 GATMetric_CreateListOfMetrics.


Variables

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


Detailed Description

Source file for the GATMetric class.

Date:
Tue Nov 4 2003
Version:
Header:
/export/cvs-gridlab/wp-1/Codes/GATEngine/C-reference/src/GATMetric.c,v 1.13 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 GATMetric.c.


Function Documentation

GATOBJECT_DEFINE_VTABLE GATMetric   
 

GATOBJECT_DEFINE_CONVERTERS GATMetric   
 

Definition at line 32 of file GATMetric.c.

References GATMeasurementType, GATMetric, GATType, and name.

GATMetric GATMetric_Create char const *    name,
GATTable    parameters,
GATMeasurementType    type,
GATType    datatype,
char const *    unit
 

GATMetric_Create Create a new GATMetric object.

The function GATMetric_Create creates a new GATMetric object.

Returns:
Returns a handle to the newly created GATMetric object. Returns 0 (zero) if an error occurs.

Definition at line 72 of file GATMetric.c.

References GAT_MEMORYFAILURE, GAT_SUCCESS, GATMeasurementType, GATMetric, GATMetric__vtable, GATMetric_Destroy(), GATResult, GATTable_Clone(), GATType, GATUtil_strdup(), and name.

Referenced by GATMetric_CreateMetric().

void GATMetric_Destroy GATMetric   object
 

GATMetric_Destroy The GATMetric destructor.

The function GATMetric_Destroy is the destructor used to free all the memory allocated by an GATMetric instance.

Parameters:
description  The pointer to the GATMetric to destroy

Definition at line 117 of file GATMetric.c.

References GATMetric, and GATTable_Destroy().

Referenced by endpoint_adaptor_FireAddGATPipeListener(), endpoint_adaptor_FireConnect(), endpoint_adaptor_FireListen(), fileops_adaptor_FileCPI_GetMetricEvent(), fileops_adaptor_FireCopiedEvent(), fileops_adaptor_FireDeletedEvent(), fileops_adaptor_FireMovedEvent(), filestream_adaptor_FireCloseEvent(), filestream_adaptor_FireReadEvent(), filestream_adaptor_FireSeekEvent(), filestream_adaptor_FireWriteEvent(), GATMetric_Clone(), GATMetric_Create(), GATMetric_CreateListOfMetrics(), GATMetricEvent_Destroy(), GATMonitorable_Impl_DestroyKey(), logicalfile_adaptor_FireReplicatedEvent(), main(), pipe_adaptor_FireCloseEvent(), pipe_adaptor_FireReadEvent(), pipe_adaptor_FireSeekEvent(), and pipe_adaptor_FireWriteEvent().

GATResult GATMetric_Equals GATMetric_const    lhs,
GATMetric_const    rhs,
GATBool   isequal
 

int GATMetric_Equals(GATMetric_const lhs, GATMetric_const rhs, GATBool *isequal) Compares two GATMetric objects

The function GATMetric_Equals compares two objects of the GATMetric type.

Parameters:
lhs  The first list to compare
rhs  The second list to compare
isequal  The pointer to the location, where the outcome of the function has to be stored.
Returns:
An error code.

Definition at line 143 of file GATMetric.c.

References GAT_INVALID_HANDLE, GAT_INVALID_PARAMETER, GAT_SUCCESS, GATBool, GATFalse, GATMetric_const, GATResult, and GATTable_Equals().

Referenced by fileops_adaptor_FileCPI_GetMetricEvent(), GATMetricEvent_Equals(), and GATMonitorable_Impl_EqualKeys().

GATResult GATMetric_Clone GATMetric_const    handle,
GATMetric   new_handle
 

int GATMetric_Clone(GATMetric_const filehandle, GATMetric *new_file) Clone the given GATMetric

The function GATMetric_Clone generates a (deep) copy of the given GATMetric.

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 181 of file GATMetric.c.

References GAT_INVALID_HANDLE, GAT_INVALID_PARAMETER, GAT_MEMORYFAILURE, GAT_SUCCESS, GATMetric, GATMetric__vtable, GATMetric_const, GATMetric_Destroy(), GATResult, GATTable_Clone(), GATUtil_strdup(), and handle.

Referenced by GATMetricEvent_Clone(), GATMetricEvent_Create_Continuous(), GATMetricEvent_Create_EventLike(), and GATMonitorable_Impl_CloneKey().

GATType GATMetric_GetType GATMetric_const    description
 

int GATMetric_GetType(GATMetric_const file) Return the type of the GATMetric

The function GATMetric_GetType always returns #GATType_GATMetric.

Parameters:
object  The object to inspect
Returns:
Returns always #GATType_GATMetric.

Definition at line 244 of file GATMetric.c.

References GAT_UNUSED_PARAMETER, GATMetric_const, and GATType_GATMetric.

GATResult GATMetric_GetInterface GATMetric_const    metric,
GATInterface    iftype,
void const **    ifp
 

int GATMetric_GetInterface(GATMetric_const table, GATInterface iftype, void const **ifp) Get an interface supported by a GATList

The function GATMetric_GetInterface allows to get a pointer to an additional interface supported by this GATMetric.

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 263 of file GATMetric.c.

References GAT_INVALID_PARAMETER, GAT_NO_INTERFACE, GAT_UNUSED_PARAMETER, GATInterface, GATMetric_const, and GATResult.

GATuint32 GATMetric_i_GetTypeSize void   
 

GATMetric_i_GetTypeSize.

Returns:
The size of the internal representation of the GATMetric type.
Remarks:
This is an internal function, do not use it directly.

Definition at line 285 of file GATMetric.c.

References GATuint32.

Referenced by GATMonitorable_Impl_GetKeySize().

char const* GATMetric_GetName GATMetric_const    metric
 

GATMetric_GetName.

The function GATMetric_GetName gets the name associated with this GATMetric.

Parameters:
metric  The metric to ask for its name.
Returns:
The name associated with this metric.

Definition at line 302 of file GATMetric.c.

References GATMetric_const, and name.

Referenced by GATMonitorable_Impl_HashKey().

char const* GATMetric_GetUnit GATMetric_const    metric
 

GATMetric_GetUnit.

The function GATMetric_GetUnit gets the measurement unit associated with this GATMetric.

Parameters:
metric  The metric to ask for its measurement unit.
Returns:
The unit associated with this metric.

Definition at line 322 of file GATMetric.c.

References GATMetric_const.

GATType GATMetric_GetValueType GATMetric_const    metric
 

GATMetric_GetValueType.

The function GATMetric_GetValueType gets the data type of the value provided by this GATMetric.

Parameters:
metric  The metric to ask for its data value type.
Returns:
The data value type associated with this metric.

Definition at line 342 of file GATMetric.c.

References GATMetric_const, GATType, and GATType_NoType.

Referenced by GATMetricEvent_Create_Continuous(), and GATMetricEvent_Create_EventLike().

GATResult GATMetric_GetParameters GATMetric_const    metric,
GATTable   table
 

GATMetric_GetParameters.

The function GATMetric_GetParameters gets the GATMetric parameter value associated with the passed GATMetric parameter name. Ther is returned a 0 (zero) if there is no GATMetric parameter value with the passed name.

Parameters:
metric  The metric to ask for its name.
table  The pointer to a variable, which receives the returned parameter table.
Returns:
An error code.

Definition at line 365 of file GATMetric.c.

References GAT_INVALID_HANDLE, GATMetric_const, GATResult, and GATTable_Clone().

GATType GATMetric_GetParameterTypeByName GATMetric_const    metric,
char const *    name
 

GATMetric_GetParameterTypeByName.

The function GATMetric_GetParameterTypeByName gets the type of the GATMetric parameter value associated with the passed GATMetric parameter name.

Parameters:
metric  The metric to ask for its name.
name  The name of the parameter to query for.
Returns:
The type of the associated value.

Definition at line 387 of file GATMetric.c.

References GATMetric_const, GATTable_Get_ElementType(), GATType, GATType_NoType, and name.

GATResult GATMetric_GetParameterByName GATMetric_const    metric,
char const *    name,
GATType    type,
void *    buffer,
GATuint32    size
 

GATMetric_GetParameterByName.

The function GATMetric_GetParameterByName gets the GATMetric parameter value associated with the passed GATMetric parameter name. There is returned a 0 (zero) if there is no GATMetric parameter value with the passed name.

Parameters:
metric  The metric to ask for its name.
name  The name of the parameter to query for.
buffer  The buffer, where the retrieved value should be returned to.
size  The size of the buffer.
Returns:
An error code.

Definition at line 413 of file GATMetric.c.

References GAT_INVALID_HANDLE, GAT_KEY_TYPE_ERROR, GATdouble64, GATfloat32, GATint16, GATint32, GATMetric_const, GATObject_const, GATResult, GATTable_Get_double(), GATTable_Get_float(), GATTable_Get_GATObject(), GATTable_Get_int(), GATTable_Get_short(), GATTable_Get_String(), GATType, GATType_GATdouble64, GATType_GATfloat32, GATType_GATint16, GATType_GATint32, GATType_GATObject, GATType_String, GATuint32, name, and size.

GATMeasurementType GATMetric_GetMeasurementType GATMetric_const    metric
 

GATMetric_GetMeasurementType.

The functions GATMetric_GetMeasurementType returns the measurment type of the value associated with the given metric.

Parameters:
metric  The metric to ask for its values measurement type.
Returns:
The requested measurement type.

Definition at line 468 of file GATMetric.c.

References GATMeasurementType, GATMeasurementType_Unknown, and GATMetric_const.

Referenced by GATMetricEvent_Create_Continuous(), GATMetricEvent_Create_EventLike(), GATMonitorable_Impl_AddMetricListener(), and GATMonitorable_Impl_RegisterPolling().

GATResult GATMetric_CreateMetric GATStaticMetric const *    data,
GATMetric   metric
 

GATMetric_CreateMetric.

The function GATMetric_CreateMetric creates a GATMetric object from a given static metric data. This is a pure helper function for adaptor writers.

Parameters:
data  The address of the static metric data.
metric  The pointer to the variable, which receives the resulting metric.
Returns:
An error code.

Definition at line 490 of file GATMetric.c.

References GATStaticParameter_S::d, data, GATStaticMetric_S::data_type, GAT_INVALID_PARAMETER, GAT_KEY_TYPE_ERROR, GAT_MEMORYFAILURE, GAT_SUCCESS, GATMetric, GATMetric_Create(), GATResult, GATTable_Add_double(), GATTable_Add_float(), GATTable_Add_int(), GATTable_Add_short(), GATTable_Add_String(), GATTable_Create(), GATTable_Destroy(), GATType_GATdouble64, GATType_GATfloat32, GATType_GATint16, GATType_GATint32, GATType_String, GATuint32, GATStaticParameter_S::key, GATStaticMetric_S::measurement_type, GATStaticMetric_S::name, GATStaticMetric_S::parameter_count, GATStaticMetric_S::parameters, GATStaticParameter_S::type, and GATStaticMetric_S::unit.

Referenced by endpoint_adaptor_FireAddGATPipeListener(), endpoint_adaptor_FireConnect(), endpoint_adaptor_FireListen(), fileops_adaptor_FileCPI_GetMetricEvent(), fileops_adaptor_FireCopiedEvent(), fileops_adaptor_FireDeletedEvent(), fileops_adaptor_FireMovedEvent(), filestream_adaptor_FireCloseEvent(), filestream_adaptor_FireReadEvent(), filestream_adaptor_FireSeekEvent(), filestream_adaptor_FireWriteEvent(), GATMetric_CreateListOfMetrics(), logicalfile_adaptor_FireReplicatedEvent(), main(), pipe_adaptor_FireCloseEvent(), pipe_adaptor_FireReadEvent(), pipe_adaptor_FireSeekEvent(), and pipe_adaptor_FireWriteEvent().

GATResult GATMetric_CreateListOfMetrics GATStaticMetric   data,
GATuint32    count,
GATList_GATMetric *    list
 

GATMetric_CreateListOfMetrics.

The function GATMetric_CreateListOfMetrics creates a list of GATMetric objects from a given list of static metric data. This is a pure helper function for adaptor writers.

Parameters:
data  The address of the static metric data array.
count  The size of the given array of static metric data.
list  The pointer to the variable, which receives the resulting list of metrics.
Returns:
An error code.

Definition at line 580 of file GATMetric.c.

References data, GAT_INVALID_PARAMETER, GAT_MEMORYFAILURE, GAT_SUCCESS, GATMetric, GATMetric_CreateMetric(), GATMetric_Destroy(), GATResult, and GATuint32.

Referenced by endpoint_adaptor_EndpointCPI_GetMetrics(), fileops_adaptor_FileCPI_GetMetrics(), filestream_adaptor_FileStreamCPI_GetMetrics(), logicalfile_adaptor_LogicalFileCPI_GetMetrics(), pipe_adaptor_PipeCPI_GetMetrics(), and resourcebroker_adaptor_GATJobCPI_GetMetrics().


Variable Documentation

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

Definition at line 17 of file GATMetric.c.

GATMetric_vtable GATMetric__vtable
 

Initial value:

 {
  GATMetric_GetType,
  GATMetric_Destroy,
  GATMetric_Equals,
  GATMetric_Clone,
  GATMetric_GetInterface,
  NULL
}

Definition at line 52 of file GATMetric.c.

Referenced by GATMetric_Clone(), and GATMetric_Create().