OSSIA
Open Scenario System for Interactive Application
Loading...
Searching...
No Matches
generic_parameter.hpp
1#pragma once
3#include <ossia/detail/mutex.hpp>
4#include <ossia/detail/optional.hpp>
6#include <ossia/network/base/parameter.hpp>
7#include <ossia/network/domain/domain.hpp>
8#include <ossia/network/generic/generic_device.hpp>
9#include <ossia/network/value/value.hpp>
10
11#include <string>
12#include <thread>
13#include <vector>
14
15namespace ossia::net
16{
17
18struct parameter_data;
19class protocol_base;
20
24{
25protected:
26 ossia::net::protocol_base& m_protocol;
27
28 ossia::val_type m_valueType{};
29 ossia::access_mode m_accessMode{};
30 ossia::bounding_mode m_boundingMode{};
31
32 mutable mutex_t m_valueMutex;
33 ossia::value m_value TS_GUARDED_BY(m_valueMutex);
34
35 ossia::domain m_domain;
36
37 ossia::value m_previousValue;
38public:
41
43
44 ossia::net::protocol_base& get_protocol() const noexcept override
45 {
46 return m_protocol;
47 }
48
49 void pull_value() final override;
50 std::future<void> pull_value_async() final override;
51 void request_value() final override;
52
56
57 const ossia::value& getValue() const;
58 ossia::value value() const final override;
59 ossia::value set_value(const ossia::value&) override;
60 ossia::value set_value(ossia::value&&) override;
61
63 ossia::value set_value_quiet(const ossia::value&) override;
64 ossia::value set_value_quiet(ossia::value&&) override;
65 void set_value_quiet(const ossia::destination&);
66
67 ossia::val_type get_value_type() const noexcept final override;
68 ossia::net::generic_parameter& set_value_type(ossia::val_type) final override;
69
70 ossia::access_mode get_access() const noexcept final override;
71 ossia::net::generic_parameter& set_access(ossia::access_mode) final override;
72
73 const ossia::domain& get_domain() const noexcept final override;
74 ossia::net::generic_parameter& set_domain(const ossia::domain&) final override;
75
76 ossia::bounding_mode get_bounding() const noexcept final override;
77 ossia::net::generic_parameter& set_bounding(ossia::bounding_mode) final override;
78
79 bool filter_value(const ossia::value& val) const noexcept final override;
80
81 generic_parameter& set_unit(const ossia::unit_t& v) final override;
82
83 void on_first_callback_added() final override;
84 void on_removing_last_callback() final override;
85
86private:
87 friend struct update_parameter_visitor;
88};
89}
Definition generic_parameter.hpp:24
The node_base class.
Definition node.hpp:48
The parameter_base class.
Definition ossia/network/base/parameter.hpp:48
The protocol_base class.
Definition protocol.hpp:40
The value class.
Definition value.hpp:173
val_type
Enum to represent the types that a value can take.
Definition parameter_properties.hpp:16
bounding_mode
Address behaviors at crossing domain boundaries.
Definition parameter_properties.hpp:56
access_mode
Address behaviors at crossing domain boundaries time.
Definition parameter_properties.hpp:46
OSSIA_EXPORT void push_value(const ossia::destination &addr, const ossia::value_with_unit &)
Send a value to a given destination.
Definition ossia/network/base/parameter.cpp:151
domain A domain of values
Definition domain_base.hpp:23
The data that can be found inside a parameter.
Definition parameter_data.hpp:21
Definition dataspace.hpp:24