2
3
6
7
8
12#include <so_5/declspec.hpp>
14#include <so_5/disp_binder.hpp>
15#include <so_5/nonempty_name.hpp>
17#include <so_5/disp/one_thread/params.hpp>
42
43
44
45
46
60 empty()
const noexcept {
return !m_binder; }
82 reset()
noexcept { m_binder.reset(); }
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
116 const std::string_view data_sources_name_base,
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
143 const std::string_view data_sources_name_base )
145 return make_dispatcher( env, data_sources_name_base, disp_params_t{} );
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
167 return make_dispatcher( env, std::string_view{}, disp_params_t{} );
Alias for namespace with traits of event queue.
A handle for one_thread dispatcher.
operator bool() const noexcept
Is this handle empty?
bool operator!() const noexcept
Does this handle contain a reference to dispatcher?
disp_binder_shptr_t m_binder
Binder for the dispatcher.
disp_binder_shptr_t binder() const noexcept
Get a binder for that dispatcher.
void reset() noexcept
Drop the content of handle.
dispatcher_handle_t(disp_binder_shptr_t binder) noexcept
dispatcher_handle_t() noexcept=default
bool empty() const noexcept
Is this handle empty?
void preallocate_resources(agent_t &) override
Allocate resources in dispatcher for new agent.
virtual void bind(agent_t &agent) noexcept override
Bind agent to dispatcher.
virtual void unbind(agent_t &) noexcept override
Unbind agent from dispatcher.
Work_Thread m_work_thread
Working thread for the dispatcher.
void undo_preallocation(agent_t &) noexcept override
Undo resources allocation.
stats::auto_registered_source_holder_t< data_source_t< Work_Thread > > m_data_source
Data source for run-time monitoring.
~actual_dispatcher_t() noexcept override
std::atomic< std::size_t > m_agents_bound
Count of agents bound to this dispatcher.
actual_dispatcher_t(outliving_reference_t< environment_t > env, const std::string_view name_base, disp_params_t params)
data_source_t(actual_work_thread_type_t &work_thread, std::atomic< std::size_t > &agents_bound, const std::string_view name_base, const void *pointer_to_disp)
void distribute(const mbox_t &mbox) override
Send appropriate notification about the current value.
static dispatcher_handle_t make(disp_binder_shptr_t binder) noexcept
Interface for dispatcher binders.
Helper class for indication of long-lived reference via its type.
A holder for data-souce that should be automatically registered and deregistered in registry.
A type for storing prefix of data_source name.
An interface of data source.
void track_activity(const mbox_t &, const common_data_t< work_thread::work_thread_no_activity_tracking_t > &)
void track_activity(const mbox_t &mbox, const common_data_t< work_thread::work_thread_with_activity_tracking_t > &data)
Implementation details for dispatcher with single working thread.
Dispatcher with single working thread.
SO_5_FUNC dispatcher_handle_t make_dispatcher(environment_t &env, const std::string_view data_sources_name_base, disp_params_t params)
Create an instance of one_thread dispatcher.
dispatcher_handle_t make_dispatcher(environment_t &env)
Create an instance of one_thread dispatcher.
dispatcher_handle_t make_dispatcher(environment_t &env, const std::string_view data_sources_name_base)
Create an instance of one_thread dispatcher.
Implemetation details of dispatcher's working thread.
Reusable components for dispatchers.
All stuff related to run-time monitoring and statistics.
Private part of message limit implementation.
stats::prefix_t m_work_thread_prefix
Prefix for working thread-related data.
Work_Thread & m_work_thread
Working thread of the dispatcher.
common_data_t(Work_Thread &work_thread, std::atomic< std::size_t > &agents_bound)
stats::prefix_t m_base_prefix
Prefix for dispatcher-related data.
std::atomic< std::size_t > & m_agents_bound
Count of agents bound to the dispatcher.