OSSIA
Open Scenario System for Interactive Application
|
The parameter_base class. More...
The parameter_base class.
A parameter holds attributes and values. One can subscribe to modification of the value.
Public Types | |
using | callback_index = callback_container< value_callback >::iterator |
Public Types inherited from ossia::callback_container< value_callback > | |
using | impl = std::list< value_callback > |
impl How the callbackas are stored. A list is used since iterators to other callbacks must not be invalidated upon removal. | |
using | iterator = typename impl::iterator |
Public Member Functions | |
parameter_base (ossia::net::node_base &n) | |
parameter_base (const parameter_base &)=delete | |
parameter_base (parameter_base &&)=delete | |
parameter_base & | operator= (const parameter_base &)=delete |
parameter_base & | operator= (parameter_base &&)=delete |
ossia::net::node_base & | get_node () const noexcept |
virtual ossia::net::protocol_base & | get_protocol () const noexcept |
virtual void | pull_value ()=0 |
Value getters ///. More... | |
virtual std::future< void > | pull_value_async () |
pull_value_async More... | |
virtual void | request_value () |
request_value More... | |
virtual ossia::value | value () const =0 |
Clone the current value without any network request. | |
ossia::value | fetch_value () |
Pulls and clone the value. | |
virtual parameter_base & | push_value (const ossia::value &)=0 |
Sets the value locally, and sends it to the network. | |
virtual parameter_base & | push_value (ossia::value &&)=0 |
void | push_value_quiet (const ossia::value &v) |
void | push_value_quiet (ossia::value &&v) |
virtual parameter_base & | push_value ()=0 |
ossia::value | value (ossia::destination_index) const |
Returns the sub-value at the index given by destination_index. | |
std::vector< ossia::value > | value (const std::vector< ossia::destination_index > &) const |
Returns a list of sub-values matching the indexes. | |
virtual ossia::value | set_value (const ossia::value &)=0 |
virtual ossia::value | set_value (ossia::value &&)=0 |
virtual ossia::value | set_value_quiet (const ossia::value &v) |
Reimplement to provide a way that does not call the observers. | |
virtual ossia::value | set_value_quiet (ossia::value &&v) |
std::optional< ossia::value > | get_default_value () const noexcept |
void | set_default_value (const ossia::value &v) |
virtual val_type | get_value_type () const noexcept=0 |
virtual parameter_base & | set_value_type (val_type)=0 |
virtual access_mode | get_access () const noexcept=0 |
virtual parameter_base & | set_access (access_mode)=0 |
virtual const domain & | get_domain () const noexcept=0 |
virtual parameter_base & | set_domain (const domain &)=0 |
virtual bounding_mode | get_bounding () const noexcept=0 |
virtual parameter_base & | set_bounding (bounding_mode)=0 |
repetition_filter | get_repetition_filter () const noexcept |
parameter_base & | set_repetition_filter (repetition_filter=repetition_filter::ON) |
virtual bool | filter_value (const ossia::value &val) const noexcept |
const ossia::unit_t & | get_unit () const noexcept |
by default there is no filter | |
virtual parameter_base & | set_unit (const ossia::unit_t &v) |
bool | get_disabled () const noexcept |
parameter_base & | set_disabled (bool) |
bool | get_muted () const noexcept |
parameter_base & | set_muted (bool) |
bool | get_critical () const noexcept |
parameter_base & | set_critical (bool v) |
parameter_type | get_type () const noexcept |
Public Member Functions inherited from ossia::callback_container< value_callback > | |
callback_container (const callback_container &other) | |
callback_container (callback_container &&other) noexcept | |
callback_container & | operator= (const callback_container &other) |
callback_container & | operator= (callback_container &&other) noexcept |
iterator | add_callback (value_callback &&callback) |
add_callback Add a new callback. More... | |
void | remove_callback (iterator it) |
remove_callback Removes a callback identified by an iterator. More... | |
void | replace_callback (iterator it, value_callback &&cb) |
Replaces an existing callback with another function. | |
void | replace_callbacks (impl &&cbs) |
disabled_callback | disable_callback (iterator it) |
std::size_t | callback_count () const |
callback_count More... | |
bool | callbacks_empty () const |
callbacks_empty More... | |
void | send (Args &&... args) |
send Trigger all callbacks More... | |
void | callbacks_clear () |
clear Clears callbacks. | |
impl m_callbacks | TS_GUARDED_BY (m_mutx) |
Protected Attributes | |
ossia::net::node_base & | m_node |
unit_t | m_unit |
bool | m_critical {} |
bool | m_disabled {} |
bool | m_muted {} |
ossia::repetition_filter | m_repetitionFilter {ossia::repetition_filter::OFF} |
parameter_type | m_type {} |
Additional Inherited Members | |
Public Attributes inherited from ossia::callback_container< value_callback > | |
mutex | m_mutx |
Protected Member Functions inherited from ossia::callback_container< value_callback > | |
virtual void | on_first_callback_added () |
on_first_callback_added More... | |
virtual void | on_removing_last_callback () |
on_removing_last_callback More... | |
|
pure virtual |
Value getters ///.
pull_value
Retrieve the current value over the network. Not all protocols may provide this capability.
This may be a blocking call.
Implemented in ossia::net::generic_parameter.
|
virtual |
pull_value_async
Requests the current value over the network. Not all protocols may provide this capability.
This function returns a future that can be waited upon by client code.
Reimplemented in ossia::net::generic_parameter.
|
virtual |
request_value
Requests the current value over the network. Not all protocols may provide this capability.
This call may not block but there is no guarantee that the value has been pulled when the call returns.
However, the callback will be called when the value is received.
Reimplemented in ossia::net::generic_parameter.
|
pure virtual |
Value setters /// Sends the local value to the network
Implemented in ossia::net::generic_parameter.