Skip to content

Class zmbt::lang::Operator

ClassList > zmbt > lang > Operator

Signal transformation and comparison handler. Enables type erasure.

  • #include <operator.hpp>

Public Types

Type Name
enum std::uint32_t Config
typedef LazyParam LV
typedef boost::json::value V

Public Functions

Type Name
Operator ()
Default operator with generic transforms.
Operator (type_tag< T > tag, Config const cfg)
Operator with T as type decorator.
Operator (type_tag< T > tag)
Operator with T as type decorator.
Operator (boost::json::string_view annotation)
Retrieve registered operator instance if it exists, throw otherwise.
Operator (Operator const &) = default
Operator (Operator &&) = default
boost::json::string annotation () const
decorated type name
boost::json::value apply (lang::Keyword const & keyword, LV lhs, LV rhs) const
Apply operands.
boost::json::value decorate (boost::json::value const & a) const
Reserialize as decorated type.
bool is_generic () const
Operator & operator= (Operator const &) = default
Operator & operator= (Operator &&) = default
boost::json::value undecorate (boost::json::value const & a) const
Reserialize as decorated type.
virtual ~Operator () = default

Public Static Functions

Type Name
V generic_bit_and (LV, LV)
V generic_bit_or (LV, LV)
V generic_bit_xor (LV, LV)
V generic_complement (LV)
V generic_decorate (LV)
V generic_divides (LV, LV)
V generic_equal_to (LV, LV)
V generic_is_truth (LV)
V generic_left_shift (LV, LV)
V generic_less (LV, LV)
V generic_less_equal (LV, LV)
V generic_log (LV, LV)
V generic_logical_and (LV, LV)
V generic_logical_not (LV)
V generic_logical_or (LV, LV)
V generic_minus (LV, LV)
V generic_modulus (LV, LV)
V generic_multiplies (LV, LV)
V generic_negate (LV)
V generic_plus (LV, LV)
V generic_pow (LV, LV)
V generic_quot (LV, LV)
V generic_right_shift (LV, LV)
V generic_undecorate (LV)

Public Types Documentation

enum Config

enum zmbt::lang::Operator::Config {
    Null,
    Decor = 1U << 0,
    Comparison = 1U << 1,
    Arithmetics = 1U << 2,
    Bitwise = 1U << 3,
    Shift = 1U << 4,
    Logic = 1U << 5,
    Default = Decor|Comparison|Arithmetics|Bitwise|Shift,
    Full = Default|Logic
};

typedef LV

using zmbt::lang::Operator::LV =  LazyParam;

typedef V

using zmbt::lang::Operator::V =  boost::json::value;

Public Functions Documentation

function Operator [2/7]

Default operator with generic transforms.

zmbt::lang::Operator::Operator () 


function Operator [3/7]

Operator with T as type decorator.

template<class T>
inline zmbt::lang::Operator::Operator (
    type_tag < T > tag,
    Config const cfg
) 


function Operator [4/7]

Operator with T as type decorator.

template<class T>
inline zmbt::lang::Operator::Operator (
    type_tag < T > tag
) 


function Operator [5/7]

Retrieve registered operator instance if it exists, throw otherwise.

zmbt::lang::Operator::Operator (
    boost::json::string_view annotation
) 


function Operator [6/7]

zmbt::lang::Operator::Operator (
    Operator const &
) = default

function Operator [7/7]

zmbt::lang::Operator::Operator (
    Operator &&
) = default

function annotation

decorated type name

inline boost::json::string zmbt::lang::Operator::annotation () const


function apply

Apply operands.

boost::json::value zmbt::lang::Operator::apply (
    lang::Keyword const & keyword,
    LV lhs,
    LV rhs
) const

For unary operators, lhs is nullptr


function decorate

Reserialize as decorated type.

inline boost::json::value zmbt::lang::Operator::decorate (
    boost::json::value const & a
) const


function is_generic

inline bool zmbt::lang::Operator::is_generic () const

function operator=

Operator & zmbt::lang::Operator::operator= (
    Operator const &
) = default

function operator=

Operator & zmbt::lang::Operator::operator= (
    Operator &&
) = default

function undecorate

Reserialize as decorated type.

inline boost::json::value zmbt::lang::Operator::undecorate (
    boost::json::value const & a
) const


function ~Operator

virtual zmbt::lang::Operator::~Operator () = default

Public Static Functions Documentation

function generic_bit_and

static V zmbt::lang::Operator::generic_bit_and (
    LV,
    LV
) 

function generic_bit_or

static V zmbt::lang::Operator::generic_bit_or (
    LV,
    LV
) 

function generic_bit_xor

static V zmbt::lang::Operator::generic_bit_xor (
    LV,
    LV
) 

function generic_complement

static V zmbt::lang::Operator::generic_complement (
    LV
) 

function generic_decorate

static V zmbt::lang::Operator::generic_decorate (
    LV
) 

function generic_divides

static V zmbt::lang::Operator::generic_divides (
    LV,
    LV
) 

function generic_equal_to

static V zmbt::lang::Operator::generic_equal_to (
    LV,
    LV
) 

function generic_is_truth

static V zmbt::lang::Operator::generic_is_truth (
    LV
) 

function generic_left_shift

static V zmbt::lang::Operator::generic_left_shift (
    LV,
    LV
) 

function generic_less

static V zmbt::lang::Operator::generic_less (
    LV,
    LV
) 

function generic_less_equal

static V zmbt::lang::Operator::generic_less_equal (
    LV,
    LV
) 

function generic_log

static V zmbt::lang::Operator::generic_log (
    LV,
    LV
) 

function generic_logical_and

static V zmbt::lang::Operator::generic_logical_and (
    LV,
    LV
) 

function generic_logical_not

static V zmbt::lang::Operator::generic_logical_not (
    LV
) 

function generic_logical_or

static V zmbt::lang::Operator::generic_logical_or (
    LV,
    LV
) 

function generic_minus

static V zmbt::lang::Operator::generic_minus (
    LV,
    LV
) 

function generic_modulus

static V zmbt::lang::Operator::generic_modulus (
    LV,
    LV
) 

function generic_multiplies

static V zmbt::lang::Operator::generic_multiplies (
    LV,
    LV
) 

function generic_negate

static V zmbt::lang::Operator::generic_negate (
    LV
) 

function generic_plus

static V zmbt::lang::Operator::generic_plus (
    LV,
    LV
) 

function generic_pow

static V zmbt::lang::Operator::generic_pow (
    LV,
    LV
) 

function generic_quot

static V zmbt::lang::Operator::generic_quot (
    LV,
    LV
) 

function generic_right_shift

static V zmbt::lang::Operator::generic_right_shift (
    LV,
    LV
) 

function generic_undecorate

static V zmbt::lang::Operator::generic_undecorate (
    LV
) 


The documentation for this class was generated from the following file zmbt-framework/zmbt-framework/backends/cxx/include/zmbt/expr/operator.hpp