Base class for numeric variant values. More...
#include <variant_value.hpp>
Public Member Functions | |
variant_numeric (int value) | |
virtual bool | as_bool () const override |
Returns a bool expression of the variant value. More... | |
int | get_numeric_value () const |
virtual bool | equals (variant_value_base &other) const override |
Called to determine if this variant is equal to another of the same type. More... | |
virtual bool | less_than (variant_value_base &other) const override |
Called to determine if this variant is less than another of the same type. More... | |
Public Member Functions inherited from wfl::variant_value_base | |
virtual std::size_t | num_elements () const |
Returns the number of elements in a type. More... | |
virtual bool | is_empty () const |
Whether the stored value is considered empty or not. More... | |
virtual std::string | string_cast () const |
Returns the stored variant value in plain string form. More... | |
virtual std::string | get_serialized_string () const |
Returns the stored variant value in formula syntax. More... | |
virtual std::string | get_debug_string (formula_seen_stack &, bool) const |
Returns debug info for the variant value. More... | |
virtual const formula_variant::type & | get_type () const |
Returns the id of the variant type. More... | |
virtual boost::iterator_range< variant_iterator > | make_iterator () const |
Creates an iterator pair that can be used for iteration. More... | |
virtual variant | deref_iterator (const utils::any &iter) const |
Implements the dereference functionality of variant_iterator for a value of this type. More... | |
virtual void | iterator_inc (utils::any &) const |
Implements the increment functionality of variant_iterator for a value of this type. More... | |
virtual void | iterator_dec (utils::any &) const |
Implements the decrement functionality of variant_iterator for a value of this type. More... | |
virtual bool | iterator_equals (const utils::any &, const utils::any &) const |
Implements the equality functionality of variant_iterator for a value of this type. More... | |
virtual | ~variant_value_base () |
Protected Attributes | |
int | value_ |
Base class for numeric variant values.
Currently only supports a value stored as an integer, but for now, that's all that's necessary.
Definition at line 195 of file variant_value.hpp.
|
inlineexplicit |
Definition at line 198 of file variant_value.hpp.
|
inlineoverridevirtual |
Returns a bool expression of the variant value.
Reimplemented from wfl::variant_value_base.
Definition at line 200 of file variant_value.hpp.
References value_.
|
inlineoverridevirtual |
Called to determine if this variant is equal to another of the same type.
This function is only called if get_type() returns the same result for both arguments.
Reimplemented from wfl::variant_value_base.
Definition at line 210 of file variant_value.hpp.
References value_.
|
inline |
Definition at line 205 of file variant_value.hpp.
References value_.
|
inlineoverridevirtual |
Called to determine if this variant is less than another of the same type.
This function is only called if get_type() returns the same result for both arguments.
Reimplemented from wfl::variant_value_base.
Definition at line 215 of file variant_value.hpp.
|
protected |
Definition at line 221 of file variant_value.hpp.
Referenced by as_bool(), wfl::variant_int::build_range_variant(), equals(), get_numeric_value(), wfl::variant_int::string_cast(), wfl::variant_decimal::to_string_impl(), and wfl::variant_decimal::variant_decimal().