GridLab
Grid Application Toolkit

A simple API for Grid Applications
GAT

Menu



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

GATPreferences.h

Go to the documentation of this file.
00001 /** @file GATPreferences.h
00002  * Header file for the GATPreferences class.
00003  * 
00004  * An instance of this class represents the user's preferences for
00005  * selecting adaptors. Currently this class is a place holder for 
00006  * the user preferences, the structure of which is in development;  
00007  * the matching algorithm outlined in the Match operation is used 
00008  * by the GAT implementation to determine which capability provider 
00009  * is used to satisfy a GAT API operation.
00010  * 
00011  * @date $Date: 2004/03/24 19:30:58 $
00012  * 
00013  * @version $Header: /export/cvs-gridlab/wp-1/Codes/GATEngine/C-reference/src/GATPreferences.h,v 1.20 2004/03/24 19:30:58 hartmutkaiser Exp $
00014  *
00015  *  Copyright (C) Kelly Davis
00016  *  This file is part of the GAT Engine.
00017  *  Contributed by Kelly Davis <kdavis@aei.mpg.de>.
00018  *
00019  *  Use, modification and distribution is subject to the Gridlab Software
00020  *  License. (See accompanying file GLlicense.txt or copy at
00021  *  http://www.gridlab.org/GLlicense.txt)
00022  */
00023 
00024 #ifndef _GATPREFERENCES_H_
00025 #define _GATPREFERENCES_H_ 1
00026 
00027 #include "GATTable.h"
00028 #include "GATType.h"
00029 #include "GATInternal.h"
00030 
00031 #ifdef __cplusplus
00032 extern "C" 
00033 {
00034 #endif
00035 
00036 /* Declare the converters to/from GATObject */
00037 GATOBJECT_DECLARE_CONVERTERS(GATPreferences);
00038 
00039 /**
00040  * Creates a new GATPreferences instance.
00041  *
00042  * @return A GATPreferences instance
00043  */
00044 GATPreferences GATPreferences_Create(void);
00045 
00046 /**
00047  * This fucntion returns the type, a #GATType of the passed 
00048  * #GATPreferences_const. This function will always return 
00049  * #GATType_GATPreferences.
00050  *
00051  * @param this The #GATPreferences_const to query
00052  * @return The #GATType of the passed @c this
00053  */
00054 GATType GATPreferences_GetType(GATPreferences_const pref);
00055 
00056 /**
00057  * Tests this #GATPreferences_const for equality with the passed 
00058  * #GATPreferences_const instance. Two #GATPreferences_const instances 
00059  * are considered equal if they contain the same set of name/value 
00060  * pairs.
00061  *
00062  * @param this The first #GATPreferences_const to compare
00063  * @param that The second #GATPreferences_const to compare
00064  * @param isequal Result of comparrison
00065  * @return Completion status
00066  */
00067 GATResult 
00068   GATPreferences_Equals(GATPreferences_const lhs, GATPreferences_const rhs, 
00069     GATBool *isequal);
00070 
00071 /**
00072  * This function returns a "deep clone" of the passed #GATPreferences_const @c this. 
00073  * This "deep clone" is returned in the variable @c thisClone. Furthermore,
00074  * this function returns its completion status, through its return value.
00075  *
00076  * @param  this The #GATPreferences_const to clone
00077  * @param thisClone The cloned #GATPreferences_const
00078  * @return The completion status of this function
00079  */
00080 GATResult 
00081   GATPreferences_Clone(GATPreferences_const pref, GATPreferences *thisClone);
00082 
00083 /**
00084  * Destroys this GATPreferences instance.
00085  *
00086  * @param this The GATPreferences to destroy
00087  */
00088 void GATPreferences_Destroy(GATPreferences *pref);
00089 
00090 /** GATResult GATPreferences_GetInterface(GATPreferences_const table, GATInterface iftype, void const **ifp)
00091  *  @brief Get an interface supported by a GATPreferences
00092  *
00093  *  The function GATPreferences_GetInterface allows to get a pointer to an 
00094  *  additional interface supported by this GATPreferences.
00095  *
00096  *  @param object The object to be asked for the new interface.
00097  *  @param iftype The interface the object is to be asked for.
00098  *  @param ifp The pointer, through which the result is to be returned.
00099  *
00100  *  @return An error type.
00101  */
00102 GATResult 
00103 GATPreferences_GetInterface(GATPreferences_const object, GATInterface iftype, 
00104   void const **ifp);
00105 
00106 /**
00107  * This adds a name/value pair in which the name is a String and the
00108  * value is a String to this GATPreferences instance.
00109  *
00110  * @param this The GATPreferences to modify
00111  * @param name Name  of the attribute to add
00112  * @param value Value of the attribute to add
00113  * @return An int indicating the GATError return code
00114  */
00115 GATResult 
00116   GATPreferences_Add(GATPreferences pref, const char *name, const char *value);
00117 
00118 /**
00119  * Removes the name/value pair with the passed name from this
00120  * GATPreferences instance.
00121  *
00122  * @param this The GATPreferences to modify
00123  * @param name Name of the name/value to remove.
00124  * @return An int indicating the GATError return code
00125  */
00126 GATResult GATPreferences_Remove(GATPreferences pref, const char *name);
00127 
00128 /**
00129  * Sets the given GATTable of name/value pairs as preferences.
00130  *
00131  * @param this The GATPreferences to modify
00132  * @param preferences Table of name/value pairs to be used as
00133  * preferences.
00134  * @return An int indicating the GATError return code
00135  */
00136 GATResult GATPreferences_Set(GATPreferences pref, GATTable preferences);
00137 
00138 /**
00139  * Gets the current preferences as name/value pairs in a GATTable.
00140  *
00141  * @param this The GATPreferences to query
00142  * @return Table of name/value pairs containing the current preferences. 
00143  */
00144 GATTable_const GATPreferences_Get(GATPreferences_const pref);
00145 
00146 /**
00147  * Matches the GATPreferences instance against another GATPreferences
00148  * instance expressing criteria.  For Match to return true, all keys
00149  * present in the criteria table must be present in the original and
00150  * must match: a string-valued value in the original table is matched by
00151  * a regular expression in the criteria table, and a numeric-valued value
00152  * in the original table by a string holding an arithmetical expression
00153  * (e.g., "$ < 5 $") in the criteria table.
00154  *
00155  * @param this The GATPreferences to query
00156  * @param criteria Matching criteria.
00157  * @param 1 upon match 0 otherwise
00158  */
00159 GATBool 
00160   GATPreferences_Match(GATPreferences_const pref, GATPreferences_const criteria);
00161 
00162 #ifdef __cplusplus
00163 }
00164 #endif
00165 
00166 #endif /* _GATPREFERENCES_H_ */