@@ -127,28 +127,26 @@ template <typename... Fields>
127127using index_spec = decltype (stdx::make_indexed_tuple<get_field_type>(
128128 temp_index<Fields, 512 , 256 >{}...));
129129
130- template <template <typename , typename , typename , typename ...> typename ParentT ,
131- typename IndexSpec, typename CallbacksT , typename BaseMsgT ,
132- typename ... ExtraCallbackArgsT >
130+ template <template <typename , typename , typename , typename ...> typename Parent ,
131+ typename IndexSpec, typename Callbacks , typename MsgBase ,
132+ typename ... ExtraCallbackArgs >
133133struct indexed_builder_base {
134- CallbacksT callbacks;
134+ Callbacks callbacks;
135135
136136 template <typename ... Ts> [[nodiscard]] constexpr auto add (Ts... ts) {
137137 auto new_callbacks =
138138 stdx::tuple_cat (callbacks, separate_sum_terms (ts)...);
139139 using new_callbacks_t = decltype (new_callbacks);
140- return ParentT <IndexSpec, new_callbacks_t , BaseMsgT ,
141- ExtraCallbackArgsT ...>{new_callbacks};
140+ return Parent <IndexSpec, new_callbacks_t , MsgBase ,
141+ ExtraCallbackArgs ...>{new_callbacks};
142142 }
143143
144- using callback_func_t = auto (*)(BaseMsgT const &,
145- ExtraCallbackArgsT ... args) -> bool ;
144+ using callback_func_t = auto (*)(MsgBase const &,
145+ ExtraCallbackArgs ... args) -> bool ;
146146
147147 template <typename BuilderValue, std::size_t I>
148- constexpr static auto invoke_callback (BaseMsgT const &data,
149- ExtraCallbackArgsT... args) -> bool {
150- // FIXME: incomplete message callback invocation...
151- // 1) bit_cast message argument
148+ constexpr static auto invoke_callback (MsgBase const &data,
149+ ExtraCallbackArgs... args) -> bool {
152150 constexpr auto cb = IndexSpec{}.apply ([&]<typename ... Indices>(
153151 Indices...) {
154152 constexpr auto orig_cb =
@@ -164,15 +162,14 @@ struct indexed_builder_base {
164162 " Indexed callback has matcher that is never matched!" );
165163 }
166164
167- auto view = typename CB::msg_t ::view_t {data};
168-
169- if (cb.matcher (view)) {
165+ using msg_t = typename CB::msg_t ;
166+ if (msg::call_with_message<msg_t >(cb.matcher , data)) {
170167 CIB_INFO (
171168 " Incoming message matched [{}], because [{}] (collapsed to "
172169 " [{}]), executing callback" ,
173170 stdx::ct_string_to_type<cb.name , sc::string_constant>(),
174171 orig_cb.matcher .describe (), cb.matcher .describe ());
175- cb.callable (view , args...);
172+ msg::call_with_message< msg_t >( cb.callable , data , args...);
176173 return true ;
177174 }
178175 return false ;
0 commit comments