1 #include "hmbdc/Copyright.hpp" 4 #include "hmbdc/comm/Topic.hpp" 5 #include "hmbdc/app/Message.hpp" 10 namespace hmbdc {
namespace app {
namespace netmap {
14 uint16_t& messagePayloadLen() {
15 return *
reinterpret_cast<uint16_t*
>(payload());
17 uint16_t
const& messagePayloadLen()
const {
18 return *
reinterpret_cast<uint16_t const*
>(payload());
25 using Message =
typename std::decay<M>::type;
26 auto addr = (
char*)addrIn;
37 copyTo(
void* addrIn,
comm::Topic const& t, uint16_t tag,
void const* bytes,
size_t len) {
38 auto addr = (
char*)addrIn;
47 template <
typename Message,
typename ... Args>
49 copyToInPlace(
void* addrIn,
comm::Topic const& t, Args&&... args) {
50 char* addr = (
char*)addrIn;
59 std::pair<char const*, char const*> topic()
const {
60 char const* b =
reinterpret_cast<const char*
>(
this)
62 return std::make_pair(b, b + topicLen);
65 void const* payload()
const {
66 return reinterpret_cast<const char*
>(
this)
71 return reinterpret_cast<char*
>(
this)
75 uint16_t typeTag()
const {
80 template <
typename Message>
86 template <
typename Message>
87 Message
const& wrapped()
const {
92 size_t wireSize()
const {
94 + messagePayloadLen();
97 size_t wireSizeContainsTopic()
const {
101 template <
typename Message>
109 } __attribute__((packed));
125 ,
"do you have a pack pragma unclosed that influencs the above struct packing unexpectedly?");
Definition: Message.hpp:202
Definition: Messages.hpp:111
topic as in the publish / subscribe communication paradigm
Definition: Topic.hpp:14
each message type has 16 bit tag
Definition: Message.hpp:60
Definition: Message.hpp:78
Definition: Messages.hpp:118
Definition: Message.hpp:112