Message class for communication. More...
#include <core.hpp>
Public Member Functions | |
| Message (Rank peer_rank, std::vector< std::uint8_t > &&metadata, std::unique_ptr< Buffer > data=nullptr) | |
| Construct a new Message. More... | |
| constexpr Rank | peer_rank () const noexcept |
| Get the destination rank for outgoing or source rank for incoming messages. More... | |
| constexpr std::vector< std::uint8_t > const & | metadata () const noexcept |
| Get the serialized metadata for this message. More... | |
| std::vector< std::uint8_t > | release_metadata () noexcept |
| Release ownership of the metadata. More... | |
| Buffer const * | data () const |
| Get the data buffer for this message. More... | |
| std::unique_ptr< Buffer > | release_data () noexcept |
| Release ownership of the data buffer. More... | |
| void | set_data (std::unique_ptr< Buffer > buffer) |
| Set the data buffer for this message. More... | |
Message class for communication.
This class contains the essential information needed for communication: data payload, metadata, and peer rank (source/destination).
| rapidsmpf::communicator::MetadataPayloadExchange::Message::Message | ( | Rank | peer_rank, |
| std::vector< std::uint8_t > && | metadata, | ||
| std::unique_ptr< Buffer > | data = nullptr |
||
| ) |
Construct a new Message.
| peer_rank | Destination (outgoing) or source (incoming) rank. |
| metadata | Serialized metadata. |
| data | Data buffer (can be nullptr for metadata-only messages). |
| Buffer const* rapidsmpf::communicator::MetadataPayloadExchange::Message::data | ( | ) | const |
Get the data buffer for this message.
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
noexcept |
Release ownership of the data buffer.
This is typically called when transferring a buffer to the communication layer.
|
noexcept |
Release ownership of the metadata.
This is typically called when transferring metadata to the communication layer.
| void rapidsmpf::communicator::MetadataPayloadExchange::Message::set_data | ( | std::unique_ptr< Buffer > | buffer | ) |
Set the data buffer for this message.
This method can be used by implementations to update the data buffer.
| buffer | Data buffer to be set. |