File tree Expand file tree Collapse file tree
src/plugins/score-plugin-avnd/Crousti Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4040namespace oscr
4141{
4242
43+ // The condition under which a process needs the port-callback storage (a
44+ // model-side Info instance). The storage member and its init guard below must
45+ // both use it — keep them in sync.
46+ template <typename Info>
47+ concept needs_ports_callback_storage = has_dynamic_ports<Info>;
48+
4349template <typename Info>
4450struct MessageBusWrapperToUi
4551{
@@ -94,7 +100,8 @@ class ProcessModel final
94100 oscr::dynamic_ports_storage<Info> dynamic_ports;
95101
96102 [[no_unique_address]]
97- ossia::type_if<Info, oscr::has_dynamic_ports<Info>> object_storage_for_ports_callbacks;
103+ ossia::type_if<Info, oscr::needs_ports_callback_storage<Info>>
104+ object_storage_for_ports_callbacks;
98105
99106 ProcessModel (
100107 const TimeVal& duration, const Id<Process::ProcessModel>& id,
@@ -204,9 +211,7 @@ class ProcessModel final
204211
205212 void init_controller_ports ()
206213 {
207- if constexpr (
208- avnd::dynamic_ports_input_introspection<Info>::size > 0
209- || avnd::dynamic_ports_output_introspection<Info>::size > 0 )
214+ if constexpr (oscr::needs_ports_callback_storage<Info>)
210215 {
211216 avnd::control_input_introspection<Info>::for_all_n2 (
212217 avnd::get_inputs<Info>((Info&)this ->object_storage_for_ports_callbacks ),
You can’t perform that action at this time.
0 commit comments