OSSIA
Open Scenario System for Interactive Application
Loading...
Searching...
No Matches
to_state_element.hpp
1#pragma once
2#include <ossia/dataflow/typed_value.hpp>
4
5namespace ossia
6{
7
9to_state_element(ossia::net::parameter_base& p, ossia::typed_value&& v)
10{
11 ossia::message m{p, std::move(v.value)};
12 if(auto u = v.type.target<ossia::unit_t>())
13 m.dest.unit = std::move(*u);
14 m.dest.index = std::move(v.index);
15 return m;
16}
17
18inline ossia::message
19to_state_element(ossia::net::parameter_base& p, const ossia::typed_value& v)
20{
21 ossia::message m{p, v.value};
22 if(auto u = v.type.target<ossia::unit_t>())
23 m.dest.unit = std::move(*u);
24 m.dest.index = std::move(v.index);
25 return m;
26}
27
28}
The parameter_base class.
Definition ossia/network/base/parameter.hpp:48
virtual ossia::value value() const =0
Clone the current value without any network request.
Definition git_info.h:7
The message struct.
Definition message.hpp:29
Definition dataspace.hpp:24