classic::gov::cca::KeyValueEnumerated Class Reference

Abstract algorithm control parameters and string named data io interface. More...

#include <KeyValueEnumerated.h>

Inheritance diagram for classic::gov::cca::KeyValueEnumerated:

Inheritance graph
[legend]
Collaboration diagram for classic::gov::cca::KeyValueEnumerated:

Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual int setString (const char *key, const char *value) CLASSIC_CCA_PURE
 Defines a new string property or changes the value of an existing one.
virtual int setFloat (const char *key, float value) CLASSIC_CCA_PURE
 Defines a new Float property or changes its value.
virtual int setDouble (const char *key, double value) CLASSIC_CCA_PURE
 like setFloat.
virtual int setLongDouble (const char *key, long double value) CLASSIC_CCA_PURE
 like setFloat.
virtual int setChar (const char *key, char value) CLASSIC_CCA_PURE
 Defines a new integral property or changes its value.
virtual int setShort (const char *key, short value) CLASSIC_CCA_PURE
 like setShort.
virtual int setInt (const char *key, int value) CLASSIC_CCA_PURE
 like setShort.
virtual int setLong (const char *key, long int value) CLASSIC_CCA_PURE
 like setShort.
virtual int setLongLong (const char *key, long long int value) CLASSIC_CCA_PURE
 like setShort.
virtual int setUnsignedChar (const char *key, unsigned char value) CLASSIC_CCA_PURE
 like setShort.
virtual int setUnsignedShort (const char *key, unsigned short value) CLASSIC_CCA_PURE
 like setShort.
virtual int setUnsignedInt (const char *key, unsigned int value) CLASSIC_CCA_PURE
 like setShort.
virtual int setUnsignedLong (const char *key, unsigned long int value) CLASSIC_CCA_PURE
 like setShort.
virtual int setUnsignedLongLong (const char *key, unsigned long long int value) CLASSIC_CCA_PURE
 like setShort.
virtual int setBool (const char *key, bool boolProp) CLASSIC_CCA_PURE
 Defines a new boolean property or changes its value.
virtual int setPointer (const char *key, void *objProp) CLASSIC_CCA_PURE
 Defines a new arbitrary object property, or substitutes a new object for the currently stored one.
virtual int getString (const char *propName, const char *&value) CLASSIC_CCA_PURE
 Get a C string property value by C string name.
virtual int getFloat (const char *propName, Float &value) CLASSIC_CCA_PURE
 Get a Float property value by C string name.
virtual int getInt (const char *propName, Int &value) CLASSIC_CCA_PURE
 Get an Int property value by C string name.
virtual int getBool (const char *propName, bool &value) CLASSIC_CCA_PURE
 Get a bool property value by C string name.
virtual int getPointer (const char *propName, void *&value) CLASSIC_CCA_PURE
 Get a pointer property value by C string name.
virtual void unset (const char *propName, void *&pointerOut) CLASSIC_CCA_PURE
 Remove a key from the properties.
virtual void getKeys (Argv *keylist) CLASSIC_CCA_PURE
 Produce a list of all the keys in an abstract container.
virtual void getKeysSupported (Argv *keylist) CLASSIC_CCA_PURE
 Produce a list of the keys in the main underlying object that the object "supports", i.e.


Detailed Description

Abstract algorithm control parameters and string named data io interface.

DEPRECATED. SEVERELY DEPRECATED. This is a generic properties input/output interface which may be supported at the discretion of the concrete class implementer.

This is a Closed hash -- one value (and value type) per key. Setting a new value and type for a key which has a value of another type already is an error.

The usual esi_msg error buffer is omitted from the functions in this interface, as it is particularly simple.

Some properties/control parameters (such as iterationLimit which must be present in all ESI_Solvers) may be represented redundantly in this optional< >Properties itnerface.

As an example: If you have a solver that cares about the properties of a Matrix or Operator, simply : esi::Properties *p; err = mtx->getInterface("esi::Properties", (void *)p,msg); bool is_psym = false; if (err >= 0) { // <0 means no properties interface p. err2 = p->getBool("esi.P-Symmetric",psym); // ignore err2 is ok if esi.P-Symmetric unknown, nothing psym is returned unchanged. }

Implementation notes:

Since this depends on Int and Float, it cannot be in the Object interface. Since some operators/matrices/solvers/vectors/pcs may have no special properties, the interface is not required (by inheritance) into those classes.

We will create a reference implementation of this interface which can be inherited or used as an internal data member (delegated to) to provide this interface.

Probably most implementers will support it by delegation or inheritance of the reference-- no bonus points in the math world for implementing hashes. Those implementers that want to back this interface by an existing resource mechanism are of course free to do so.


Member Function Documentation

virtual int classic::gov::cca::KeyValueEnumerated::setString ( const char *  key,
const char *  value 
) [virtual]

Defines a new string property or changes the value of an existing one.

Because the string arguments are copied, it is okay to call this with string literal arguments.

Parameters:
key The property name, which will be copied.
value The property value, which will be copied. A 0 value will cause the key to remain with a NULL value. Use 'unset' to delete keys.
Returns:
0 if ok, -2 if not ok due to a type conflict, and -1 for all other reason.

virtual int classic::gov::cca::KeyValueEnumerated::setFloat ( const char *  key,
float  value 
) [virtual]

Defines a new Float property or changes its value.

Parameters:
key The property name, which will be copied.
value The property value to be set.
Returns:
0 if ok, -2 if not ok due to a type conflict, and -1 for all other reason.

virtual int classic::gov::cca::KeyValueEnumerated::setDouble ( const char *  key,
double  value 
) [virtual]

like setFloat.

virtual int classic::gov::cca::KeyValueEnumerated::setLongDouble ( const char *  key,
long double  value 
) [virtual]

like setFloat.

virtual int classic::gov::cca::KeyValueEnumerated::setChar ( const char *  key,
char  value 
) [virtual]

Defines a new integral property or changes its value.

Parameters:
key The property name, which will be copied.
value The property value to be set.
Returns:
0 if ok, -2 if not ok due to a type conflict, and -1 for all other reason.

virtual int classic::gov::cca::KeyValueEnumerated::setShort ( const char *  key,
short  value 
) [virtual]

like setShort.

virtual int classic::gov::cca::KeyValueEnumerated::setInt ( const char *  key,
int  value 
) [virtual]

like setShort.

virtual int classic::gov::cca::KeyValueEnumerated::setLong ( const char *  key,
long int  value 
) [virtual]

like setShort.

virtual int classic::gov::cca::KeyValueEnumerated::setLongLong ( const char *  key,
long long int  value 
) [virtual]

like setShort.

virtual int classic::gov::cca::KeyValueEnumerated::setUnsignedChar ( const char *  key,
unsigned char  value 
) [virtual]

like setShort.

virtual int classic::gov::cca::KeyValueEnumerated::setUnsignedShort ( const char *  key,
unsigned short  value 
) [virtual]

like setShort.

virtual int classic::gov::cca::KeyValueEnumerated::setUnsignedInt ( const char *  key,
unsigned int  value 
) [virtual]

like setShort.

virtual int classic::gov::cca::KeyValueEnumerated::setUnsignedLong ( const char *  key,
unsigned long int  value 
) [virtual]

like setShort.

virtual int classic::gov::cca::KeyValueEnumerated::setUnsignedLongLong ( const char *  key,
unsigned long long int  value 
) [virtual]

like setShort.

virtual int classic::gov::cca::KeyValueEnumerated::setBool ( const char *  key,
bool  boolProp 
) [virtual]

Defines a new boolean property or changes its value.

Parameters:
key The property name, which will be copied.
boolProp The property value to be set.
Returns:
0 if ok, -2 if not ok due to a type conflict, and -1 for all other reason.

virtual int classic::gov::cca::KeyValueEnumerated::setPointer ( const char *  key,
void *  objProp 
) [virtual]

Defines a new arbitrary object property, or substitutes a new object for the currently stored one.

Parameters:
key The property name, which will be copied.
objProp If the void pointer given should be reference counted, that is the caller's responsibility. The pointer will be stored until the next set or unset on the same key. The void pointer may be to an object, an array, or anything else.
Returns:
0 if ok, -2 if not ok due to a type conflict, and -1 for all other reasons.

virtual int classic::gov::cca::KeyValueEnumerated::getString ( const char *  propName,
const char *&  value 
) [virtual]

Get a C string property value by C string name.

Parameters:
propName The name of the property desired.
value output of the value requested.
Returns:
0 if value exists. -2 if it exists and is of the wrong type. -1 does not exist or any other error.

virtual int classic::gov::cca::KeyValueEnumerated::getFloat ( const char *  propName,
Float &  value 
) [virtual]

Get a Float property value by C string name.

Parameters:
propName The string name of the property desired.
value output of the value requested.
Returns:
0 if value exists. -2 if it exists and is of the wrong type. -1 does not exist or any other error.

virtual int classic::gov::cca::KeyValueEnumerated::getInt ( const char *  propName,
Int &  value 
) [virtual]

Get an Int property value by C string name.

Parameters:
propName The string name of the property desired.
value output of the value requested.
Returns:
0 if value exists. -2 if it exists and is of the wrong type. -1 does not exist or any other error.

virtual int classic::gov::cca::KeyValueEnumerated::getBool ( const char *  propName,
bool &  value 
) [virtual]

Get a bool property value by C string name.

Parameters:
propName The string name of the property desired.
value output of the value requested.
Returns:
0 if value exists. -2 if it exists and is of the wrong type. -1 does not exist or any other error.

virtual int classic::gov::cca::KeyValueEnumerated::getPointer ( const char *  propName,
void *&  value 
) [virtual]

Get a pointer property value by C string name.

Parameters:
propName The string name of the property desired.
value output of the value requested.
Returns:
0 if value exists. -2 if it exists and is of the wrong type. -1 does not exist or any other error.

virtual void classic::gov::cca::KeyValueEnumerated::unset ( const char *  propName,
void *&  pointerOut 
) [virtual]

Remove a key from the properties.

All errors are silently ignored.

Parameters:
propName key.
pointerOut If the key corresponds to a void pointer property, the pointer is returned in pointerOut, otherwise pointerOut is 0.

virtual void classic::gov::cca::KeyValueEnumerated::getKeys ( Argv *  keylist  )  [virtual]

Produce a list of all the keys in an abstract container.

Parameters:
keylist input/output Argv that should be supplied empty (containing no keys). The names of keys in the Properties are appended.

virtual void classic::gov::cca::KeyValueEnumerated::getKeysSupported ( Argv *  keylist  )  [virtual]

Produce a list of the keys in the main underlying object that the object "supports", i.e.

sets or reads during computations. Other keys may be present for use by third parties that have nothing to do with "the algorithm", but these keys will not appear in the getKeysSupported list.

Parameters:
keylist input/output Argv that should be supplied empty (containing no keys). The names of supported keys in the Properties are appended.


The documentation for this class was generated from the following file:

Generated on Thu Mar 3 08:43:35 2011 for 'Classic' CCA c++ binding (ccaffeine-only) by  doxygen 1.5.9