GridLab
Grid Application Toolkit

A simple API for Grid Applications
GAT

Menu



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

GATMetricEvent.h

Go to the documentation of this file.
00001 /** @file GATMetricEvent.h
00002  * Header file for the GATMetricEvent class.
00003  * 
00004  * A GATMetricEvent represents an event indicating the measurement of a metric
00005  * and the associated resultant data.
00006  * 
00007  * @date Wed Sep 23 2003
00008  * 
00009  * @version $Header: /export/cvs-gridlab/wp-1/Codes/GATEngine/C-reference/src/GATMetricEvent.h,v 1.13 2004/03/24 19:30:58 hartmutkaiser Exp $
00010  *
00011  *  Copyright (C) Tom Goodale
00012  *  This file is part of the GAT Engine.
00013  *  Contributed by Tom Goodale <goodale@aei.mpg.de>.
00014  *
00015  *  Use, modification and distribution is subject to the Gridlab Software
00016  *  License. (See accompanying file GLlicense.txt or copy at
00017  *  http://www.gridlab.org/GLlicense.txt)
00018  */
00019 
00020 #ifndef _GATMETRICEVENT_H_
00021 #define _GATMETRICEVENT_H_ 1
00022 
00023 #include "GATObject.h"
00024 #include "GATMetric.h"
00025 #include "GATTime.h"
00026 
00027 #ifdef __cplusplus
00028 extern "C" {
00029 #endif
00030 
00031 /* Declare the converters to/from GATObject */
00032 GATOBJECT_DECLARE_CONVERTERS(GATMetricEvent);
00033 
00034 /** GATMetricEvent_Create_Continuous
00035  *  @brief Create a new GATMetricEvent object
00036  *
00037  *  The function @c GATMetricEvent_Create_Continuous creates a new 
00038  *  GATMetricEvent object.
00039  *
00040  *  @param source The event source for this GATMetricEvent.
00041  *  @param metric The associated metric.
00042  *  @param callback The function to call to get at the current metric value.
00043  *  @param data Data to be passed through to the callback function.
00044  *
00045  *  @return Returns a handle to the newly created GATMetricEvent object.
00046  *        Returns 0 (zero) if an error occurs.
00047  */
00048 GATMetricEvent 
00049   GATMetricEvent_Create_Continuous(GATObject_const source, GATMetric metric, 
00050     GATMetricEvent_GetValueProc callback, void *data);
00051 
00052 /** GATMetricEvent_Create_EventLike
00053  *  @brief Create a new GATMetricEvent object
00054  *
00055  *  The function @c GATMetricEvent_Create_EventLike creates a new 
00056  *  GATMetricEvent object.
00057  *
00058  *  @param source The event source for this GATMetricEvent.
00059  *  @param metric The associated metric.
00060  *  @param buffer The buffer containing the metric value.
00061  *  @param size The size of the buffer.
00062  *
00063  *  @return Returns a handle to the newly created GATMetricEvent object.
00064  *        Returns 0 (zero) if an error occurs.
00065  */
00066 GATMetricEvent 
00067   GATMetricEvent_Create_EventLike(GATObject_const source, GATMetric metric, 
00068     void *buffer, GATuint32 size);
00069 
00070 /** void GATMetricEvent_Destroy(GATMetricEvent *resource)
00071  *
00072  *  The function GATMetricEvent_Destroy is the destructor used to
00073  *  free all the memory allocated by an GATMetricEvent instance.
00074  *
00075  *  @param description The pointer to the GATMetricEvent to destroy
00076  */
00077 void
00078   GATMetricEvent_Destroy(GATMetricEvent *object);
00079 
00080 /** GATMetricEvent_Equals
00081  *  @brief Compare two GATMetricEvent objects
00082  *
00083  *  The function @c GATMetricEvent_Equals compares two objects of the
00084  *  @c GATMetricEvent type.
00085  *
00086  *  @param lhs The first list to compare
00087  *  @param rhs The second list to compare
00088  *  @param isequal The pointer to the location, where the outcome of the 
00089  *        function has to be stored.
00090  *
00091  *  @return An error code.
00092  */
00093 GATResult
00094   GATMetricEvent_Equals(GATMetricEvent_const lhs,
00095     GATMetricEvent_const rhs, GATBool *isequal);
00096 
00097 /** GATMetricEvent_Clone
00098  *  @brief Clone the given GATMetricEvent
00099  *
00100  *  The function @c GATMetricEvent_Clone generates a (deep) copy of 
00101  *  the given GATMetricEvent. 
00102  *
00103  *  @param description The object to clone
00104  *  @param new_object The pointer, through which the result is to be 
00105  *        returned.
00106  *
00107  *  @return An error type.
00108  */
00109 GATResult
00110   GATMetricEvent_Clone(GATMetricEvent_const object, 
00111     GATMetricEvent *new_object);
00112 
00113 /** GATType GATMetricEvent_GetType(GATMetricEvent_const resource)
00114  *  @brief Return the type of the GATMetricEvent
00115  *
00116  *  The function @c GATMetricEvent_GetType always returns 
00117  *  @c #GATType_GATMetricEvent. 
00118  *
00119  *  @param object The object to inspect
00120  *
00121  *  @return Returns always @c #GATType_GATMetricEvent. 
00122  */
00123 GATType
00124   GATMetricEvent_GetType(GATMetricEvent_const object);
00125 
00126 /** int GATMetricEvent_GetInterface(GATMetricEvent_const file, GATInterface iftype, void const **ifp)
00127  *  @brief Get an interface supported by a GATObject
00128  *
00129  *  The function GATMetricEvent_GetInterface allows to get a pointer to an 
00130  *  additional interface supported by this GATMetricEvent.
00131  *
00132  *  @param object The object to be asked for the new interface.
00133  *  @param iftype The interface the object is to be asked for.
00134  *  @param ifp The pointer, through which the result is to be returned.
00135  *
00136  *  @return An error type.
00137  */
00138 GATResult 
00139   GATMetricEvent_GetInterface(GATMetricEvent_const file, 
00140     GATInterface iftype, void const **ifp);
00141 
00142 /** GATMetricEvent_GetSource
00143  *
00144  *  The function GATMetricEvent_GetSource returns an instance of the source 
00145  *  of this GATMetricEvent.
00146  *
00147  *  @param metric_event The metric_event to query for its source.
00148  *
00149  *  @return The event source.
00150  */
00151 GATObject_const
00152   GATMetricEvent_GetSource(GATMetricEvent_const metric_event);
00153 
00154 /** GATMetricEvent_GetValueType
00155  *
00156  *  The function GATMetricEvent_GetValueType returns the value type 
00157  *  corresponding to this GATMetricEvent.
00158  *
00159  *  @param metric_event The metric_event to query for its associated metric.
00160  *
00161  *  @return The type of the associated value.
00162  */
00163 GATType 
00164   GATMetricEvent_GetValueType(GATMetricEvent_const metric_event);
00165 
00166 /** GATMetricEvent_GetValue
00167  *
00168  *  The function GATMetricEvent_GetValue returns the value corresponding to 
00169  *  this GATMetricEvent.
00170  *
00171  *  @param metric_event The metric_event to query for its associated metric.
00172  *  @param buffer The buffer, where the retrieved value should be returned to.
00173  *  @param size The size of the buffer.
00174  *
00175  *  @return An error code.
00176  *
00177  *  @remark The value will be returned in a variable, which has the type 
00178  *        specified while creating the GATMetric associated with this value.
00179  *        The provided buffer should be large enough to hold an instance of 
00180  *        this data type.
00181  */
00182 GATResult 
00183   GATMetricEvent_GetValue(GATMetricEvent_const metric_event, void *buffer, 
00184     GATuint32 size);
00185 
00186 /** GATMetricEvent_GetMetric
00187  *
00188  *  The function GATMetricEvent_GetMetric
00189  *
00190  *  @param metric_event The metric_event to query for its associated metric.
00191  *
00192  *  @return The associated metric instance.
00193  */
00194 GATMetric_const 
00195   GATMetricEvent_GetMetric(GATMetricEvent_const metric_event);
00196 
00197 /** GATMetricEvent_GetEventTime
00198  *
00199  *  The function GATMetricEvent_GetEventTime
00200  *
00201  *  @param metric_event The metric_event to query for the time it happened.
00202  *
00203  *  @return The time, the event happened.
00204  */
00205 GATTime_const 
00206   GATMetricEvent_GetEventTime(GATMetricEvent metric_event);
00207 
00208 #ifdef __cplusplus
00209 }
00210 #endif
00211 
00212 #endif /* _GATMETRICEVENT_H_ */