OSSIA
Open Scenario System for Interactive Application
ossia::net::generic_parameter Class Reference
Inheritance diagram for ossia::net::generic_parameter:
ossia::net::parameter_base ossia::callback_container< value_callback >

Detailed Description

Default implementation for parameter_base, with everything expected and mutable

Public Member Functions

 generic_parameter (ossia::net::node_base &node_base)
 Used for repetition filter.
 
 generic_parameter (const parameter_data &, ossia::net::node_base &node_base)
 
ossia::net::protocol_baseget_protocol () const noexcept override
 
void pull_value () final override
 Value getters ///. More...
 
std::future< void > pull_value_async () final override
 pull_value_async More...
 
void request_value () final override
 request_value More...
 
ossia::net::generic_parameterpush_value (const ossia::value &) final override
 Sets the value locally, and sends it to the network.
 
ossia::net::generic_parameterpush_value (ossia::value &&) final override
 
ossia::net::generic_parameterpush_value () final override
 
const ossia::valuegetValue () const
 
ossia::value value () const final override
 Clone the current value without any network request.
 
ossia::value set_value (const ossia::value &) override
 
ossia::value set_value (ossia::value &&) override
 
ossia::value set_value_quiet (const ossia::value &) override
 
ossia::value set_value_quiet (ossia::value &&) override
 
void set_value_quiet (const ossia::destination &)
 
ossia::val_type get_value_type () const noexcept final override
 
ossia::net::generic_parameterset_value_type (ossia::val_type) final override
 
ossia::access_mode get_access () const noexcept final override
 
ossia::net::generic_parameterset_access (ossia::access_mode) final override
 
const ossia::domainget_domain () const noexcept final override
 
ossia::net::generic_parameterset_domain (const ossia::domain &) final override
 
ossia::bounding_mode get_bounding () const noexcept final override
 
ossia::net::generic_parameterset_bounding (ossia::bounding_mode) final override
 
bool filter_value (const ossia::value &val) const noexcept final override
 
generic_parameterset_unit (const ossia::unit_t &v) final override
 
void on_first_callback_added () final override
 on_first_callback_added More...
 
void on_removing_last_callback () final override
 on_removing_last_callback More...
 
- Public Member Functions inherited from ossia::net::parameter_base
 parameter_base (ossia::net::node_base &n)
 
 parameter_base (const parameter_base &)=delete
 
 parameter_base (parameter_base &&)=delete
 
parameter_baseoperator= (const parameter_base &)=delete
 
parameter_baseoperator= (parameter_base &&)=delete
 
ossia::net::node_baseget_node () const noexcept
 
ossia::value fetch_value ()
 Pulls and clone the value.
 
void push_value_quiet (const ossia::value &v)
 
void push_value_quiet (ossia::value &&v)
 
ossia::value value (ossia::destination_index) const
 Returns the sub-value at the index given by destination_index.
 
std::vector< ossia::valuevalue (const std::vector< ossia::destination_index > &) const
 Returns a list of sub-values matching the indexes.
 
std::optional< ossia::valueget_default_value () const noexcept
 
void set_default_value (const ossia::value &v)
 
repetition_filter get_repetition_filter () const noexcept
 
parameter_baseset_repetition_filter (repetition_filter=repetition_filter::ON)
 
const ossia::unit_tget_unit () const noexcept
 by default there is no filter
 
bool get_disabled () const noexcept
 
parameter_baseset_disabled (bool)
 
bool get_muted () const noexcept
 
parameter_baseset_muted (bool)
 
bool get_critical () const noexcept
 
parameter_baseset_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_containeroperator= (const callback_container &other)
 
callback_containeroperator= (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 Member Functions

ossia::value m_value TS_GUARDED_BY (m_valueMutex)
 

Protected Attributes

ossia::net::protocol_basem_protocol
 
ossia::val_type m_valueType {}
 
ossia::access_mode m_accessMode {}
 
ossia::bounding_mode m_boundingMode {}
 
mutex_t m_valueMutex
 
ossia::domain m_domain
 
ossia::value m_previousValue
 
- Protected Attributes inherited from ossia::net::parameter_base
ossia::net::node_basem_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 Types inherited from ossia::net::parameter_base
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 Attributes inherited from ossia::callback_container< value_callback >
mutex m_mutx
 

Member Function Documentation

◆ pull_value()

void ossia::net::generic_parameter::pull_value ( )
finaloverridevirtual

Value getters ///.

pull_value

Retrieve the current value over the network. Not all protocols may provide this capability.

This may be a blocking call.

Implements ossia::net::parameter_base.

◆ pull_value_async()

std::future< void > ossia::net::generic_parameter::pull_value_async ( )
finaloverridevirtual

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 from ossia::net::parameter_base.

◆ request_value()

void ossia::net::generic_parameter::request_value ( )
finaloverridevirtual

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 from ossia::net::parameter_base.

◆ push_value()

ossia::net::generic_parameter & ossia::net::generic_parameter::push_value ( )
finaloverridevirtual

Value setters /// Sends the local value to the network

Implements ossia::net::parameter_base.

◆ set_value_quiet()

ossia::value ossia::net::generic_parameter::set_value_quiet ( const ossia::value val)
overridevirtual

Set a value without sending notifications

Reimplemented from ossia::net::parameter_base.

◆ on_first_callback_added()

void ossia::net::generic_parameter::on_first_callback_added ( )
finaloverridevirtual

on_first_callback_added

These functions can be reimplemented by subclasses wishing to perform special actions. For instance, when the last callback is removed, stop listening somewhere...

See also
on_removing_last_callback

Reimplemented from ossia::callback_container< value_callback >.

◆ on_removing_last_callback()

void ossia::net::generic_parameter::on_removing_last_callback ( )
finaloverridevirtual

on_removing_last_callback

See also
on_first_callback_added

Reimplemented from ossia::callback_container< value_callback >.