A base class for agent messages.
More...
#include <message.hpp>
A base class for agent messages.
All messages for agents must be derived from this class.
- Attention
- This class should be used for all messages which have an actual message data. For signals (messages without any data) a signal_t class should be used as a base class.
- Note
- Class message_t is derived from atomic_refcounted_t. But atomic_refcounted_t is not Copyable or Movable class. It means that copy/move constructors and operators for message_t have no influence on the reference counter inside message_t.
- Examples:
- so_5/chameneos_prealloc_msgs/main.cpp, so_5/collector_many_performers/main.cpp, so_5/collector_performer_pair/main.cpp, so_5/make_pipeline/main.cpp, so_5/modify_resend_as_immutable/main.cpp, so_5/mutable_msg_agents/main.cpp, so_5/news_board/main.cpp, so_5/prio_work_stealing/main.cpp, so_5/simple_message_deadline/main.cpp, so_5/svc/parallel_sum/main.cpp, and so_5/work_generation/main.cpp.
◆ kind_t
A short typedef for kind of message.
- Since
- v.5.5.23
◆ message_t() [1/3]
| so_5::message_t::message_t |
( |
| ) |
|
◆ message_t() [2/3]
| so_5::message_t::message_t |
( |
const message_t & |
other | ) |
|
◆ message_t() [3/3]
| so_5::message_t::message_t |
( |
message_t && |
other | ) |
|
◆ ~message_t()
| virtual so_5::message_t::~message_t |
( |
| ) |
|
|
virtualdefault |
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ so5__payload_ptr()
| const void * so_5::message_t::so5__payload_ptr |
( |
| ) |
const |
|
privatevirtual |
Get the pointer to the message payload.
- Since
- v.5.5.9
- Note
- This method is necessary for message delivery tracing. For ordinal messages it will return a pointer to the message itself. For service requests and user-defined messages it will return pointer to a payload object.
Reimplemented in so_5::msg_service_request_t< Result, Param >, and so_5::user_type_message_t< T >.
◆ so5_change_mutability()
◆ so5_message_kind()
| virtual kind_t so_5::message_t::so5_message_kind |
( |
| ) |
const |
|
inlineprivatevirtual |
◆ so5_message_mutability()
◆ change_message_mutability [1/2]
Helper method for safe change message mutability flag.
Use this method instead of direct call to so5_change_mutability() because what will be nullptr for signals.
- Note
- This is a very dangerous operation. Don't do it by yourselt. See message_t::so5_change_mutability() for more details.
- Attention
- This function can throw. For example underlying message object can prohibit changing of message mutability.
- Parameters
-
| what | Message instance to be modified if it is not a signal. |
| mutability | New mutability flag for the message. |
◆ change_message_mutability [2/2]
Helper method for change message mutability flag.
- Note
- This is a very dangerous operation. Don't do it by yourselt. See message_t::so5_change_mutability() for more details.
- Attention
- This function can throw. For example underlying message object can prohibit changing of message mutability.
- Parameters
-
| what | Message instance to be modified. |
| mutability | New mutability flag for the message. |
◆ impl::internal_message_iface_t
◆ message_kind [1/2]
Helper method for quering kind of the message.
This helper function is necessary because it correctly handles case when message is a signal. In that case pointer to message instance will be null.
- Note
- This function is part of internal implementation of SObjectizer. Don't use it directly. It can be a subject of changes in some future versions.
- Since
- v.5.5.23
◆ message_kind [2/2]
Helper method for quering kind of the message.
- Note
- This function is part of internal implementation of SObjectizer. Don't use it directly. It can be a subject of changes in some future versions.
- Since
- v.5.5.23
◆ message_mutability [1/2]
Helper method for safe get of message mutability flag.
Use this method instead of direct call to so5_message_mutability() because what will be nullptr for signals.
◆ message_mutability [2/2]
Helper method for get message mutability flag.
◆ m_mutability
Is message mutable or immutable?
By default the message is immutable.
- Since
- v.5.5.19
The documentation for this class was generated from the following files: