2
3
6
7
8
9
10
11
15#include <so_5/declspec.hpp>
17#include <so_5/disp_binder.hpp>
19#include <so_5/priority.hpp>
21#include <so_5/disp/mpsc_queue_traits/pub.hpp>
23#include <so_5/disp/reuse/work_thread_activity_tracking.hpp>
24#include <so_5/disp/reuse/work_thread_factory_params.hpp>
37
38
39
40
47
48
49
50
68 static_cast< activity_tracking_mixin_t & >(a),
69 static_cast< activity_tracking_mixin_t & >(b) );
75 swap( a.m_queue_params, b.m_queue_params );
82 m_queue_params = std::move(p);
88
89
90
91
92
93
94
95
96
97
98
99
100 template<
typename L >
112 return m_queue_params;
132
133
134
135
149 empty()
const noexcept {
return !m_binder; }
171 reset()
noexcept { m_binder.reset(); }
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
203 const std::string_view data_sources_name_base,
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
232 const std::string_view data_sources_name_base )
234 return make_dispatcher( env, data_sources_name_base, disp_params_t{} );
241
242
243
244
245
246
247
248
249
250
251
252
253
254
258 return make_dispatcher( env, std::string_view{} );
Container for storing parameters for MPSC queue.
Alias for namespace with traits of event queue.
const queue_traits::queue_params_t & queue_params() const noexcept
Getter for queue parameters.
disp_params_t()=default
Default constructor.
queue_traits::queue_params_t m_queue_params
Queue parameters.
friend void swap(disp_params_t &a, disp_params_t &b) noexcept
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.
A handle for prio_one_thread::strictly_ordered dispatcher.
void reset() noexcept
Drop the content of handle.
disp_binder_shptr_t binder() const noexcept
Get a binder for that dispatcher.
operator bool() const noexcept
Is this handle empty?
bool operator!() const noexcept
Does this handle contain a reference to dispatcher?
dispatcher_handle_t() noexcept=default
dispatcher_handle_t(disp_binder_shptr_t binder) noexcept
bool empty() const noexcept
Is this handle empty?
disp_binder_shptr_t m_binder
Binder for the dispatcher.
A demand queue with support of demands priorities.
static dispatcher_handle_t make(disp_binder_shptr_t binder) noexcept
Data source for run-time monitoring of whole dispatcher.
void distribute_value_for_priority(const mbox_t &mbox, priority_t priority, std::size_t agents_count, std::size_t demands_count)
outliving_reference_t< dispatcher_template_t > m_dispatcher
Dispatcher to work with.
void distribute(const mbox_t &mbox) override
Send appropriate notification about the current value.
stats::prefix_t m_base_prefix
Basic prefix for data sources.
disp_data_source_t(const std::string_view name_base, outliving_reference_t< dispatcher_template_t > disp)
void unbind(agent_t &agent) noexcept override
Unbind agent from dispatcher.
demand_queue_t m_demand_queue
Demand queue for the dispatcher.
void bind(agent_t &agent) noexcept override
Bind agent to dispatcher.
dispatcher_template_t(outliving_reference_t< environment_t > env, const std::string_view name_base, disp_params_t params)
void undo_preallocation(agent_t &) noexcept override
Undo resources allocation.
void preallocate_resources(agent_t &) override
Allocate resources in dispatcher for new agent.
Work_Thread m_work_thread
Working thread 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() noexcept override
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.
Various stuff related to MPSC event queue implementation and tuning.
void send_thread_activity_stats(const so_5::mbox_t &, const stats::prefix_t &, so_5::disp::prio_one_thread::reuse::work_thread_no_activity_tracking_t< demand_queue_t > &)
Reusable code for dispatchers with one working thread for events of all priorities.
Implementation details for dispatcher which handles prioritized events in strict order.
Dispatcher which handles events in strict order (from highest priority to lowest).
dispatcher_handle_t make_dispatcher(environment_t &env, const std::string_view data_sources_name_base)
Create an instance of strictly_ordered 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 strictly_ordered dispatcher.
dispatcher_handle_t make_dispatcher(environment_t &env)
Create an instance of strictly_ordered dispatcher.
Dispatcher with one working thread for events of all priorities.
Reusable components for dispatchers.
All stuff related to run-time monitoring and statistics.
Private part of message limit implementation.
priority_t
Definition of supported priorities.