|
MADARA
3.1.8
|
Defines a simple, smaller message header of 29 bytes that supports less QoS. More...
#include <ReducedMessageHeader.h>


Public Member Functions | |
| ReducedMessageHeader () | |
| Constructor. More... | |
| virtual | ~ReducedMessageHeader () |
| Destructor. More... | |
| virtual uint32_t | encoded_size (void) const |
| Returns the size of the encoded MessageHeader class, which may be different from sizeof (MessageHeader) because of compiler optimizations for word boundaries. More... | |
| virtual bool | equals (const MessageHeader &other) |
| Compares the fields of this instance to another instance. More... | |
| virtual const char * | read (const char *buffer, int64_t &buffer_remaining) |
| Reads a MessageHeader instance from a buffer and updates the amount of buffer room remaining. More... | |
| virtual std::string | to_string (void) |
| Converts the relevant fields to a printable string. More... | |
| virtual char * | write (char *buffer, int64_t &buffer_remaining) |
| Writes a MessageHeader instance to a buffer and updates the amount of buffer room remaining. More... | |
Static Public Member Functions | |
| static uint64_t | get_size (const char *buffer) |
| Returns the size field of the header. More... | |
| static bool | message_header_test (const char *buffer) |
| Tests the buffer for a normal message identifier. More... | |
| static bool | reduced_message_header_test (const char *buffer) |
| Tests the buffer for a reduced message identifier. More... | |
| static uint32_t | static_encoded_size (void) |
| Returns the size of the encoded MessageHeader class. More... | |
Public Attributes | |
| uint64_t | clock |
| the clock of the sender when the message was generated More... | |
| char | domain [32] |
| the domain that this message is intended for More... | |
| char | madara_id [8] |
| the identifier of this transport (MADARA_IDENTIFIER) More... | |
| char | originator [64] |
| the originator of the message (host:port) More... | |
| uint32_t | quality |
| the quality of the message sender More... | |
| uint64_t | size |
| the size of this header plus the updates More... | |
| uint64_t | timestamp |
| the timestamp of the sender when the message was generated More... | |
| unsigned char | ttl |
| time to live (number of rebroadcasts to perform after original send More... | |
| uint32_t | type |
| the type of message More... | |
| uint32_t | updates |
| the number of knowledge variable updates in the message More... | |
Defines a simple, smaller message header of 29 bytes that supports less QoS.
Format:
[0] [64 bit unsigned size]
[8] [8 byte string transport id]
[16] [4 byte unsigned num updates]
[20] [64 bit unsigned clock]
[28] [8 bit unsigned ttl–for rebroadcasts]
[29] [knowledge updates start here]
Definition at line 38 of file ReducedMessageHeader.h.
| madara::transport::ReducedMessageHeader::ReducedMessageHeader | ( | ) |
Constructor.
Definition at line 7 of file ReducedMessageHeader.cpp.
|
virtual |
Destructor.
Definition at line 14 of file ReducedMessageHeader.cpp.
|
virtual |
Returns the size of the encoded MessageHeader class, which may be different from sizeof (MessageHeader) because of compiler optimizations for word boundaries.
Reimplemented from madara::transport::MessageHeader.
Definition at line 19 of file ReducedMessageHeader.cpp.
|
virtual |
Compares the fields of this instance to another instance.
| other | the other instance to compare against |
Reimplemented from madara::transport::MessageHeader.
Definition at line 155 of file ReducedMessageHeader.cpp.
|
staticinherited |
Returns the size field of the header.
Definition at line 241 of file MessageHeader.cpp.
|
inlinestaticinherited |
Tests the buffer for a normal message identifier.
Definition at line 129 of file MessageHeader.h.
|
virtual |
Reads a MessageHeader instance from a buffer and updates the amount of buffer room remaining.
| buffer | the readable buffer where data is stored |
| buffer_remaining | the count of bytes remaining in the buffer to read |
Reimplemented from madara::transport::MessageHeader.
Definition at line 27 of file ReducedMessageHeader.cpp.
|
inlinestatic |
Tests the buffer for a reduced message identifier.
Definition at line 99 of file ReducedMessageHeader.h.
|
staticinherited |
Returns the size of the encoded MessageHeader class.
This function differs from encoded_size () in that encoded_size reports polymorphically, while this method may be called statically and always refers to the base class's size.
Definition at line 34 of file MessageHeader.cpp.
|
virtual |
Converts the relevant fields to a printable string.
Reimplemented from madara::transport::MessageHeader.
Definition at line 141 of file ReducedMessageHeader.cpp.
|
virtual |
Writes a MessageHeader instance to a buffer and updates the amount of buffer room remaining.
| buffer | the readable buffer where data is stored |
| buffer_remaining | the count of bytes remaining in the buffer to read |
Reimplemented from madara::transport::MessageHeader.
Definition at line 86 of file ReducedMessageHeader.cpp.
|
inherited |
the clock of the sender when the message was generated
Definition at line 172 of file MessageHeader.h.
|
inherited |
the domain that this message is intended for
Definition at line 147 of file MessageHeader.h.
|
inherited |
the identifier of this transport (MADARA_IDENTIFIER)
Definition at line 142 of file MessageHeader.h.
|
inherited |
the originator of the message (host:port)
Definition at line 152 of file MessageHeader.h.
|
inherited |
the quality of the message sender
Definition at line 167 of file MessageHeader.h.
|
inherited |
the size of this header plus the updates
Definition at line 137 of file MessageHeader.h.
|
inherited |
the timestamp of the sender when the message was generated
Definition at line 177 of file MessageHeader.h.
|
inherited |
time to live (number of rebroadcasts to perform after original send
Definition at line 182 of file MessageHeader.h.
|
inherited |
the type of message
Definition at line 157 of file MessageHeader.h.
|
inherited |
the number of knowledge variable updates in the message
Definition at line 162 of file MessageHeader.h.