2
3
6
7
8
14#include <so_5/declspec.hpp>
16#include <so_5/disp_binder.hpp>
18#include <so_5/disp/mpsc_queue_traits/pub.hpp>
20#include <so_5/disp/reuse/work_thread_activity_tracking.hpp>
21#include <so_5/disp/reuse/work_thread_factory_params.hpp>
33
34
35
36
37
44
45
46
47
48
66 static_cast< activity_tracking_mixin_t & >(a),
67 static_cast< activity_tracking_mixin_t & >(b) );
73 swap( a.m_queue_params, b.m_queue_params );
80 m_queue_params = std::move(p);
86
87
88
89
90
91
92
93
94
95
96
97 template<
typename L >
109 return m_queue_params;
129
130
131
132
133
147 empty()
const noexcept {
return !m_binder; }
169 reset()
noexcept { m_binder.reset(); }
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
200 const std::string_view data_sources_name_base,
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
228 const std::string_view data_sources_name_base )
230 return make_dispatcher( env, data_sources_name_base, disp_params_t{} );
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
254 return make_dispatcher( env, std::string_view{} );
Alias for namespace with traits of event queue.
disp_params_t & tune_queue_params(L tunner)
Tuner for queue parameters.
disp_params_t & set_queue_params(queue_traits::queue_params_t p)
Setter for queue parameters.
queue_traits::queue_params_t m_queue_params
Queue parameters.
const queue_traits::queue_params_t & queue_params() const
Getter for queue parameters.
disp_params_t()=default
Default constructor.
friend void swap(disp_params_t &a, disp_params_t &b) noexcept
A handle for active_obj dispatcher.
bool empty() const noexcept
Is this handle empty?
disp_binder_shptr_t m_binder
Binder for the dispatcher.
bool operator!() const noexcept
Does this handle contain a reference to dispatcher?
dispatcher_handle_t(disp_binder_shptr_t binder) noexcept
disp_binder_shptr_t binder() const noexcept
Get a binder for that dispatcher.
dispatcher_handle_t() noexcept=default
operator bool() const noexcept
Is this handle empty?
void reset() noexcept
Drop the content of handle.
static dispatcher_handle_t make(disp_binder_shptr_t binder) noexcept
void distribute(const mbox_t &mbox) override
Send appropriate notification about the current value.
disp_data_source_t(const std::string_view name_base, outliving_reference_t< dispatcher_template_t > disp)
stats::prefix_t m_base_prefix
Basic prefix for data source names.
void distribute_value_for_work_thread(const mbox_t &mbox, const agent_t *agent, Work_Thread &wt)
outliving_reference_t< dispatcher_template_t > m_dispatcher
Dispatcher to work with.
void undo_preallocation(agent_t &agent) noexcept override
Undo resources allocation.
outliving_reference_t< environment_t > m_env
SObjectizer Environment to work in.
const disp_params_t m_params
Parameters for the dispatcher.
stats::auto_registered_source_holder_t< disp_data_source_t > m_data_source
Data source for run-time monitoring.
dispatcher_template_t(outliving_reference_t< environment_t > env, const std::string_view name_base, disp_params_t params)
~dispatcher_template_t() noexcept override
void unbind(agent_t &agent) noexcept override
Unbind agent from dispatcher.
agent_thread_map_t m_agent_threads
A map from agents to single thread dispatchers.
std::mutex m_lock
This object lock.
void preallocate_resources(agent_t &agent) override
Allocate resources in dispatcher for new agent.
void bind(agent_t &agent) noexcept override
Bind agent to dispatcher.
Container for storing parameters for MPSC queue.
Mixin with thread activity tracking flag.
Mixin that holds optional work thread factory.
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.
#define SO_5_THROW_EXCEPTION(error_code, desc)
void shutdown_and_wait(T &w)
Just a helper function for consequetive call to shutdown and wait.
void send_thread_activity_stats(const so_5::mbox_t &, const stats::prefix_t &, work_thread::work_thread_no_activity_tracking_t &)
void send_thread_activity_stats(const so_5::mbox_t &mbox, const stats::prefix_t &prefix, work_thread::work_thread_with_activity_tracking_t &wt)
void send_demands_count_stats(const so_5::mbox_t &mbox, const stats::prefix_t &prefix, Work_Thread &wt)
Active objects dispatcher implemetation details.
Active objects dispatcher.
dispatcher_handle_t make_dispatcher(environment_t &env, const std::string_view data_sources_name_base)
Create an instance of active_obj dispatcher.
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 active_obj dispatcher.
dispatcher_handle_t make_dispatcher(environment_t &env)
Create a private active_obj dispatcher.
Various stuff related to MPSC event queue implementation and tuning.
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.