10 #include <so_5_extra/error_ranges.hpp> 12 #include <so_5/impl/msg_tracing_helpers.hpp> 14 #include <so_5/environment.hpp> 15 #include <so_5/mbox.hpp> 93 errors::rc_null_as_default_destination_mbox,
94 "nullptr can't be used as the default destination mbox" );
108 dest()
const noexcept {
return m_dest; }
168 return { redirect_to_if_not_found_case_t{ dest_mbox } };
194 return { throw_if_not_found_case_t{} };
219 return { drop_if_not_found_case_t{} };
262 [](
const target_t & target,
const std::type_index & msg_type ) ->
bool {
263 return target.m_msg_type < msg_type;
282 const std::type_index & msg_type,
283 abstract_message_sink_t & subscriber )
291 c.dest()->subscribe_event_handler(
299 SO_5_THROW_EXCEPTION(
300 errors::rc_no_sink_for_message_type,
301 "no destination for this message type, " 302 "msg_type=" + std::string(m_msg_type.name()) );
325 const std::type_index & msg_type,
326 abstract_message_sink_t & subscriber )
334 c.dest()->unsubscribe_event_handler(
358 template<
typename Tracer >
370 message_delivery_mode_t delivery_mode,
371 const std::type_index & msg_type,
372 const message_ref_t & msg,
373 unsigned int overlimit_deep )
387 "redirect_to_default_destination",
401 "no_destination.throw_exception" );
404 "no destination for this message type, " 412 "no_destination.drop_message" );
430 const std::type_index & msg_type,
431 const delivery_filter_t & filter,
432 abstract_message_sink_t & subscriber )
441 c.dest()->set_delivery_filter(
450 SO_5_THROW_EXCEPTION(
451 errors::rc_no_sink_for_message_type,
452 "no destination for this message type, " 453 "msg_type=" + std::string(m_msg_type.name()) );
476 const std::type_index & msg_type,
477 abstract_message_sink_t & subscriber )
noexcept 485 c.dest()->drop_delivery_filter(
530 mbox_type_t mbox_type,
531 type_not_found_reaction_t unknown_type_reaction,
532 target_container_t targets )
550 template<
typename Tracing_Base >
553 ,
private Tracing_Base
563 template<
typename... Tracing_Args >
567 Tracing_Args &&... tracing_args )
583 const std::type_index & msg_type,
584 abstract_message_sink_t & subscriber )
override 605 const std::type_index & msg_type,
606 abstract_message_sink_t & subscriber )
noexcept override 629 s <<
"<mbox:type=COMPOSITE";
655 message_delivery_mode_t delivery_mode,
656 const std::type_index & msg_type,
657 const message_ref_t & message,
658 unsigned int redirection_deep )
override 675 "redirect_to_destination",
702 const std::type_index & msg_type,
703 const delivery_filter_t & filter,
704 abstract_message_sink_t & subscriber )
override 727 const std::type_index & msg_type,
728 abstract_message_sink_t & subscriber )
noexcept override 790 const std::type_index & msg_type,
791 const message_ref_t & what )
const 799 "an attempt to deliver mutable message via MPMC mbox" 874 mbox_type_t mbox_type,
875 type_not_found_reaction_t unknown_type_reaction );
880 mbox_type_t mbox_type,
882 type_not_found_reaction_t unknown_type_reaction )
942 template<
typename Msg_Type >
954 "mutable message can't handled with MPMC composite, " 967 "MPMC mbox can't be added as a target to MPSC " 968 "composite and mutable message, " 979 "message type already has a destination mbox, " 1035 template<
typename Msg_Type >
1070 return env.make_custom_mbox(
1071 [
this](
const mbox_creation_data_t & data )
1073 impl::mbox_data_t mbox_data{
1077 std::move(m_unknown_type_reaction),
1082 if( data.m_tracer.get().is_msg_tracing_enabled() )
1084 using ::so_5::impl::msg_tracing_helpers::
1085 tracing_enabled_base;
1086 using T = impl::actual_mbox_t< tracing_enabled_base >;
1088 result = mbox_t{
new T{
1089 std::move(mbox_data),
1095 using ::so_5::impl::msg_tracing_helpers::
1096 tracing_disabled_base;
1097 using T = impl::actual_mbox_t< tracing_disabled_base >;
1099 result = mbox_t{
new T{ std::move(mbox_data) } };
1133 impl::target_container_t result;
1134 result.reserve( m_targets.size() );
1137 for(
const auto & [k, v] : m_targets )
1138 result.emplace_back( k, v );
1166 mbox_type_t mbox_type,
1168 type_not_found_reaction_t unknown_type_reaction )
1170 return { mbox_type, std::move(unknown_type_reaction) };
1195 type_not_found_reaction_t unknown_type_reaction )
1198 mbox_type_t::multi_producer_multi_consumer,
1199 std::move(unknown_type_reaction) );
1223 type_not_found_reaction_t unknown_type_reaction )
1226 mbox_type_t::multi_producer_single_consumer,
1227 std::move(unknown_type_reaction) );
const delivery_filter_t & m_filter
Function object to be used with std::visit.
Function object to be used with std::visit.
void operator()(const throw_if_not_found_case_t &) const
void operator()(const drop_if_not_found_case_t &) const
set_delivery_filter_t(const std::type_index &msg_type, const delivery_filter_t &filter, abstract_message_sink_t &subscriber)
abstract_message_sink_t & m_subscriber
void operator()(const drop_if_not_found_case_t &) const
abstract_message_sink_t & m_subscriber
unsigned int m_overlimit_deep
void operator()(const throw_if_not_found_case_t &) const
const std::type_index & m_msg_type
const std::type_index & m_msg_type
Ranges for error codes of each submodules.
void operator()(const throw_if_not_found_case_t &) const
abstract_message_sink_t & m_subscriber
Function object to be used with std::visit.
void operator()(const redirect_to_if_not_found_case_t &c) const
void operator()(const redirect_to_if_not_found_case_t &c) const noexcept
Function object to be used with std::visit.
void operator()(const redirect_to_if_not_found_case_t &c) const
subscribe_event_t(const std::type_index &msg_type, abstract_message_sink_t &subscriber)
void operator()(const drop_if_not_found_case_t &) const
const std::type_index & m_msg_type
void operator()(const throw_if_not_found_case_t &) const
drop_delivery_filter_t(const std::type_index &msg_type, abstract_message_sink_t &subscriber) noexcept
const message_delivery_mode_t m_delivery_mode
const std::type_index & m_msg_type
void operator()(const redirect_to_if_not_found_case_t &c) const noexcept
void operator()(const drop_if_not_found_case_t &) const
abstract_message_sink_t & m_subscriber
Function object to be used with std::visit.
void operator()(const throw_if_not_found_case_t &) const noexcept
void operator()(const redirect_to_if_not_found_case_t &c) const
unsubscribe_event_t(const std::type_index &msg_type, abstract_message_sink_t &subscriber)
deliver_message_t(Tracer &tracer, message_delivery_mode_t delivery_mode, const std::type_index &msg_type, const message_ref_t &msg, unsigned int overlimit_deep)
void operator()(const drop_if_not_found_case_t &) const noexcept
const std::type_index & m_msg_type
const message_ref_t & m_msg