13#include "sygac-tuple.hpp"
14#include "sygac-components.hpp"
15#include "sygac-endpoints.hpp"
16#include "sygbp-spelling.hpp"
18namespace sygaldry {
namespace sygbp {
24template<
typename>
struct osc_path_length : std::integral_constant<std::size_t, 0> {};
25template<
template<
typename...>
typename L,
typename ... Path>
27: std::integral_constant<std::size_t, (name_length<std::decay_t<Path>>() + ...) + sizeof...(Path)> {};
29constexpr std::size_t osc_type_string_length()
33 constexpr auto length = size<value_t<T>>() + 1;
34 constexpr auto remainder = length % 4;
35 constexpr auto padding = 4 - remainder;
36 return length + padding;
42template<
template<
typename...>
typename L,
typename ... Path>
46 static constexpr std::array<char, N> value = []()
48 L<std::decay_t<Path>...> path;
49 std::array<char, N> ret;
50 std::size_t write_pos = 0;
51 auto copy_one = [&]<
typename T>(T)
53 ret[write_pos++] =
'/';
54 for (std::size_t i = 0; i < name_length<T>(); ++i)
56 ret[write_pos++] = snake_case_v<T>[i];
59 tpl::apply([&]<
typename ... Ts>(Ts... ts)
68template<
typename T,
typename Components>
74 static constexpr size_t N = osc_type_string_length<T>();
75 static constexpr std::array<char, N> value = []()
77 std::array<char, N> ret{0};
80 if constexpr (
Bang<T>)
return ret;
83 if constexpr (std::integral<element_t<T>>)
tag =
'i';
84 else if constexpr (std::floating_point<element_t<T>>)
tag =
'f';
89 for (std::size_t i = 0; i < size<value_t<T>>(); ++i)
Definition sygac-endpoints.hpp:92
Definition sygac-endpoints.hpp:166
Definition sygac-endpoints.hpp:161
#define tag(TAG)
Helper struct for defining recognized tags. This is immediately undefed, so don't try to use it!
Definition sygah-endpoints.hpp:238
Definition sygbp-osc_string_constants.hpp:24
Definition sygbp-osc_string_constants.hpp:41
Definition sygbp-osc_string_constants.hpp:73