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/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, and so_5/simple_message_deadline/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 |
( |
| ) |
|
|
virtualdefaultnoexcept |
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ so5_change_mutability()
Change message mutabilty flag.
- Attention
- Changing mutability from message_mutability_t::immutable_message to message_mutability_t::mutable_message is a very bad idea. Please don't do this until you are know what you are doing.
- Note
- This method is intended to be used by SObjectizer and low-level SObjectizer extension. Because of that it is not guaranteed that this method is part of stable SObjectizer API. It can be changed or even removed in any future versions of SObjectizer.
-
This is a virual method because its behavious must be changed in msg_service_request_t.
- Attention
- This function can throw. For example a derived class can prohibit changing of message mutability.
- Since
- v.5.5.19
- Parameters
-
| mutability | New mutability flag for |
◆ so5_message_kind()
| virtual kind_t so_5::message_t::so5_message_kind |
( |
| ) |
const |
|
inlineprivatevirtualnoexcept |
Detect the kind of the message.
- Note
- This method is intended to be used by SObjectizer and low-level SObjectizer extension. Because of that it is not guaranteed that this method is part of stable SObjectizer API. It can be changed or even removed in any future versions of SObjectizer.
- Since
- v.5.5.23
Reimplemented in so_5::user_type_message_t< T >, so_5::signal_t, and so_5::enveloped_msg::envelope_t.
◆ so5_message_mutability()
|
|
inlineprivatevirtualnoexcept |
Get message mutability flag.
- Note
- This method is intended to be used by SObjectizer and low-level SObjectizer extension. Because of that it is not guaranteed that this method is part of stable SObjectizer API. It can be changed or even removed in any future versions of SObjectizer.
-
This is a virual method because its behavious must be changed in msg_service_request_t.
- Since
- v.5.5.19
◆ 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
| friend class impl::internal_message_iface_t |
|
friend |
◆ 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: