2#include <ossia/network/osc/detail/osc_common_policy.hpp>
3#include <ossia/network/osc/detail/osc_utils.hpp>
4#include <ossia/network/value/value.hpp>
6#include <boost/endian/conversion.hpp>
8#include <oscpack/osc/OscOutboundPacketStream.h>
9#include <oscpack/osc/OscTypes.h>
15struct osc_1_0_outbound_dynamic_policy : osc_common_outbound_dynamic_policy
17 using osc_common_outbound_dynamic_policy::operator();
21 void operator()(impulse)
const { p << int32_t(0); }
23 void operator()(
bool b)
const { p << int32_t(b); }
25 void operator()(
char c)
const { p << int32_t(c); }
28 void operator()(
const std::vector<value>& t)
const
30 for(
const auto& val : t)
36 void operator()(
const value_map_type& t)
const { }
39struct osc_1_0_outbound_stream_visitor : osc_1_0_outbound_dynamic_policy
41 using osc_1_0_outbound_dynamic_policy::operator();
42 void operator()(impulse)
const { }
44 void operator()(
const std::vector<value>& t)
const
49 static_cast<const osc_1_0_outbound_dynamic_policy&
>(*this)(t);
53struct osc_1_0_outbound_static_policy : osc_common_outbound_static_policy
55 using osc_common_outbound_static_policy::operator();
56 std::size_t operator()(
char* buffer, ossia::impulse v,
const auto&...) const noexcept
66 std::size_t operator()(
char* buffer,
bool v)
const noexcept
68 return osc_common_outbound_static_policy::operator()(buffer, int32_t{v});
71 std::size_t operator()(
char* buffer,
char v)
const noexcept
73 return osc_common_outbound_static_policy::operator()(buffer, int32_t{v});
79 using static_policy = osc_1_0_outbound_static_policy;
80 using dynamic_policy = osc_1_0_outbound_dynamic_policy;