MADARA  3.2.3
FileHeader.h
Go to the documentation of this file.
1 #ifndef _MADARA_FILE_HEADER_H_
2 #define _MADARA_FILE_HEADER_H_
3 
11 #include "madara/utility/StdInt.h"
12 #include "madara/MadaraExport.h"
13 #include <string.h>
14 
15 namespace madara
16 {
17  namespace knowledge
18  {
36  class MADARA_EXPORT FileHeader
37  {
38  public:
39 
43  FileHeader ();
44 
48  virtual ~FileHeader ();
49 
55  static uint32_t encoded_size (void);
56 
66  virtual const char * read (const char * buffer,
67  int64_t & buffer_remaining);
68 
78  virtual char * write (char * buffer, int64_t & buffer_remaining);
79 
85  virtual bool equals (const FileHeader & other);
86 
91  static inline bool file_header_test (const char * buffer)
92  {
93  return strncmp (&(buffer[32]), "KaRL", 4) == 0;
94  }
95 
99  uint64_t size;
100 
104  uint64_t states;
105 
110 
114  uint64_t last_timestamp;
115 
119  char file_type[8];
120 
124  uint32_t karl_version;
125 
129  char originator[64];
130  };
131  }
132 }
133 
134 
135 #endif // _MADARA_FILE_HEADER_H_
Defines a file header which is the default for KaRL checkpointing.
Definition: FileHeader.h:36
uint64_t initial_timestamp
the timestamp for the initial checkpointing
Definition: FileHeader.h:109
uint64_t last_timestamp
the timestamp for the last checkpoint
Definition: FileHeader.h:114
uint64_t size
the size of this header plus the updates
Definition: FileHeader.h:99
uint32_t karl_version
Version of KaRL installed when file was created.
Definition: FileHeader.h:124
uint64_t states
the number of states checkpointed in the file stream
Definition: FileHeader.h:104
static bool file_header_test(const char *buffer)
Tests the buffer for a normal message identifier.
Definition: FileHeader.h:91
Provides functions and classes for the distributed knowledge base.
Copyright (c) 2015 Carnegie Mellon University.