A general key for positive values. More...
#include "keyvalue/key/generic/Positive.h"
Public Types | |
enum | |
typedef Traits< double, StdSingle, NoMap > | Traits_ |
typedef StdSingle< typename NoMap< double >::OutputType_ > | ConverterType_ |
typedef ConverterType_::InputType_ | InputType_ |
typedef ConverterType_::OutputType_ | OutputType_ |
Public Member Functions | |
Positive (const string &name) | |
Constructs key and sets its name. | |
void | checkOutput (doubleelement) const |
Compares element against the bound(s). | |
string | getName () const |
Gets Key's name. | |
void | setName (const string &name) |
Sets name. | |
double | map (const value::Variant &variant) const |
Performs the mapping. |
A general key for positive values.
Positive | ( | const string & | name | ) | [explicit] |
Constructs key and sets its name.
This class is derived from Bounded<double, Geq> and set its lower bound to 0.0 at construction time.
void checkOutput | ( | double | element | ) | const [inherited] |
Compares element against the bound(s).
element | : Element to be checked. |
RuntimeError | : If element is out of bound(s). |
string getName | ( | ) | const [inherited] |
void setName | ( | const string & | name | ) | [inherited] |
Sets name.
name | : The name. |
double map | ( | const value::Variant & | variant | ) | const [inherited] |
Performs the mapping.
This method retrieves the content of value::Variant and, by considering enabled lexical convertions, converts it to Output. (See LexicalToolKit documentation.)
variant | : A value::Variant containing the input to be mapped. |