MADARA  3.2.3
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 <string.h>
13 #include "madara/utility/StdInt.h"
14 #include "madara/MadaraExport.h"
16 
17 namespace madara
18 {
19  namespace transport
20  {
21 
22  #define REDUCED_MADARA_ID "karl1.3"
23 
39  class MADARA_EXPORT ReducedMessageHeader : public MessageHeader
40  {
41  public:
42 
43 #define REDUCED_ORIGINATOR_SIZE 24
44 
48  ReducedMessageHeader ();
49 
53  virtual ~ReducedMessageHeader ();
54 
60  virtual uint32_t encoded_size (void) const;
61 
71  virtual const char * read (const char * buffer,
72  int64_t & buffer_remaining);
73 
83  virtual char * write (char * buffer, int64_t & buffer_remaining);
84 
89  virtual std::string to_string (void);
90 
96  virtual bool equals (const MessageHeader & other);
97 
102  static inline bool reduced_message_header_test (const char * buffer)
103  {
104  return strncmp (&(buffer[8]), REDUCED_MADARA_ID, 7) == 0;
105  }
106  };
107  }
108 }
109 
110 #endif // _MADARA_REDUCED_MESSAGE_HEADER_H_
#define REDUCED_MADARA_ID
static struct madara::knowledge::tags::string_t string
static bool reduced_message_header_test(const char *buffer)
Tests the buffer for a reduced message identifier.
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:57