1 #include "hmbdc/Copyright.hpp" 4 #include "hmbdc/comm/Topic.hpp" 5 #include "hmbdc/time/Time.hpp" 6 #include "hmbdc/app/Message.hpp" 7 #include "hmbdc/Endian.hpp" 14 namespace hmbdc {
namespace app {
namespace tcpcast {
21 std::pair<char const*, char const*> topic()
const {
22 char const* b =
reinterpret_cast<const char*
>(
this)
24 return std::make_pair(b, b + topicLen);
27 void const* payload()
const {
28 return reinterpret_cast<const char*
>(
this)
33 return reinterpret_cast<char*
>(
this)
37 uint16_t typeTag()
const {
42 template <
typename Message>
48 template <
typename Message>
49 Message
const& wrapped()
const {
54 size_t wireSize()
const {
59 size_t wireSizeContainsTopic()
const {
62 } __attribute__((packed));
87 , std::string
const& ipIn
92 , loopback(loopbackIn) {
93 strncpy(ip, ipIn.c_str(),
sizeof(ip));
94 strncpy(topicRegex, topicRegexIn.c_str(),
sizeof(topicRegex));
95 topicRegex[
sizeof(topicRegex) - 1] = 0;
104 std::ostream& operator << (std::ostream& os,
TopicSource const& m) {
105 return os << m.ip <<
' ' 111 std::istream& operator >> (std::istream& is,
TopicSource& m) {
119 } __attribute__((packed));
130 std::ostream& operator << (std::ostream& os,
SessionStarted const & m) {
131 return os <<
"Session to topic source started " << m.ip;
144 std::ostream& operator << (std::ostream& os,
SessionDropped const & m) {
145 return os <<
"Session to topic source dropped " << m.ip;
topic as in the publish / subscribe communication paradigm
Definition: Topic.hpp:14
Definition: Messages.hpp:71
each message type has 16 bit tag
Definition: Message.hpp:34
Definition: Messages.hpp:64
this message appears in the receiver's buffer indicating a previously connected source is dropped ...
Definition: Messages.hpp:140
Definition: Message.hpp:38
Definition: Message.hpp:72
Definition: Messages.hpp:78
this message appears in the receiver's buffer indicating a new source is connected ...
Definition: Messages.hpp:126