1 #include "hmbdc/Copyright.hpp" 4 #include "hmbdc/comm/Topic.hpp" 5 #include "hmbdc/app/Message.hpp" 10 namespace hmbdc {
namespace app {
namespace netmap {
12 using namespace hmbdc;
17 uint16_t& messagePayloadLen() {
18 return *
reinterpret_cast<uint16_t*
>(payload());
20 uint16_t
const& messagePayloadLen()
const {
21 return *
reinterpret_cast<uint16_t const*
>(payload());
27 copyTo(
void* addrIn,
Topic const& t, M&& m) {
28 using Message =
typename std::remove_reference<M>::type;
29 auto addr = (
char*)addrIn;
40 copyTo(
void* addrIn,
Topic const& t, uint16_t tag,
void const* bytes,
size_t len) {
41 auto addr = (
char*)addrIn;
50 template <
typename Message,
typename ... Args>
52 copyToInPlace(
void* addrIn,
Topic const& t, Args&&... args) {
53 char* addr = (
char*)addrIn;
62 std::pair<char const*, char const*> topic()
const {
63 char const* b =
reinterpret_cast<const char*
>(
this)
65 return std::make_pair(b, b + topicLen);
68 void const* payload()
const {
69 return reinterpret_cast<const char*
>(
this)
74 return reinterpret_cast<char*
>(
this)
78 uint16_t typeTag()
const {
83 template <
typename Message>
89 template <
typename Message>
90 Message
const& wrapped()
const {
95 size_t wireSize()
const {
97 + messagePayloadLen();
100 size_t wireSizeContainsTopic()
const {
104 template <
typename Message>
106 size_t wireSize(
Topic const& t) {
112 } __attribute__((packed));
Definition: Message.hpp:125
Definition: Messages.hpp:119
topic as in the publish / subscribe communication paradigm
Definition: Topic.hpp:14
Definition: Message.hpp:21
Definition: Message.hpp:25
Definition: Messages.hpp:126
Definition: Message.hpp:46
Definition: Client.hpp:11