2
3
6
7
8
9
10
11
15#include <so_5/impl/coop_private_iface.hpp>
17#include <so_5/exception.hpp>
19#include <so_5/agent.hpp>
20#include <so_5/coop_listener.hpp>
21#include <so_5/environment_infrastructure.hpp>
23#include <so_5/stats/repository.hpp>
30#include <condition_variable>
32#if defined( SO_5_MSVC
)
34 #pragma warning(disable: 4251
)
48
49
50
51
52
63 coop_listener_unique_ptr_t coop_listener );
67
68
69
77 disp_binder_shptr_t default_binder );
87
88
89
90
91
92
93
94
95
96
104 bool total_deregistration_completed )
112
113
114
115
116
117
121 coop_shptr_t coop )
noexcept;
125
126
127
128
133
134
135
136
137
145
146
147
148
149
150
151
152
153
154
159
160
161
162
163
164
165
166
172
173
174
175
176
222
223
224
237#if defined( SO_5_MSVC
)
Type of smart handle for a cooperation.
registration_status_t m_registration_status
The registration status of cooperation.
void deregister(int reason) noexcept
Deregister the cooperation with the specified reason.
registration_status_t
Registration status.
@ coop_registered
Cooperation is registered.
A special type that plays role of unique_ptr for coop.
An interface for environment_infrastructure entity.
Special guard to increment and decrement cooperation usage counters.
coop_usage_counter_guard_t(coop_t &coop)
~coop_usage_counter_guard_t()
A special class for accessing private members of agent_coop.
static void decrement_usage_count(coop_t &coop)
static void increment_usage_count(coop_t &coop) noexcept
root_coop_t(coop_id_t id, outliving_reference_t< environment_t > env)
void deregister_children_on_shutdown() noexcept
A basic part for various implementations of coop_repository.
environment_t & environment()
Access to SObjectizer Environment.
status_t m_status
Status of repository.
coop_repository_basis_t(coop_repository_basis_t &&)=delete
std::size_t m_total_coops
Total count of coops.
std::mutex m_lock
Lock for coop repository.
coop_unique_holder_t make_coop(coop_handle_t parent, disp_binder_shptr_t default_binder)
Create an instance of a new coop.
void deregister_all_coop() noexcept
Deregisted all cooperations.
outliving_reference_t< environment_t > m_env
Environment to work in.
coop_repository_basis_t(outliving_reference_t< environment_t > environment, coop_listener_unique_ptr_t coop_listener)
std::atomic_uint_fast64_t m_coop_id_counter
Counter for coop_ids.
final_deregistration_result_t final_deregister_coop(coop_shptr_t coop) noexcept
Do final actions of the cooperation deregistration.
try_switch_to_shutdown_result_t
Result of attempt to switch to shutdown state.
@ already_in_shutdown_state
coop_handle_t do_registration_specific_actions(coop_unique_holder_t coop_ptr)
An actual implementation of registration of a coop.
coop_repository_basis_t(const coop_repository_basis_t &)=delete
std::size_t m_registrations_in_progress
Count of coops those are in registration now.
environment_infrastructure_t::coop_repository_stats_t query_stats()
Get the current statistic for run-time monitoring.
status_t
Enumeration of possible repository statuses.
try_switch_to_shutdown_result_t try_switch_to_shutdown() noexcept
Try to switch repository to shutdown state.
std::shared_ptr< root_coop_t > m_root_coop
A special root coop.
coop_handle_t register_coop(coop_unique_holder_t agent_coop)
Register cooperation.
std::condition_variable m_shutdown_enabled_cond
std::size_t m_total_agents
Total count of agents.
coop_listener_unique_ptr_t m_coop_listener
Cooperation actions listener.
Helper class for indication of long-lived reference via its type.
#define SO_5_THROW_EXCEPTION(error_code, desc)
Enumeration of cooperation deregistration reasons.
const int shutdown
Deregistration because SObjectizer Environment shutdown.
Some reusable and low-level classes/functions which can be used in public header files.
Details of SObjectizer run-time implementations.
Private part of message limit implementation.
Statistical data for run-time monitoring of coop repository content.
final_deregistration_result_t(bool has_live_coop, bool total_deregistration_completed)
bool m_total_deregistration_completed