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
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 )
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
void so_bind_to_dispatcher(event_queue_t &queue) noexcept
Binding agent to the dispatcher.
const lock_factory_t & lock_factory() const
Getter for lock factory.
Alias for namespace with traits of event queue.
disp_params_t()=default
Default constructor.
const queue_traits::queue_params_t & queue_params() const
Getter for queue parameters.
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
so_5::stats::work_thread_activity_stats_t take_activity_stats()
Get the activity stats.
so_5::current_thread_id_t thread_id() const
Get ID of work thread.
Interface for dispatcher binders.
stats::repository_t & stats_repository()
Access to repository of data sources for run-time monitoring.
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.
work_thread_holder_t acquire_work_thread(const work_thread_factory_mixin_t< Params > ¶ms, environment_t &env)
Helper function for acquiring a new worker thread from an appropriate work thread factory.
so_5::stats::prefix_t make_disp_prefix(const std::string_view disp_type, const std::string_view data_sources_name_base, const void *disp_this_pointer)
Create basic prefix for dispatcher data source names.
std::unique_ptr< Disp_Iface_Type > make_actual_dispatcher(outliving_reference_t< environment_t > env, const std::string_view name_base, Disp_Params_Type disp_params, Args &&...args)
Helper function for creation of dispatcher instance with respect to work thread activity tracking fla...
Declarations of messages used by run-time monitoring and statistics.
Predefined suffixes of data-sources.
SO_5_FUNC suffix_t agent_count()
Suffix for data source with count of agents bound to some entity.
SO_5_FUNC suffix_t work_thread_queue_size()
Suffix for data source with count of demands in a working thread event queue.
SO_5_FUNC suffix_t work_thread_activity()
Suffix for data source with work thread activity statistics.
All stuff related to run-time monitoring and statistics.
Private part of message limit implementation.
void send(Target &&to, Args &&... args)
A utility function for creating and delivering a message or a signal.
outliving_reference_t< T > outliving_mutable(T &r)
Make outliving_reference wrapper for mutable reference.
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.
A message with value of some quantity.
Information about one work thread activity.