maat::Value class

A value is a wrapper class that represent data on a fixed number of bits. The data can be either concrete, or abstract. The underlying implementation uses the Expr and Number classes to represent abstract and concrete values.

❱   Base classes

class Serializable
Virtual interface that serializable classes must implement.

❱   Constructors, destructors, conversion operators

Value()
Empty value.

Value(const Value& other) defaulted
Copy constructor.

Value(const Expr& expr)
Build value from abstract expression.

Value(const Number& number)
Build value from concrete number.

Value(size_t size, cst_t val)
Build value from concrete value.

❱   Public functions

auto operator=(const Value& other) -> Value& defaulted
Copy assignment.

auto operator=(Value&& other) -> Value& defaulted
Move assignment.

auto operator=(const Expr& e) -> Value&
Build Value from expression.

auto operator=(Expr&& e) -> Value&
Build Value from expression.

auto operator=(const Number& n) -> Value&
Build Value from number.

auto operator=(Number&& n) -> Value&
Build Value from number.

void set_cst(size_t size, cst_t val)
Build Value from constant and size in bits.

auto as_expr() const -> Expr
Return the value as an abstract expression.

auto as_int() const -> cst_t
Return the value as a concrete signed value.

auto as_uint() const -> ucst_t
Return the value as a concrete unsigned value.

auto as_float() const -> fcst_t
Return the value as a concrete floating point value.

auto as_int(const VarContext&) const -> cst_t
Return the value as a concrete signed value.

auto as_float(const VarContext&) const -> fcst_t
Return the value as a concrete unsigned value.

auto as_number() const -> const Number&
Return the value as a concrete number.

auto as_number(const VarContext&) const -> const Number&
Return the value as a concrete number.

auto class_uid() const -> uid_t virtual
Return the class uid (see ClassId enum)

void dump(serial::Serializer&) const virtual
Dump the object contents in a serializer stream.

void load(serial::Deserializer&) virtual
Restore an object from a deserializer stream.