11 #include <so_5_extra/async_op/details.hpp> 12 #include <so_5_extra/async_op/errors.hpp> 14 #include <so_5/details/invoke_noexcept_code.hpp> 16 #include <so_5/agent.hpp> 18 #include <so_5/outliving.hpp> 49 template<
typename Operation_Data >
52 template<
typename Operation_Data >
86 template<
typename Operation_Data >
88 template<
typename Operation_Data >
119 const so_5::state_t & state,
120 std::type_index subscription_type,
121 so_5::event_handler_method_t handler )
145 ::so_5::outliving_reference_t<::so_5::agent_t> owner )
156 m_subscriptions.reserve( capacity );
180 typename Operation_Data,
182 typename Event_Handler >
186 ::so_5::intrusive_ptr_t< Operation_Data > actual_data,
188 Msg_Target && msg_target,
190 const ::so_5::state_t & state,
192 Event_Handler && evt_handler )
234 if( !m_subscriptions.empty() )
240 SO_5_THROW_EXCEPTION(
241 ::so_5::extra::async_op::errors::rc_no_completion_handler,
242 "Operation can't be activated without any completion " 274 m_subscriptions.clear();
289 return !m_subscriptions.empty();
297 if( status_t::activated == m_status )
298 SO_5_THROW_EXCEPTION(
299 ::so_5::extra::async_op::errors::rc_async_op_activated,
300 "Operation can't be performed when async_op is already " 329 std::size_t current_index = 0;
332 for(; current_index != m_subscriptions.size(); ++current_index )
334 auto & sd = m_subscriptions[ current_index ];
335 m_owner.get().so_create_event_subscription(
337 sd.m_subscription_type,
340 ::so_5::thread_safety_t::unsafe,
341 ::so_5::event_handler_kind_t::final_handler );
347 destroy_subscriptions_up_to( current_index );
357 destroy_subscriptions_up_to( m_subscriptions.size() );
358 m_subscriptions.clear();
366 const std::size_t n )
noexcept 368 for( std::size_t i = 0; i != n; ++i )
370 const auto & sd = m_subscriptions[ i ];
371 m_owner.get().so_destroy_event_subscription(
373 sd.m_subscription_type,
450 details::op_shptr_t< Operation_Data > op )
680 "an attempt to use empty definition_point object" );
687 ::so_5::outliving_reference_t< ::so_5::agent_t > owner )
728 std::size_t capacity ) &
738 template<
typename... Args >
742 return std::move(
this->reserve_completion_handlers_capacity(
743 std::forward<Args>(args)... ));
799 typename Event_Handler >
805 Msg_Target && msg_target,
807 const ::so_5::state_t & state,
809 Event_Handler && evt_handler ) &
823 template<
typename... Args >
873 template<
typename Activation_Action >
879 Activation_Action && action ) &
884 "definition_point_t doesn't hold operation data anymore." );
934 template<
typename... Args >
938 return this->activate( std::forward<Args>(args)... );
975 ::so_5::agent_t & owner )
977 return { ::so_5::outliving_mutable(owner) };
Ranges for error codes of each submodules.