11template <
typename Domain>
18 const auto& values = domain.values;
19 if(b == bounding_mode::FREE || values.empty())
21 return std::forward<U>(val);
25 auto it = ossia::find(values, val);
31struct value_set_get_visitor
34 std::vector<ossia::value> operator()(
const ossia::domain_base<T>& dom)
36 return std::vector<ossia::value>(dom.values.begin(), dom.values.end());
39 std::vector<ossia::value> operator()(
const ossia::domain_base<bool>&)
44 std::vector<ossia::value> operator()(
const ossia::domain_base<ossia::impulse>& dom)
46 return std::vector<ossia::value>{};
49 std::vector<ossia::value> operator()(
const ossia::vector_domain& dom)
51 std::vector<ossia::value> v(dom.values.size());
52 for(std::size_t i = 0; i < dom.values.size(); i++)
54 v[i] = std::vector<ossia::value>(dom.values[i].begin(), dom.values[i].end());
59 template <std::
size_t N>
60 std::vector<ossia::value> operator()(
const ossia::vecf_domain<N>& dom)
62 std::vector<ossia::value> v(N);
63#if !defined(OSSIA_FREESTANDING)
64 for(std::size_t i = 0; i < N; i++)
66 v[i] = std::vector<ossia::value>(dom.values[i].begin(), dom.values[i].end());
73struct value_set_update_visitor
75 const std::vector<ossia::value>& values;
77 void operator()(ossia::domain_base<T>& dom)
80 dom.values.reserve(values.size());
81 for(
auto& value : values)
83 if(
auto r = value.target<T>())
84 dom.values.push_back(*r);
88 void operator()(ossia::vector_domain& dom)
90 for(
auto& set : dom.values)
93 for(
auto& value : values)
95 dom.values[0].insert(value);
100 void operator()(ossia::domain_base<ossia::value>& dom)
102#if !defined(OSSIA_FREESTANDING)
104 for(
auto& value : values)
106 dom.values.push_back(value);
111 template <std::
size_t N>
112 void operator()(ossia::vecf_domain<N>& dom)
114#if !defined(OSSIA_FREESTANDING)
115 for(std::size_t i = 0; i < N; i++)
116 dom.values[i].clear();
118 for(
auto& value : values)
120 if(
auto r = value.target<
float>())
122 for(std::size_t i = 0; i < N; i++)
124 dom.values[i].insert(*r);
131 void operator()(ossia::domain_base<impulse>&) { }
133 void operator()(ossia::domain_base<bool>&) { }
The value class.
Definition value.hpp:173
bounding_mode
Address behaviors at crossing domain boundaries.
Definition parameter_properties.hpp:56