gramods
|
Data entity communicated by the connection to the designated protocol. More...
#include <Protocol.hh>
Public Member Functions | |
Message () | |
Create an empty message. More... | |
Message (std::vector< char > hdr) | |
Create an incoming message initialized with the specified header data. More... | |
Message (char protocol, std::vector< char > data) | |
Create an outgoing message template with protocol id and data. More... | |
std::vector< char > | getHeader () |
Returns a vector filled with header data for this message. More... | |
Public Attributes | |
size_t | from_peer_idx = std::numeric_limits<size_t>::max() |
The index of the peer from which this message originated, or the maximum value of the type if not set. More... | |
size_t | to_peer_idx = std::numeric_limits<size_t>::max() |
The index of the peer to which this message is sent, or the maximum value of the type if not set. More... | |
char | protocol = 0 |
Flag indicating which protocol this message is encoded for. More... | |
size_t | length = 0 |
Expected length of the message as expressed in the message header. More... | |
std::vector< char > | data |
The complete set of data sent by the peer. More... | |
Data entity communicated by the connection to the designated protocol.
|
inline |
Create an empty message.
gramods::gmNetwork::Protocol::Message::Message | ( | std::vector< char > | hdr | ) |
Create an incoming message initialized with the specified header data.
gramods::gmNetwork::Protocol::Message::Message | ( | char | protocol, |
std::vector< char > | data | ||
) |
Create an outgoing message template with protocol id and data.
std::vector< char > gramods::gmNetwork::Protocol::Message::getHeader | ( | ) |
Returns a vector filled with header data for this message.
The length of the header is HEADER_LENGTH.
std::vector<char> gramods::gmNetwork::Protocol::Message::data |
The complete set of data sent by the peer.
size_t gramods::gmNetwork::Protocol::Message::from_peer_idx = std::numeric_limits<size_t>::max() |
The index of the peer from which this message originated, or the maximum value of the type if not set.
size_t gramods::gmNetwork::Protocol::Message::length = 0 |
Expected length of the message as expressed in the message header.
A complete message will satisfy the expression data.length() == message_length
.
char gramods::gmNetwork::Protocol::Message::protocol = 0 |
Flag indicating which protocol this message is encoded for.
size_t gramods::gmNetwork::Protocol::Message::to_peer_idx = std::numeric_limits<size_t>::max() |
The index of the peer to which this message is sent, or the maximum value of the type if not set.