A message wrapped to be used as type of argument for event handlers.
More...
#include <mhood.hpp>
template<typename M>
class so_5::mhood_t< M >
A message wrapped to be used as type of argument for event handlers.
- Since
- v.5.5.14
- Template Parameters
-
| M | type of message or signal. |
- Note
- This class provides different sets of methods in dependency of type M. If M is a type derived from so_5::message_t, then there will be the following methods for immutable message M:
const M * operator->() const;
const M & operator*() const;
Template class for smart reference wrapper on the atomic_refcounted_t.
A class for holding an instance of a message.
auto get(const mchain_receive_result_t &result)
part of tuple protocol for mchain_receive_result_t.
If M is a type derived from so_5::signal_t, then there will no be methods at all. It is because there is no actual message object for a signal. If M is user-type message then there will be the following methods for immutable message M:
const M * operator->() const;
const M & operator*() const;
For mutable message M there will be the following methods is M is derived from so_5::message_t:
M * operator->();
M & operator*();
If mutable message M is not derived from so_5::message_t then there will be the following methods:
M * operator->();
M & operator*();
-
Method make_holder() uses so_5::message_ownership_t::autodetected by default.
- Attention
- Methods make_reference() for mhood_t<mutable_msg<M>> will leave mhood object in nullptr state. It means that mhood must not be used after calling make_reference().
-
Methods make_holder() for mhood_t<mutable_msg<M>> will leave the mhood object empty always. Regardless of Ownership parameter. Methods make_holder() for mhood_t<M> and mhood_t<immutable_msg<M>> will leave value for mhood object regardless of Ownership parameter. For example:
auto v = cmd->some_value();
...
}
...
auto v = cmd->some_value();
}
};
A message wrapped to be used as type of argument for event handlers.
A special marker for mutable message.
- Note
- Class mhood_t can be used for redirection of messages of user types. For example (since v.5.5.19):
{
...
}
};
void send(Target &&to, Args &&... args)
A utility function for creating and delivering a message or a signal.
If mhood_t<mutable_msg<M>> is used then a redirection must be done this way:
- Examples
- so_5/delivery_filters/main.cpp, so_5/make_pipeline/main.cpp, so_5/mchain_handler_formats/main.cpp, so_5/news_board/main.cpp, so_5/prio_work_stealing/main.cpp, so_5/queue_size_stats/main.cpp, and so_5/wrapped_env_demo_3/main.cpp.
Definition at line 568 of file mhood.hpp.
◆ base_type_t
template<typename M >
| using so_5::mhood_t< M >::base_type_t = details::actual_mhood_base_type<M> |
|
private |
◆ mhood_t()
The documentation for this class was generated from the following file: