SObjectizer-5 Extra
Namespaces | Functions
so_5::extra::mboxes::unique_subscribers Namespace Reference

Namespaces

 details
 
 errors
 

Functions

template<typename Lock_Type = std::mutex>
mbox_t make_mbox (so_5::environment_t &env)
 Factory function for creation of a new instance of unique_subscribers mbox. More...
 

Function Documentation

◆ make_mbox()

template<typename Lock_Type = std::mutex>
mbox_t so_5::extra::mboxes::unique_subscribers::make_mbox ( so_5::environment_t &  env)

Factory function for creation of a new instance of unique_subscribers mbox.

Usage examples:

Create a mbox with std::mutex as Lock_Type (this mbox can safely be used in multi-threaded environments):

so_5::environment_t & env = ...;

Create a mbox with so_5::null_mutex_t as Lock_Type (this mbox can only be used in single-threaded environments):

so_5::environment_t & env = ...;
auto mbox = so_5::extra::mboxes::unique_subscribers::make_mbox<so_5::null_mutex_t>(env);
Template Parameters
Lock_Typetype of lock to be used for thread safety. It can be std::mutex or so_5::null_mutex_t (or any other type which can be used with std::lock_quard).
Since
v.1.5.0
Examples:
mboxes/unique_subscribers/simple/main.cpp.

Definition at line 475 of file unique_subscribers.hpp.