OSSIA
Open Scenario System for Interactive Application
|
This file defines the expression API. An expression is a logical construct such as :
(a:/b == 1) && (c:/d <= 2.)
pulse(a:/b)
!(c:/d == e:/f/g)
etc...
The basic logical operators are expression_not (!) and expression_composition (and, or, xor).
expression_atom is used for numeric comparison : <=, ==, >, etc.
expression_bool is a simple boolean value.
expression_pulse is an expression that will become true if a particular message happened since the last time it has been updated.
The expressions are organised as a tree. The expression results are passed by cascading callbacks to allow notification when an expression is listened to.
Go to the source code of this file.
Namespaces | |
ossia | |
Functions | |
bool | ossia::expressions::evaluate (const expression_base &e) |
evaluate More... | |
bool | ossia::expressions::evaluate (const expression_ptr &e) |
void | ossia::expressions::update (const expression_base &e) |
update More... | |
void | ossia::expressions::update (const expression_ptr &e) |
void | ossia::expressions::reset (expression_base &e) |
reset More... | |
void | ossia::expressions::reset (const expression_ptr &e) |
bool | ossia::expressions::operator== (const expression_base &lhs, const expression_base &rhs) |
operator==(const expression_base& lhs, const expression_base& rhs) Compares two expressions. More... | |
bool | ossia::expressions::operator!= (const expression_base &lhs, const expression_base &rhs) |
expression_callback_iterator | ossia::expressions::add_callback (expression_base &, expression_result_callback) |
add_callback Add a callback to an expression. | |
void | ossia::expressions::remove_callback (expression_base &, expression_callback_iterator) |
remove_callback Remove a callback to an expression. | |
std::size_t | ossia::expressions::callback_count (expression_base &) |
callback_count More... | |
const expression_base & | ossia::expressions::expression_true () |
expression_true Convenience constant expression always evaluating to true. | |
const expression_base & | ossia::expressions::expression_false () |
false Convenience constant expression always evaluating to false. | |
expression_ptr | ossia::expressions::make_expression_true () |
make_expression_true More... | |
bool | ossia::expressions::is_expression_true (ossia::expression &e) noexcept |
expression_ptr | ossia::expressions::make_expression_false () |
make_expression_false More... | |
template<typename... Args> | |
expression_ptr | ossia::expressions::make_expression_atom (Args &&... args) |
make_expression_atom More... | |
expression_ptr | ossia::expressions::make_expression_atom (const expression_atom::val_t &lhs, comparator c, const expression_atom::val_t &rhs) |
expression_ptr | ossia::expressions::make_expression_atom (expression_atom::val_t &&lhs, comparator c, expression_atom::val_t &&rhs) |
template<typename... Args> | |
expression_ptr | ossia::expressions::make_expression_bool (Args &&... args) |
make_expression_bool More... | |
template<typename... Args> | |
expression_ptr | ossia::expressions::make_expression_composition (Args &&... args) |
make_expression_composition More... | |
template<typename... Args> | |
expression_ptr | ossia::expressions::make_expression_not (Args &&... args) |
make_expression_not More... | |
template<typename... Args> | |
expression_ptr | ossia::expressions::make_expression_pulse (Args &&... args) |
make_expression_pulse More... | |
template<typename T , typename... Args> | |
expression_ptr | ossia::expressions::make_expression_generic (Args &&... args) |
OSSIA_EXPORT bool ossia::expressions::evaluate | ( | const expression_base & | e | ) |
evaluate
e | An expression |
OSSIA_EXPORT void ossia::expressions::update | ( | const expression_base & | e | ) |
update
e | An expression |
Recursively asks an expression to query the addresses that it refers, in order to check if the value has changed.
OSSIA_EXPORT void ossia::expressions::reset | ( | expression_base & | e | ) |
reset
e | An expression |
OSSIA_EXPORT bool ossia::expressions::operator== | ( | const expression_base & | lhs, |
const expression_base & | rhs | ||
) |
operator==(const expression_base& lhs, const expression_base& rhs) Compares two expressions.
Two expressions are comparable if they have all the same terms.
OSSIA_EXPORT std::size_t ossia::expressions::callback_count | ( | expression_base & | ) |
callback_count
|
inline |
make_expression_true
The following functions are factories used to create expressions.
|
inline |
make_expression_false
expression_ptr ossia::expressions::make_expression_atom | ( | Args &&... | args | ) |
make_expression_atom
expression_ptr ossia::expressions::make_expression_bool | ( | Args &&... | args | ) |
make_expression_bool
expression_ptr ossia::expressions::make_expression_composition | ( | Args &&... | args | ) |
make_expression_composition
expression_ptr ossia::expressions::make_expression_not | ( | Args &&... | args | ) |
make_expression_not
expression_ptr ossia::expressions::make_expression_pulse | ( | Args &&... | args | ) |
make_expression_pulse