1 #include "hmbdc/Copyright.hpp" 4 #include "hmbdc/comm/Topic.hpp" 5 #include "hmbdc/time/Time.hpp" 6 #include "hmbdc/app/Message.hpp" 11 namespace hmbdc {
namespace app {
namespace tcpcast {
16 uint16_t messagePayloadLen;
18 std::pair<char const*, char const*> topic()
const {
19 char const* b =
reinterpret_cast<const char*
>(
this)
21 return std::make_pair(b, b + topicLen);
24 void const* payload()
const {
25 return reinterpret_cast<const char*
>(
this)
30 return reinterpret_cast<char*
>(
this)
34 uint16_t typeTag()
const {
39 template <
typename Message>
45 template <
typename Message>
46 Message
const& wrapped()
const {
51 size_t wireSize()
const {
56 size_t wireSizeContainsTopic()
const {
59 } __attribute__((packed));
78 , std::string
const& ipIn
83 , loopback(loopbackIn)
84 , timestamp(time::SysTime::now()) {
85 strncpy(ip, ipIn.c_str(),
sizeof(ip));
86 strncpy(topicRegex, topicRegexIn.c_str(),
sizeof(topicRegex));
87 topicRegex[
sizeof(topicRegex) - 1] = 0;
106 std::ostream& operator << (std::ostream& os,
SessionStarted const & m) {
107 return os <<
"Session to topic source started " << m.ip;
120 std::ostream& operator << (std::ostream& os,
SessionDropped const & m) {
121 return os <<
"Session to topic source dropped " << m.ip;
topic as in the publish / subscribe communication paradigm
Definition: Topic.hpp:14
Definition: Messages.hpp:68
each message type has 16 bit tag
Definition: Message.hpp:30
Definition: Messages.hpp:61
this message appears in the receiver's buffer indicating a previously connected source is dropped ...
Definition: Messages.hpp:116
Definition: Message.hpp:34
Definition: Message.hpp:55
Definition: Messages.hpp:75
this message appears in the receiver's buffer indicating a new source is connected ...
Definition: Messages.hpp:102