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

Namespaces

 errors
 
 impl
 

Typedefs

using underlying_counter_t = unsigned int
 Type to be used for limit and counter of inflight messages. More...
 

Functions

template<typename Msg_Type >
mbox_t make_mbox (mbox_t dest_mbox, underlying_counter_t inflight_limit)
 Create an instance of inflight_limit_mbox. More...
 

Typedef Documentation

◆ underlying_counter_t

Type to be used for limit and counter of inflight messages.

Since
v.1.5.2

Definition at line 31 of file inflight_limit.hpp.

Function Documentation

◆ make_mbox()

template<typename Msg_Type >
mbox_t so_5::extra::mboxes::inflight_limit::make_mbox ( mbox_t  dest_mbox,
underlying_counter_t  inflight_limit 
)

Create an instance of inflight_limit_mbox.

Usage example:

so_5::environment_t & env = ...;
// Create an inflight_limit_mbox with underlying MPMC mbox for immutable message.
auto my_mbox = mbox_ns::make_mbox<my_msg>(env.create_mbox(), 15u);
// Create an inflight_limit_mbox with underlying MPSC mbox for mutable message.
class demo_agent : public so_5::agent_t
{
const so_5::mbox_t my_mbox_;
public:
demo_agent(context_t ctx)
: so_5::agent_t{std::move(ctx)}
, my_mbox{ mbox_ns::make_mbox< so_5::mutable_msg<my_msg> >(so_direct_mbox(), 4u) }
{...}
...
};
Template Parameters
Msg_Typetype of message to be used with a new mbox.
Since
v.1.5.2
Parameters
dest_mboxActual destination mbox.
inflight_limitThe limit of inflight messages.

Definition at line 525 of file inflight_limit.hpp.