'Classic' CCA c++ binding (ccaffeine-only)
0.5.7
|
Abstract algorithm control parameters and string named data io interface. More...
#include <KeyValueEnumerated.h>
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. |
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.
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.
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. |
virtual int classic::gov::cca::KeyValueEnumerated::setFloat | ( | const char * | key, |
float | value | ||
) | [virtual] |
Defines a new Float property or changes its value.
key | The property name, which will be copied. |
value | The property value to be set. |
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.
key | The property name, which will be copied. |
value | The property value to be set. |
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.
key | The property name, which will be copied. |
boolProp | The property value to be set. |
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.
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. |
virtual int classic::gov::cca::KeyValueEnumerated::getString | ( | const char * | propName, |
const char *& | value | ||
) | [virtual] |
Get a C string property value by C string name.
propName | The name of the property desired. |
value | output of the value requested. |
virtual int classic::gov::cca::KeyValueEnumerated::getFloat | ( | const char * | propName, |
Float & | value | ||
) | [virtual] |
Get a Float property value by C string name.
propName | The string name of the property desired. |
value | output of the value requested. |
virtual int classic::gov::cca::KeyValueEnumerated::getInt | ( | const char * | propName, |
Int & | value | ||
) | [virtual] |
Get an Int property value by C string name.
propName | The string name of the property desired. |
value | output of the value requested. |
virtual int classic::gov::cca::KeyValueEnumerated::getBool | ( | const char * | propName, |
bool & | value | ||
) | [virtual] |
Get a bool property value by C string name.
propName | The string name of the property desired. |
value | output of the value requested. |
virtual int classic::gov::cca::KeyValueEnumerated::getPointer | ( | const char * | propName, |
void *& | value | ||
) | [virtual] |
Get a pointer property value by C string name.
propName | The string name of the property desired. |
value | output of the value requested. |
virtual void classic::gov::cca::KeyValueEnumerated::unset | ( | const char * | propName, |
void *& | pointerOut | ||
) | [virtual] |
Remove a key from the properties.
All errors are silently ignored.
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.
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.
keylist | input/output Argv that should be supplied empty (containing no keys). The names of supported keys in the Properties are appended. |