1 #include "hmbdc/Copyright.hpp" 4 #include "hmbdc/comm/Topic.hpp" 5 #include "hmbdc/time/Time.hpp" 6 #include "hmbdc/app/Message.hpp" 13 namespace hmbdc {
namespace app {
namespace tcpcast {
18 uint16_t messagePayloadLen;
20 std::pair<char const*, char const*> topic()
const {
21 char const* b =
reinterpret_cast<const char*
>(
this)
23 return std::make_pair(b, b + topicLen);
26 void const* payload()
const {
27 return reinterpret_cast<const char*
>(
this)
32 return reinterpret_cast<char*
>(
this)
36 uint16_t typeTag()
const {
41 template <
typename Message>
47 template <
typename Message>
48 Message
const& wrapped()
const {
53 size_t wireSize()
const {
58 size_t wireSizeContainsTopic()
const {
61 } __attribute__((packed));
82 , timestamp(time::SysTime::now())
86 , std::string
const& ipIn
91 , loopback(loopbackIn)
92 , timestamp(time::SysTime::now()) {
93 strncpy(ip, ipIn.c_str(),
sizeof(ip));
94 strncpy(topicRegex, topicRegexIn.c_str(),
sizeof(topicRegex));
95 topicRegex[
sizeof(topicRegex) - 1] = 0;
105 std::ostream& operator << (std::ostream& os,
TopicSource const& m) {
106 return os << m.ip <<
' ' 112 std::istream& operator >> (std::istream& is,
TopicSource& m) {
131 std::ostream& operator << (std::ostream& os,
SessionStarted const & m) {
132 return os <<
"Session to topic source started " << m.ip;
145 std::ostream& operator << (std::ostream& os,
SessionDropped const & m) {
146 return os <<
"Session to topic source dropped " << m.ip;
topic as in the publish / subscribe communication paradigm
Definition: Topic.hpp:14
Definition: Messages.hpp:70
each message type has 16 bit tag
Definition: Message.hpp:30
Definition: Messages.hpp:63
this message appears in the receiver's buffer indicating a previously connected source is dropped ...
Definition: Messages.hpp:141
Definition: Message.hpp:34
Definition: Message.hpp:55
Definition: Messages.hpp:77
this message appears in the receiver's buffer indicating a new source is connected ...
Definition: Messages.hpp:127