struct CrlValueNumeric / crl_value_numeric_t
Abstract Class
Description
Numeric values: ints, floats, ranges.
Kinship
Immediate super class: ValueScalar
Immediate sub classes: ValueNumericSimple, ValueRange
Inherited Slots
Members
| ValueNumeric * | | add | | (ValueNumeric const *) const |
| ValueNumeric * | | add | | (AnyValue) const |
| Value * | | find | | (char const * key) const |
| bool | | find | | (float_t & result, char const * key) const |
| bool | | find | | (float_t & result, Value const * key) const |
| bool | | find | | (signed_t & result, char const * key) const |
| bool | | find | | (signed_t & result, Value const * key) const |
| bool | | find | | (unsigned_t & result, char const * key) const |
| bool | | find | | (unsigned_t & result, Value const * key) const |
| Value * | | find | | (Value const * key) const |
| bool | | find_bool | | (char const * key) const |
| bool | | find_bool | | (Value const * key) const |
| bool | | find_bool_sym | | (symbol_t key) const |
| byte_t | | find_byte | | (char const * key) const |
| byte_t | | find_byte | | (Value const * key) const |
| byte_t | | find_byte_sym | | (symbol_t key) const |
| int | | find_int | | (char const * key) const |
| int | | find_int | | (Value const * key) const |
| int | | find_int_sym | | (symbol_t key) const |
| Item * | | find_item | | (char const * key) const |
| Item * | | find_item | | (Value const * key) const |
| Item * | | find_item_sym | | (symbol_t key) const |
| char const * | | find_string | | (char const * key) const |
| char const * | | find_string | | (Value const * key) const |
| char const * | | find_string_sym | | (symbol_t key) const |
| bool | | find_sym | | (float_t & result, symbol_t key) const |
| bool | | find_sym | | (signed_t & result, symbol_t key) const |
| Value * | | find_sym | | (symbol_t key) const |
| bool | | find_sym | | (unsigned_t & result, symbol_t key) const |
| symbol_t | | find_symbol | | (char const * key) const |
| symbol_t | | find_symbol | | (Value const * key) const |
| symbol_t | | find_symbol_sym | | (symbol_t key) const |
| word32_t | | find_word32 | | (char const * key) const |
| word32_t | | find_word32 | | (Value const * key) const |
| word32_t | | find_word32_sym | | (symbol_t key) const |
| bool | | get | | (float_t & result) const |
| bool | | get | | (signed_t & result) const |
| bool | | get | | (unsigned_t & result) const |
| Value * | | get | | () |
| Value const * | | get | | () const |
| bool | | get_bool | | () const |
| byte_t | | get_byte | | () const |
| int | | get_int | | () const |
| word32_t | | get_word32 | | () const |
| bool | | has | | (char const * key) const |
| bool | | has | | (Value const * key) const |
| bool | | has_sym | | (symbol_t key) const |
| bool | | invalidate | | () |
| bool | | is_special | | (char const * key) const |
| bool | | is_special | | (Value const * key) const |
| bool | | is_special_sym | | (symbol_t key) const |
| bool | | is_valid | | () const |
| bool | | is_valid_special | | () const |
| ValueNumericSimple * | | maximum | | () |
| ValueNumericSimple const * | | maximum | | () const |
| ValueNumericSimple * | | minimum | | () |
| ValueNumericSimple const * | | minimum | | () const |
| ValueNumeric * | | neg | | () const |
| bool | | poke | | (Value * value) |
| bool | | poke | | (unsigned_t value) |
| bool | | poke_float | | (float_t value) |
| bool | | poke_once | | (Value * value) |
| bool | | poke_once | | (unsigned_t value) |
| bool | | poke_once_float | | (float_t value) |
| bool | | poke_once_signed | | (signed_t value) |
| bool | | poke_signed | | (signed_t value) |
| bool | | reset | | (char const * key) |
| bool | | reset | | (Value const * key) |
| bool | | reset_sym | | (symbol_t key) |
| bool | | set | | (char const * key, Value * value) |
| bool | | set | | (char const * key, Item * value) |
| bool | | set | | (char const * key, char const * value) |
| bool | | set | | (char const * key, unsigned_t value) |
| bool | | set | | (Value const * key, Value * value) |
| bool | | set | | (Value const * key, Item * value) |
| bool | | set | | (Value const * key, char const * value) |
| bool | | set | | (Value const * key, unsigned_t value) |
| bool | | set_float | | (char const * key, float_t value) |
| bool | | set_float | | (Value const * key, float_t value) |
| bool | | set_once | | (char const * key, Value * value) |
| bool | | set_once | | (char const * key, Item * value) |
| bool | | set_once | | (char const * key, char const * value) |
| bool | | set_once | | (char const * key, unsigned_t value) |
| bool | | set_once | | (Value const * key, Value * value) |
| bool | | set_once | | (Value const * key, Item * value) |
| bool | | set_once | | (Value const * key, char const * value) |
| bool | | set_once | | (Value const * key, unsigned_t value) |
| bool | | set_once_float | | (char const * key, float_t value) |
| bool | | set_once_float | | (Value const * key, float_t value) |
| bool | | set_once_signed | | (char const * key, signed_t value) |
| bool | | set_once_signed | | (Value const * key, signed_t value) |
| bool | | set_once_sym | | (symbol_t key, Value * value) |
| bool | | set_once_sym | | (symbol_t key, Item * value) |
| bool | | set_once_sym | | (symbol_t key, char const * value) |
| bool | | set_once_sym | | (symbol_t key, unsigned_t value) |
| bool | | set_once_sym_float | | (symbol_t key, float_t value) |
| bool | | set_once_sym_signed | | (symbol_t key, signed_t value) |
| bool | | set_once_sym_symbol | | (symbol_t key, symbol_t value) |
| bool | | set_once_symbol | | (char const * key, symbol_t value) |
| bool | | set_once_symbol | | (Value const * key, symbol_t value) |
| bool | | set_signed | | (char const * key, signed_t value) |
| bool | | set_signed | | (Value const * key, signed_t value) |
| bool | | set_sym | | (symbol_t key, Value * value) |
| bool | | set_sym | | (symbol_t key, Item * value) |
| bool | | set_sym | | (symbol_t key, char const * value) |
| bool | | set_sym | | (symbol_t key, unsigned_t value) |
| bool | | set_sym_float | | (symbol_t key, float_t value) |
| bool | | set_sym_signed | | (symbol_t key, signed_t value) |
| bool | | set_sym_symbol | | (symbol_t key, symbol_t value) |
| bool | | set_symbol | | (char const * key, symbol_t value) |
| bool | | set_symbol | | (Value const * key, symbol_t value) |
| ValueNumeric * | | sub | | (ValueNumeric const *) const |
| ValueNumeric * | | sub | | (AnyValue) const |
| ValueNumeric * | | to_float | | () |
| ValueNumeric const * | | to_float | | () const |
| ValueNumeric * | | to_signed | | () |
| ValueNumeric const * | | to_signed | | () const |
| ValueNumeric * | | to_unsigned | | () |
| ValueNumeric const * | | to_unsigned | | () const |
Inherited Members
Detailed Descriptions
#if CRL_NEED_VALUE_NUMERIC
Value * find (char const * key) const
inherit
#if CRL_NEED_VALUE_NUMERIC
bool find (float_t & result, char const * key) const
| C++: |
bool CrlValueNumeric::find (crl_float_t & result, char const * key) const |
| C: |
crl_bool_t crl_value_numeric_find_float (crl_float_t * result, crl_value_numeric_t const * self, char const * key) |
#if CRL_NEED_VALUE_NUMERIC
bool find (float_t & result, Value const * key) const
#if CRL_NEED_VALUE_NUMERIC
bool find (signed_t & result, char const * key) const
| C++: |
bool CrlValueNumeric::find (crl_signed_t & result, char const * key) const |
| C: |
crl_bool_t crl_value_numeric_find_signed (crl_signed_t * result, crl_value_numeric_t const * self, char const * key) |
#if CRL_NEED_VALUE_NUMERIC
bool find (signed_t & result, Value const * key) const
#if CRL_NEED_VALUE_NUMERIC
bool find (unsigned_t & result, char const * key) const
| C++: |
bool CrlValueNumeric::find (crl_unsigned_t & result, char const * key) const |
| C: |
crl_bool_t crl_value_numeric_find_unsigned (crl_unsigned_t * result, crl_value_numeric_t const * self, char const * key) |
#if CRL_NEED_VALUE_NUMERIC
bool find (unsigned_t & result, Value const * key) const
#if CRL_NEED_VALUE_NUMERIC
Value * find (Value const * key) const
#if CRL_NEED_VALUE_NUMERIC
bool find_bool (char const * key) const
#if CRL_NEED_VALUE_NUMERIC
bool find_bool (Value const * key) const
#if CRL_NEED_VALUE_NUMERIC
bool find_bool_sym (symbol_t key) const
#if CRL_NEED_VALUE_NUMERIC
byte_t find_byte (char const * key) const
#if CRL_NEED_VALUE_NUMERIC
byte_t find_byte (Value const * key) const
#if CRL_NEED_VALUE_NUMERIC
#if CRL_NEED_VALUE_NUMERIC
int find_int (char const * key) const
#if CRL_NEED_VALUE_NUMERIC
int find_int (Value const * key) const
#if CRL_NEED_VALUE_NUMERIC
int find_int_sym (symbol_t key) const
#if CRL_NEED_VALUE_NUMERIC
Item * find_item (char const * key) const
#if CRL_NEED_VALUE_NUMERIC
Item * find_item (Value const * key) const
#if CRL_NEED_VALUE_NUMERIC
Item * find_item_sym (symbol_t key) const
#if CRL_NEED_VALUE_NUMERIC
char const * find_string (char const * key) const
| C++: |
char const * CrlValueNumeric::find_string (char const * key) const |
| C: |
char const * crl_value_numeric_find_string (crl_value_numeric_t const * self, char const * key) |
#if CRL_NEED_VALUE_NUMERIC
char const * find_string (Value const * key) const
#if CRL_NEED_VALUE_NUMERIC
char const * find_string_sym (symbol_t key) const
#if CRL_NEED_VALUE_NUMERIC
bool find_sym (float_t & result, symbol_t key) const
#if CRL_NEED_VALUE_NUMERIC
bool find_sym (signed_t & result, symbol_t key) const
#if CRL_NEED_VALUE_NUMERIC
#if CRL_NEED_VALUE_NUMERIC
bool find_sym (unsigned_t & result, symbol_t key) const
#if CRL_NEED_VALUE_NUMERIC
symbol_t find_symbol (char const * key) const
#if CRL_NEED_VALUE_NUMERIC
symbol_t find_symbol (Value const * key) const
#if CRL_NEED_VALUE_NUMERIC
#if CRL_NEED_VALUE_NUMERIC
word32_t find_word32 (char const * key) const
#if CRL_NEED_VALUE_NUMERIC
word32_t find_word32 (Value const * key) const
#if CRL_NEED_VALUE_NUMERIC
#if CRL_NEED_VALUE_NUMERIC
bool get (float_t & result) const
#if CRL_NEED_VALUE_NUMERIC
bool get (signed_t & result) const
#if CRL_NEED_VALUE_NUMERIC
bool get (unsigned_t & result) const
#if CRL_NEED_VALUE_NUMERIC
bool get_bool () const
#if CRL_NEED_VALUE_NUMERIC
byte_t get_byte () const
#if CRL_NEED_VALUE_NUMERIC
int get_int () const
#if CRL_NEED_VALUE_NUMERIC
word32_t get_word32 () const
#if CRL_NEED_VALUE_NUMERIC
bool has (char const * key) const
#if CRL_NEED_VALUE_NUMERIC
bool has (Value const * key) const
#if CRL_NEED_VALUE_NUMERIC
bool has_sym (symbol_t key) const
#if CRL_NEED_VALUE_NUMERIC
bool invalidate ()
#if CRL_NEED_VALUE_NUMERIC
bool is_special (char const * key) const
#if CRL_NEED_VALUE_NUMERIC
bool is_special (Value const * key) const
#if CRL_NEED_VALUE_NUMERIC
bool is_special_sym (symbol_t key) const
#if CRL_NEED_VALUE_NUMERIC
bool is_valid () const
#if CRL_NEED_VALUE_NUMERIC
bool is_valid_special () const
#if CRL_NEED_VALUE_NUMERIC
bool poke (Value * value)
#if CRL_NEED_VALUE_NUMERIC
bool poke (unsigned_t value)
#if CRL_NEED_VALUE_NUMERIC
bool poke_float (float_t value)
#if CRL_NEED_VALUE_NUMERIC
bool poke_once (Value * value)
#if CRL_NEED_VALUE_NUMERIC
bool poke_once (unsigned_t value)
#if CRL_NEED_VALUE_NUMERIC
bool poke_once_float (float_t value)
#if CRL_NEED_VALUE_NUMERIC
bool poke_once_signed (signed_t value)
#if CRL_NEED_VALUE_NUMERIC
bool poke_signed (signed_t value)
#if CRL_NEED_VALUE_NUMERIC
bool reset (char const * key)
#if CRL_NEED_VALUE_NUMERIC
bool reset (Value const * key)
#if CRL_NEED_VALUE_NUMERIC
bool reset_sym (symbol_t key)
#if CRL_NEED_VALUE_NUMERIC
bool set (char const * key, Value * value)
#if CRL_NEED_VALUE_NUMERIC
bool set (char const * key, Item * value)
#if CRL_NEED_VALUE_NUMERIC
bool set (char const * key, char const * value)
| C++: |
bool CrlValueNumeric::set (char const * key, char const * value) |
| C: |
crl_bool_t crl_value_numeric_set_string (crl_value_numeric_t * self, char const * key, char const * value) |
#if CRL_NEED_VALUE_NUMERIC
bool set (char const * key, unsigned_t value)
| C++: |
bool CrlValueNumeric::set (char const * key, crl_unsigned_t value) |
| C: |
crl_bool_t crl_value_numeric_set_unsigned (crl_value_numeric_t * self, char const * key, crl_unsigned_t value) |
#if CRL_NEED_VALUE_NUMERIC
bool set (Value const * key, Value * value)
#if CRL_NEED_VALUE_NUMERIC
bool set (Value const * key, Item * value)
#if CRL_NEED_VALUE_NUMERIC
bool set (Value const * key, char const * value)
#if CRL_NEED_VALUE_NUMERIC
bool set (Value const * key, unsigned_t value)
#if CRL_NEED_VALUE_NUMERIC
bool set_float (char const * key, float_t value)
| C++: |
bool CrlValueNumeric::set_float (char const * key, crl_float_t value) |
| C: |
crl_bool_t crl_value_numeric_set_float (crl_value_numeric_t * self, char const * key, crl_float_t value) |
#if CRL_NEED_VALUE_NUMERIC
bool set_float (Value const * key, float_t value)
#if CRL_NEED_VALUE_NUMERIC
bool set_once (char const * key, Value * value)
#if CRL_NEED_VALUE_NUMERIC
bool set_once (char const * key, Item * value)
#if CRL_NEED_VALUE_NUMERIC
bool set_once (char const * key, char const * value)
| C++: |
bool CrlValueNumeric::set_once (char const * key, char const * value) |
| C: |
crl_bool_t crl_value_numeric_set_once_string (crl_value_numeric_t * self, char const * key, char const * value) |
#if CRL_NEED_VALUE_NUMERIC
bool set_once (char const * key, unsigned_t value)
| C++: |
bool CrlValueNumeric::set_once (char const * key, crl_unsigned_t value) |
| C: |
crl_bool_t crl_value_numeric_set_once_unsigned (crl_value_numeric_t * self, char const * key, crl_unsigned_t value) |
#if CRL_NEED_VALUE_NUMERIC
bool set_once (Value const * key, Value * value)
#if CRL_NEED_VALUE_NUMERIC
bool set_once (Value const * key, Item * value)
#if CRL_NEED_VALUE_NUMERIC
bool set_once (Value const * key, char const * value)
#if CRL_NEED_VALUE_NUMERIC
bool set_once (Value const * key, unsigned_t value)
#if CRL_NEED_VALUE_NUMERIC
bool set_once_float (char const * key, float_t value)
| C++: |
bool CrlValueNumeric::set_once_float (char const * key, crl_float_t value) |
| C: |
crl_bool_t crl_value_numeric_set_once_float (crl_value_numeric_t * self, char const * key, crl_float_t value) |
#if CRL_NEED_VALUE_NUMERIC
bool set_once_float (Value const * key, float_t value)
#if CRL_NEED_VALUE_NUMERIC
bool set_once_signed (char const * key, signed_t value)
| C++: |
bool CrlValueNumeric::set_once_signed (char const * key, crl_signed_t value) |
| C: |
crl_bool_t crl_value_numeric_set_once_signed (crl_value_numeric_t * self, char const * key, crl_signed_t value) |
#if CRL_NEED_VALUE_NUMERIC
bool set_once_signed (Value const * key, signed_t value)
#if CRL_NEED_VALUE_NUMERIC
bool set_once_sym (symbol_t key, Value * value)
#if CRL_NEED_VALUE_NUMERIC
bool set_once_sym (symbol_t key, Item * value)
#if CRL_NEED_VALUE_NUMERIC
bool set_once_sym (symbol_t key, char const * value)
#if CRL_NEED_VALUE_NUMERIC
bool set_once_sym (symbol_t key, unsigned_t value)
#if CRL_NEED_VALUE_NUMERIC
bool set_once_sym_float (symbol_t key, float_t value)
#if CRL_NEED_VALUE_NUMERIC
bool set_once_sym_signed (symbol_t key, signed_t value)
#if CRL_NEED_VALUE_NUMERIC
bool set_once_sym_symbol (symbol_t key, symbol_t value)
#if CRL_NEED_VALUE_NUMERIC
bool set_once_symbol (char const * key, symbol_t value)
#if CRL_NEED_VALUE_NUMERIC
bool set_once_symbol (Value const * key, symbol_t value)
#if CRL_NEED_VALUE_NUMERIC
bool set_signed (char const * key, signed_t value)
| C++: |
bool CrlValueNumeric::set_signed (char const * key, crl_signed_t value) |
| C: |
crl_bool_t crl_value_numeric_set_signed (crl_value_numeric_t * self, char const * key, crl_signed_t value) |
#if CRL_NEED_VALUE_NUMERIC
bool set_signed (Value const * key, signed_t value)
#if CRL_NEED_VALUE_NUMERIC
bool set_sym (symbol_t key, Value * value)
#if CRL_NEED_VALUE_NUMERIC
bool set_sym (symbol_t key, Item * value)
#if CRL_NEED_VALUE_NUMERIC
bool set_sym (symbol_t key, char const * value)
#if CRL_NEED_VALUE_NUMERIC
bool set_sym (symbol_t key, unsigned_t value)
#if CRL_NEED_VALUE_NUMERIC
bool set_sym_float (symbol_t key, float_t value)
#if CRL_NEED_VALUE_NUMERIC
bool set_sym_signed (symbol_t key, signed_t value)
#if CRL_NEED_VALUE_NUMERIC
bool set_sym_symbol (symbol_t key, symbol_t value)
#if CRL_NEED_VALUE_NUMERIC
bool set_symbol (char const * key, symbol_t value)
#if CRL_NEED_VALUE_NUMERIC
bool set_symbol (Value const * key, symbol_t value)
#if CRL_NEED_VALUE_NUMERIC
self
#if CRL_NEED_VALUE_NUMERIC
Value const * get () const
#if CRL_NEED_VALUE_NUMERIC
This function redirects execution to v_minimum().
The implementation is NULL-safe; for this == NULL, this function returns NULL.
#if CRL_NEED_VALUE_NUMERIC
This function redirects execution to v_maximum().
The implementation is NULL-safe; for this == NULL, this function returns NULL.
#if CRL_NEED_VALUE_NUMERIC
Tries to coerce the number to a float. Ranges will be coerced
seperately for minimum and maximum.
See to_signed() for details about REFing.
This function redirects execution to v_to_float().
The implementation is NULL-safe; for this == NULL, this function returns NULL.
#if CRL_NEED_VALUE_NUMERIC
Tries to coerce the number to an unsigned. Ranges will be coerced
seperately for minimum and maximum.
As in add(), this is occasionally REF_UNREFed. However, this
might simply return this, in which case this is not REF_UNREFed.
This allows you to use something like:
x->set ("test", (new ValueUnsigned(a))->to_signed()).
You could not write this is REF_UNREF was invoked when this is
returned, since the reference counter is 0 after creation. Only
set() increments it.
This function redirects execution to v_to_signed().
The implementation is NULL-safe; for this == NULL, this function returns NULL.
#if CRL_NEED_VALUE_NUMERIC
Tries to coerce the number to a signed. Ranges will be coerced
seperately for minimum and maximum.
See to_signed() for details about REFing.
This function redirects execution to v_to_unsigned().
The implementation is NULL-safe; for this == NULL, this function returns NULL.
#if CRL_NEED_VALUE_NUMERIC
Negates a value. Works for all floats, and for signeds except
for the smallest possible signed value, and for the single
unsigned value of 0.
Note that this always creates a new value, even if equal
to the old one (that's due to C++'s const-qualifier: this
function is const, but the result is not. So we have to
copy).
As in add(), this is REF_UNREFed.
For ranges, the lower and upper bounds are swapped and the
minium and maximum negated individually.
This function redirects execution to v_neg().
The implementation is NULL-safe; for this == NULL, this function returns NULL.
#if CRL_NEED_VALUE_NUMERIC
Creates a new value that is the sum of this and the given value.
This handles signs and ranges correctly. The sign(s) of this
will be the same as for the result, ie. when this is CrlValueUnsigned(),
you'll always get an Unsigned value back, no matter whether the given
operand is signed. This holds for both parts of ranges, too: if the
minimum is signed, you'll get a signed minimum back. The same for
the maximum. Minumum and maximum may have different signs, btw.
The result will be NULL if the resulting value is out of range.
(E.g. when adding the CrlValueSigned(-5) to CrlValueUnsigned(2)).
It will also be NULL if this or the argument is NULL (in order to
pass through overflow errors).
If this or the argument is a range, the result will also be a range.
For floats, this is not yet implemented. Theoretically, they'd work
as follows:
If this is a float, you'll get back a float. If this is not a float,
but the argument is, you'll get back an assertion failure (and not
NULL).
Note that the input value will be REF_UNREFed, so you can pass newly
allocated values without memory leak.
Also note that as a special case, even this is REF_UNREFed (this is
seldom done in this library), so you can write without memory leak:
a= new CrlValueUnsigned(2) // this is also REF_UNREFed by add
->add (new CrlValueSigned(5))
->add (new CrlValueSigned(2));
#if CRL_NEED_VALUE_NUMERIC
Just like add(), but subtracts.
Note that this even handles 3 - (-MAXINT) without an error. This
could not be handled by add() together with neg(). Therefore, sub()
was chosen as the core implementation for subtraction, not neg().
neg() is currently derived from sub().
#if CRL_NEED_VALUE_NUMERIC
Convenience wrapper for C++ for adding numbers easily.
#if CRL_NEED_VALUE_NUMERIC
Convenience wrapper for C++ for subtracting numbers easily.
#if CRL_NEED_VALUE_NUMERIC
#if CRL_NEED_VALUE_NUMERIC
#if CRL_NEED_VALUE_NUMERIC
ValueNumeric const * to_float () const
#if CRL_NEED_VALUE_NUMERIC
ValueNumeric const * to_signed () const
#if CRL_NEED_VALUE_NUMERIC
ValueNumeric const * to_unsigned () const
Occurrences of CrlValueNumeric