Awali
Another Weighted Automata library
Public Member Functions | Data Fields
awali::json::float_t Class Referencefinal

#include <node.hh>

Inheritance diagram for awali::json::float_t:
awali::json::node_t

Public Member Functions

 float_t (double v)
 
virtual float_tcopy () const override
 
virtual float_t const * floating () const override
 Casts this not to float_t. More...
 
virtual float_tfloating () override
 Casts this not to float_t. More...
 
virtual bool to_bool () const override
 Coerces this node_t to bool. More...
 
virtual double to_double () const override
 Coerces this node_t to a double More...
 
virtual int to_int () const override
 Coerces this node_t to int. More...
 
- Public Member Functions inherited from awali::json::node_t
virtual ~node_t ()
 
virtual unsigned arity () const
 
virtual array_tarray ()
 Casts this node to array_t. More...
 
virtual array_t const * array () const
 Casts this node to array_t. More...
 
virtual node_tat (std::string const &key)
 
virtual node_t const * at (std::string const &key) const
 
virtual node_tat (unsigned i)
 
virtual node_t const * at (unsigned i) const
 
node_tat_path (path_t const &path, unsigned i=0)
 
node_t const * at_path (path_t const &path, unsigned i=0) const
 
virtual bool_tboolean ()
 Casts this node to bool_t. More...
 
virtual bool_t const * boolean () const
 Casts this node to bool_t. More...
 
virtual bool has_child (std::string const &) const
 
virtual bool has_child (unsigned) const
 
bool has_path (json::path_t const &path) const
 
virtual unsigned height () const
 
virtual int_tinteger ()
 Casts this node to int_t. More...
 
virtual int_t const * integer () const
 Casts this node to int_t. More...
 
bool is (node_kind_t k) const
 
bool is (std::vector< node_kind_t >const &v) const
 
bool is_leaf () const
 
virtual null_tnull ()
 Casts this node to null_t. More...
 
virtual null_t const * null () const
 Casts this node to null_t. More...
 
virtual object_tobject ()
 Casts this node to object_t. More...
 
virtual object_t const * object () const
 Casts this node to object_t. More...
 
path_t path_to_root () const
 
virtual string_tstring ()
 Casts this node to string_t. More...
 
virtual string_t const * string () const
 Casts this node to string_t. More...
 
virtual std::string to_string () const
 Coerces this node_t to an std::string. More...
 

Data Fields

double value
 
- Data Fields inherited from awali::json::node_t
node_kind_t const kind
 
node_t const * parent
 

Additional Inherited Members

- Protected Member Functions inherited from awali::json::node_t
 node_t (node_kind_t k)
 

Constructor & Destructor Documentation

◆ float_t()

awali::json::float_t::float_t ( double  v)

Member Function Documentation

◆ copy()

virtual float_t* awali::json::float_t::copy ( ) const
overridevirtual

Implements awali::json::node_t.

◆ floating() [1/2]

virtual float_t const* awali::json::float_t::floating ( ) const
overridevirtual

Casts this not to float_t.

Reimplemented from awali::json::node_t.

◆ floating() [2/2]

virtual float_t* awali::json::float_t::floating ( )
overridevirtual

Casts this not to float_t.

Reimplemented from awali::json::node_t.

◆ to_bool()

virtual bool awali::json::float_t::to_bool ( ) const
overridevirtual

Coerces this node_t to bool.

Exceptions
type_missmatchif this node_t is not a bool_t, an int_t, a {float_t} or a string_t
coercion_exceptionif this node_t is an int_t and held value is not 0 or 1; or if it is a string_t and held value is one of {"0", "1", "true", "false", "True", "False"}.

Reimplemented from awali::json::node_t.

◆ to_double()

virtual double awali::json::float_t::to_double ( ) const
overridevirtual

Coerces this node_t to a double

Exceptions
type_missmatchif this node_t is not a bool_t, an int_t, a float_t, or a string_t.
coercion_exceptionif this node_t is a string_t the value of which is not the string-representation of a double.

Reimplemented from awali::json::node_t.

◆ to_int()

virtual int awali::json::float_t::to_int ( ) const
overridevirtual

Coerces this node_t to int.

Exceptions
type_missmatchif this node_t is not a bool_t, an int_t, a float_t, or a string_t.
coercion_exceptionif this node_t is a string_t the value of which is not the string-representation of an integer; or if this node_t is a float_t the held value of which is not an integer.

Reimplemented from awali::json::node_t.

Field Documentation

◆ value

double awali::json::float_t::value

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