$darkmode
#include <any>#include <cassert>#include <functional>#include <map>#include <memory>#include <regex>#include <stdexcept>#include <string_view>#include <typeindex>#include <vector>#include <fmt/format.h>#include <sol/sol.hpp>Go to the source code of this file.
Macros | |
| #define | CLOE_DATA_BROKER_HPP_ |
| #define | LUADATATYPE_LIST |
| #define | X(name, value) name = value, |
| #define | X(name, value) |
| #define | PHYSICALQUANTITIES_LIST |
| #define | X(name, value) name, |
| #define | X(name, value) |
| #define | CLOE_DATABROKER_TEMPLATE_INSTANTIATION(elem) |
| #define | CLOE_DATABROKER_TEMPLATE_INSTANTATION_TYPES() |
Typedefs | |
| template<typename T > | |
| using | cloe::databroker::compatible_base_t = typename type_t_or_int_if< T, !is_incompatible_type_v< T > >::type |
| template<typename T > | |
| using | cloe::databroker::signal_type_cref_t = databroker::compatible_base_t< T > const & |
| template<typename T > | |
| using | cloe::databroker::on_value_changed_callback_t = std::function< void(signal_type_cref_t< T >)> |
| using | cloe::lua_signal_adapter_t = std::function< void(const SignalPtr &, sol::state_view, std::string_view)> |
| using | cloe::lua_signal_declarator_t = std::function< void(sol::state_view)> |
| template<typename T > | |
| using | cloe::Container = BasicContainer< databroker::compatible_base_t< T > > |
Functions | |
| template<typename T > | |
| void | cloe::databroker::detail::to_lua (sol::state_view lua) |
| template<typename T > | |
| constexpr void | cloe::assert_static_type () |
| template<typename T , typename U > | |
| constexpr bool | cloe::operator== (const BasicContainer< T > &lhs, const BasicContainer< U > &rhs) |
| template<typename T , typename U > | |
| constexpr bool | cloe::operator!= (const BasicContainer< T > &lhs, const BasicContainer< U > &rhs) |
| template<typename T , typename U > | |
| constexpr bool | cloe::operator< (const BasicContainer< T > &lhs, const BasicContainer< U > &rhs) |
| template<typename T , typename U > | |
| constexpr bool | cloe::operator<= (const BasicContainer< T > &lhs, const BasicContainer< U > &rhs) |
| template<typename T , typename U > | |
| constexpr bool | cloe::operator> (const BasicContainer< T > &lhs, const BasicContainer< U > &rhs) |
| template<typename T , typename U > | |
| constexpr bool | cloe::operator>= (const BasicContainer< T > &lhs, const BasicContainer< U > &rhs) |
| template<typename T , typename U > | |
| constexpr bool | cloe::operator== (const BasicContainer< T > &lhs, const U &rhs) |
| template<typename T , typename U > | |
| constexpr bool | cloe::operator== (const T &lhs, const BasicContainer< U > &rhs) |
| template<typename T , typename U > | |
| constexpr bool | cloe::operator!= (const BasicContainer< T > &lhs, const U &rhs) |
| template<typename T , typename U > | |
| constexpr bool | cloe::operator!= (const T &lhs, const BasicContainer< U > &rhs) |
| template<typename T , typename U > | |
| constexpr bool | cloe::operator< (const BasicContainer< T > &lhs, const U &rhs) |
| template<typename T , typename U > | |
| constexpr bool | cloe::operator< (const T &lhs, const BasicContainer< U > &rhs) |
| template<typename T , typename U > | |
| constexpr bool | cloe::operator<= (const BasicContainer< T > &lhs, const U &rhs) |
| template<typename T , typename U > | |
| constexpr bool | cloe::operator<= (const T &lhs, const BasicContainer< U > &rhs) |
| template<typename T , typename U > | |
| constexpr bool | cloe::operator> (const BasicContainer< T > &lhs, const U &rhs) |
| template<typename T , typename U > | |
| constexpr bool | cloe::operator> (const T &lhs, const BasicContainer< U > &rhs) |
| template<typename T , typename U > | |
| constexpr bool | cloe::operator>= (const BasicContainer< T > &lhs, const U &rhs) |
| template<typename T , typename U > | |
| constexpr bool | cloe::operator>= (const T &lhs, const BasicContainer< U > &rhs) |
Variables | |
| template<typename T > | |
| constexpr bool | cloe::databroker::detail::has_to_lua_v = has_to_lua<T>::value |
| template<typename T > | |
| constexpr bool | cloe::databroker::is_incompatible_type_v = std::is_void_v<T> || std::is_reference_v<T> |
Classes: DataBroker: A central registry for (type erased) signals.
Signal: A type-erased abstraction of a signal.
BasicContainer<T> An optional container storing the value of a signal and abstracting the interaction with Signal.
Background: Real world simulations utilize manifolds of signals (variables) and coresponding types. Still the very basic problem around a single signal (variable) boils down to CRUD
Concept: Abstract CRU(D) operations by registering signals in a uniform way by their name.
| #define CLOE_DATABROKER_TEMPLATE_INSTANTIATION | ( | elem | ) |
| #define LUADATATYPE_LIST |
X-Macro: enum definition & enum-to-string conversion
| #define PHYSICALQUANTITIES_LIST |
X-Macro: enum definition & enum-to-string conversion
| #define X | ( | name, | |
| value | |||
| ) |
| #define X | ( | name, | |
| value | |||
| ) |
| using cloe::databroker::compatible_base_t = typedef typename type_t_or_int_if<T, !is_incompatible_type_v<T> >::type |
Determines a datatype which is compatible with the data broker, derived from the template type.
| using cloe::lua_signal_adapter_t = typedef std::function<void(const SignalPtr&, sol::state_view, std::string_view)> |
Function which integrates a specific datum into the Lua-VM
| using cloe::lua_signal_declarator_t = typedef std::function<void(sol::state_view)> |
Function which declares a specific datatype to the Lua-VM
| using cloe::databroker::on_value_changed_callback_t = typedef std::function<void(signal_type_cref_t<T>)> |
Type of event function, which is called when the value of a signal changed
| using cloe::databroker::signal_type_cref_t = typedef databroker::compatible_base_t<T> const& |
Argument-/Return-Type of signal related functions
|
constexpr |
Assert that the type-argument is compatible with the data broker.
| void cloe::databroker::detail::to_lua | ( | sol::state_view | lua | ) |
Invokes to_lua procedure, if detecting its presence
|
constexpr |
Detects the presence of the to_lua function (based on ADL)
|
constexpr |
Predicate which determines whether a type is incompatible with the data broker.