MADARA  3.1.8
ReducedMessageHeader.h
Go to the documentation of this file.
1 #ifndef _MADARA_REDUCED_MESSAGE_HEADER_H_
2 #define _MADARA_REDUCED_MESSAGE_HEADER_H_
3 
12 #include "madara/utility/stdint.h"
13 #include "madara/MADARA_export.h"
15 
16 namespace madara
17 {
18  namespace transport
19  {
20 
21  #define REDUCED_MADARA_ID "karl1.3"
22 
38  class MADARA_Export ReducedMessageHeader : public MessageHeader
39  {
40  public:
41 
42 #define REDUCED_ORIGINATOR_SIZE 24
43 
47  ReducedMessageHeader ();
48 
52  virtual ~ReducedMessageHeader ();
53 
59  virtual uint32_t encoded_size (void) const;
60 
69  virtual const char * read (const char * buffer,
70  int64_t & buffer_remaining);
71 
80  virtual char * write (char * buffer, int64_t & buffer_remaining);
81 
86  virtual std::string to_string (void);
87 
93  virtual bool equals (const MessageHeader & other);
94 
99  static inline bool reduced_message_header_test (const char * buffer)
100  {
101  return strncmp (&(buffer[8]), REDUCED_MADARA_ID, 7) == 0;
102  }
103  };
104  }
105 }
106 
107 #endif // _MADARA_REDUCED_MESSAGE_HEADER_H_
#define REDUCED_MADARA_ID
static bool reduced_message_header_test(const char *buffer)
Tests the buffer for a reduced message identifier.
static constexpr struct madara::knowledge::tags::string_t string
Defines a simple, smaller message header of 29 bytes that supports less QoS.
Copyright (c) 2015 Carnegie Mellon University.
Defines a robust message header which is the default for KaRL messages.
Definition: MessageHeader.h:56