GridLab
Grid Application Toolkit

A simple API for Grid Applications
GAT

Menu



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

GATMonitorable.h File Reference

Header file for the GATMonitorable class. More...

#include "GATType.h"
#include "GATList.h"

Include dependency graph for GATMonitorable.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Defines

#define _GATMONITORABLE_H_   1

Typedefs

typedef GATMonitorable_Impl_SGATMonitorable_Impl
typedef GATMonitorable_Impl_S
const * 
GATMonitorable_Impl_const

Functions

 GATOBJECT_DECLARE_CONVERTERS (GATMonitorable_Impl)
 GATLIST_DECLARE_QUALIFIED (extern, GATMetric, GATList_GATMetric)
GATMonitorable_Impl GATMonitorable_Impl_Create (GATList_GATMetric metrics)
 GATMonitorable_Impl_Create.

void GATMonitorable_Impl_Destroy (GATMonitorable_Impl *monitorable)
 GATMonitorable_Impl_Destroy The GATMonitorable_Impl destructor.

GATResult GATMonitorable_Impl_Equals (GATMonitorable_Impl_const lhs, GATMonitorable_Impl_const rhs, GATBool *isequal)
 int GATMonitorable_Impl_Equals(GATMonitorable_Impl_const lhs, GATMonitorable_Impl_const rhs, GATBool *isequal) Compares two GATMonitorable_Impl objects

GATResult GATMonitorable_Impl_Clone (GATMonitorable_Impl_const monitorable, GATMonitorable_Impl *new_object)
 int GATMonitorable_Impl_Clone(GATMonitorable_Impl_const filehandle, GATMonitorable_Impl *new_file) Clone the given GATMonitorable_Impl

GATResult GATMonitorable_Impl_AddMetricListener (GATMonitorable_Impl monitorable, GATMetricListener listener, void *listener_data, GATMetric metric, GATuint32 *cookie)
 GATMonitorable_Impl_AddMetricListener.

GATResult GATMonitorable_Impl_RegisterPolling (GATMonitorable_Impl monitorable, GATMetric metric, GATMetricEvent *event, GATuint32 *cookie)
 GATMonitorable_Impl_RegisterPolling.

GATResult GATMonitorable_Impl_RemoveRegisteredMetric (GATMonitorable_Impl monitorable, GATMetric metric, GATuint32 cookie)
 GATMonitorable_Impl_RemoveRegisteredMetric.

GATResult GATMonitorable_Impl_GetMetrics (GATMonitorable_Impl_const monitorable, GATList_GATMetric *metrics)
 GATMonitorable_Impl_GetMetrics.

GATResult GATMonitorable_Impl_FireEvent (GATMonitorable_Impl_const monitorable, GATMetric metric, GATMetricEvent event)
 GATMonitorable_Impl_FireEvent.


Detailed Description

Header file for the GATMonitorable class.

This declaration of the GATMonitorable interface, which is meant as a generic helper class, which may be used by other GATObjects to implement its GATMonitorable interface.

The GATMonitorable_Impl class is essentially a table of lists, where the GATMetric is used as the key type for the table and the list contains the GATMetricListener's for the GATMetric used as the key.

Date:
Mon Nov 3 2003
Version:
Header:
/export/cvs-gridlab/wp-1/Codes/GATEngine/C-reference/src/GATMonitorable.h,v 1.7 2004/03/24 19:30: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 GATMonitorable.h.


Define Documentation

#define _GATMONITORABLE_H_   1
 

Definition at line 26 of file GATMonitorable.h.


Typedef Documentation

typedef struct GATMonitorable_Impl_S* GATMonitorable_Impl
 

Definition at line 32 of file GATMonitorable.h.

typedef struct GATMonitorable_Impl_S const* GATMonitorable_Impl_const
 

Definition at line 33 of file GATMonitorable.h.

Referenced by GATMonitorable_Impl_Clone(), GATMonitorable_Impl_Equals(), GATMonitorable_Impl_FireEvent(), GATMonitorable_Impl_GetInterface(), GATMonitorable_Impl_GetMetrics(), and GATMonitorable_Impl_GetType().


Function Documentation

GATOBJECT_DECLARE_CONVERTERS GATMonitorable_Impl   
 

GATLIST_DECLARE_QUALIFIED extern   ,
GATMetric   ,
GATList_GATMetric   
 

GATMonitorable_Impl GATMonitorable_Impl_Create GATList_GATMetric    metrics
 

GATMonitorable_Impl_Create.

Create a new instance of the GATMonitorable_Impl class.

Returns:
The newly constructed instance.

Definition at line 138 of file GATMonitorable.c.

References GATMetric, GATMonitorable_Impl_S::GATMonitorable_Impl__vtable, GATMonitorable_Impl__vtable, GATMonitorable_Impl_CloneKey(), GATMonitorable_Impl_Destroy(), GATMonitorable_Impl_DestroyKey(), GATMonitorable_Impl_EqualKeys(), GATMonitorable_Impl_GetKeySize(), GATMonitorable_Impl_HashKey(), GATMonitorable_Impl_IMonitorable__vtable, GATMonitorable_Impl_S::GATObject__vtable, GATTable_Add_GATObject(), GATTable_CreateAnyKey(), and GATMonitorable_Impl_S::metrics.

Referenced by GATAdvertService_Create(), GATEndpoint_Create(), GATEndpoint_DeSerialise_Create(), GATFile_Create(), GATFile_DeSerialise_Create(), GATFileStream_Create(), GATJob_Create(), GATJob_DeSerialise_Create(), GATLogicalFile_Create(), GATLogicalFile_DeSerialise_Create(), GATPipe_Create(), GATResource_DeSerialise_Create(), and GATResource_Impl_Create().

void GATMonitorable_Impl_Destroy GATMonitorable_Impl   monitorable
 

GATMonitorable_Impl_Destroy The GATMonitorable_Impl destructor.

This is the destructor for GATMonitorable_Impl objects.

Parameters:
monitorable  An old GATMonitorable_Impl

Definition at line 199 of file GATMonitorable.c.

References GATTable_Destroy().

Referenced by GATAdvertService_Destroy(), GATEndpoint_Destroy(), GATFile_Destroy(), GATFileStream_Destroy(), GATJob_Destroy(), GATLogicalFile_Destroy(), GATMonitorable_Impl_Create(), GATPipe_Destroy(), and GATResource_Destroy().

GATResult GATMonitorable_Impl_Equals GATMonitorable_Impl_const    lhs,
GATMonitorable_Impl_const    rhs,
GATBool   isequal
 

int GATMonitorable_Impl_Equals(GATMonitorable_Impl_const lhs, GATMonitorable_Impl_const rhs, GATBool *isequal) Compares two GATMonitorable_Impl objects

The function GATMonitorable_Equals compares two file objects of type #GATTable.

Parameters:
lhs  The first file object to compare
rhs  The second file object to compare
isequal  The pointer to the GATBool variable, which should receive the result if the comparison
Returns:
An error code.

Definition at line 633 of file GATMonitorable.c.

References GAT_INVALID_HANDLE, GATBool, GATMonitorable_Impl_const, GATResult, and GATTable_Equals().

GATResult GATMonitorable_Impl_Clone GATMonitorable_Impl_const    monitorable,
GATMonitorable_Impl   new_object
 

int GATMonitorable_Impl_Clone(GATMonitorable_Impl_const filehandle, GATMonitorable_Impl *new_file) Clone the given GATMonitorable_Impl

The function GATMonitorable_Clone generates a (deep) copy of the given GATTable.

Parameters:
monitorable  The object to clone
new_file  The pointer, through which the result is to be returned.
Returns:
An error type.

Definition at line 658 of file GATMonitorable.c.

References GAT_INVALID_HANDLE, GAT_INVALID_PARAMETER, GAT_MEMORYFAILURE, GAT_SUCCESS, GATMonitorable_Impl_S::GATMonitorable_Impl__vtable, GATMonitorable_Impl__vtable, GATMonitorable_Impl_const, GATMonitorable_Impl_IMonitorable__vtable, GATMonitorable_Impl_S::GATObject__vtable, GATResult, GATTable_Clone(), and GATMonitorable_Impl_S::metrics.

Referenced by GATAdvertService_Clone(), GATEndpoint_Clone(), GATFile_Clone(), GATFileStream_Clone(), GATJob_Clone(), GATLogicalFile_Clone(), GATPipe_Clone(), and GATResource_Clone().

GATResult GATMonitorable_Impl_AddMetricListener GATMonitorable_Impl    monitorable,
GATMetricListener    listener,
void *    listener_data,
GATMetric    metric,
GATuint32   cookie
 

GATMonitorable_Impl_AddMetricListener.

The function GATMonitorable_Impl_AddMetricListener adds the passed instance of a GATMetricListener to the list of GATMetricListeners which are notified of fired GATMetricEvents of the type described by the provided GATMetric instance.

Parameters:
monitorable  The GATMonitorable instance to add the GATMetricListener to.
listener  The GATMetricListener to call, when the corresponding GATMetricEvent is fired.
listener_data  The client supplied data, which will be passed through to the GATMetricListener.
metric  The GATMetric instance describing the GATMetricEvent to pass to the GATMetricListener. This metric instance must be of type GATMeasurementType_EventLike, otherwise an error is returned.
cookie  The returned value should be used to remove the GATMetricListener from this GATMonitorable.
Returns:
An error code.

Definition at line 233 of file GATMonitorable.c.

References GATMetricListenerData::cookie, cookie_jar, GATMetricListenerData::data, data, GAT_FAIL, GAT_INVALID_HANDLE, GAT_INVALID_PARAMETER, GAT_KEY_ALREADY_EXISTS, GAT_MEMORYFAILURE, GAT_SUCCESS, GATMeasurementType_EventLike, GATMetric, GATMetric_GetMeasurementType(), GATMetricListener, GATResult, GATTable_internal_Get_GATObjectRef(), GATuint32, GATMetricListenerData::listener, and GATMonitorable_Impl_S::metrics.

Referenced by GATAdvertService_AddMetricListener(), GATEndpoint_AddMetricListener(), GATFile_AddMetricListener(), GATFileStream_AddMetricListener(), GATJob_AddMetricListener(), GATLogicalFile_AddMetricListener(), GATPipe_AddMetricListener(), and GATResource_Impl_AddMetricListener().

GATResult GATMonitorable_Impl_RegisterPolling GATMonitorable_Impl    monitorable,
GATMetric    metric,
GATMetricEvent   event,
GATuint32   cookie
 

GATMonitorable_Impl_RegisterPolling.

The function GATMonitorable_Impl_RegisterPolling registers a continuous metric with the given GATMonitorable instance.

Parameters:
monitorable  The GATMonitorable instance to register the metric with.
metric  The GATMetric instance describing the GATMetricEvent to pass to the GATMetricListener. This metric instance must be of type GATMeasurementType_Continuous, otherwise an error is returned.
event  The pointer to a variable, which should receive the resulting GATMetricEvent (this parameter is ignored for this function).
cookie  The returned value should be used to remove the GATMetricListener from this GATMonitorable.
Returns:
An error code.

Definition at line 333 of file GATMonitorable.c.

References GATMetricListenerData::cookie, cookie_jar, GATMetricListenerData::data, data, GAT_FAIL, GAT_INVALID_HANDLE, GAT_INVALID_PARAMETER, GAT_KEY_ALREADY_EXISTS, GAT_MEMORYFAILURE, GAT_SUCCESS, GATMeasurementType_Continuous, GATMetric, GATMetric_GetMeasurementType(), GATResult, GATTable_internal_Get_GATObjectRef(), GATuint32, GATMetricListenerData::listener, and GATMonitorable_Impl_S::metrics.

Referenced by GATAdvertService_RegisterPolling(), GATEndpoint_RegisterPolling(), GATFile_RegisterPolling(), GATFileStream_RegisterPolling(), GATJob_RegisterPolling(), GATLogicalFile_RegisterPolling(), GATPipe_RegisterPolling(), and GATResource_Impl_RegisterPolling().

GATResult GATMonitorable_Impl_RemoveRegisteredMetric GATMonitorable_Impl    monitorable,
GATMetric    metric,
GATuint32    cookie
 

GATMonitorable_Impl_RemoveRegisteredMetric.

The function GATMonitorable_Impl_RemoveRegisteredMetric removes a GATMetricListener, which was previously registered with GATMonitorable_AddMetricListener.

Parameters:
monitorable  The GATMonitorable instance to remove the metric from.
metric  The GATMetric instance describing the GATMetricEvent to pass to the GATMetricListener.
cookie  This value identifies the GATMetricListener to remove, it was returned from the corresponding GATMonitorable_AddMetricListener or GATMonitorable_MetricRegisterPolling functions.
Returns:
An error code.

Definition at line 432 of file GATMonitorable.c.

References GATMetricListenerData::cookie, GAT_FAIL, GAT_KEY_NOT_FOUND, GAT_SUCCESS, GATMetric, GATObject_const, GATResult, GATTable_Get_GATObject(), GATuint32, and GATMonitorable_Impl_S::metrics.

Referenced by GATAdvertService_RegisterPolling(), GATAdvertService_RemoveRegisteredMetric(), GATEndpoint_RegisterPolling(), GATEndpoint_RemoveRegisteredMetric(), GATFile_RegisterPolling(), GATFile_RemoveRegisteredMetric(), GATFileStream_RegisterPolling(), GATFileStream_RemoveRegisteredMetric(), GATJob_RegisterPolling(), GATJob_RemoveRegisteredMetric(), GATLogicalFile_RegisterPolling(), GATLogicalFile_RemoveRegisteredMetric(), GATPipe_RegisterPolling(), GATPipe_RemoveRegisteredMetric(), GATResource_Impl_RegisterPolling(), and GATResource_Impl_RemoveRegisteredMetric().

GATResult GATMonitorable_Impl_GetMetrics GATMonitorable_Impl_const    monitorable,
GATList_GATMetric *    metrics
 

GATMonitorable_Impl_GetMetrics.

The function GATMonitorable_Impl_GetMetrics returns a list of metrics supported by this GATMonitorable.

Parameters:
monitorable  The GATMonitorable instance, for which the supported metrics should be returned.
metrics  The pointer to the variable, which receives the resulting list of metrics.
Returns:
An error code.

Definition at line 492 of file GATMonitorable.c.

References GAT_INVALID_HANDLE, GAT_INVALID_PARAMETER, GAT_MEMORYFAILURE, GAT_SUCCESS, GATMetric, GATMonitorable_Impl_const, GATResult, GATTable_GetKeys(), and GATuint32.

Referenced by GATAdvertService_GetMetrics(), GATEndpoint_GetMetrics(), GATFile_GetMetrics(), GATFileStream_GetMetrics(), GATJob_GetMetrics(), GATLogicalFile_GetMetrics(), GATPipe_GetMetrics(), and GATResource_Impl_GetMetrics().

GATResult GATMonitorable_Impl_FireEvent GATMonitorable_Impl_const    monitorable,
GATMetric    metric,
GATMetricEvent    event
 

GATMonitorable_Impl_FireEvent.

The function GATMonitorable_Impl_FireEvent fires the given event to all registered metric listeners.

Parameters:
monitorable  The GATMonitorable to use for calling the registered metric listeners.
metric  The metric, which describes the event fired.
event  The event to fire.
Returns:
An error code

Definition at line 569 of file GATMonitorable.c.

References GATMetricListenerData::data, data, GAT_FAIL, GAT_INVALID_HANDLE, GAT_INVALID_PARAMETER, GAT_SUCCESS, GATMetric, GATMonitorable_Impl_const, GATObject_const, GATResult, GATTable_Get_GATObject(), and GATMetricListenerData::listener.

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