MADARA  3.4.1
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:
42  FileHeader();
43 
47  virtual ~FileHeader();
48 
54  static uint32_t encoded_size(void);
55 
65  virtual const char* read(const char* buffer, int64_t& buffer_remaining);
66 
76  virtual char* write(char* buffer, int64_t& buffer_remaining);
77 
83  virtual bool equals(const FileHeader& other);
84 
89  static inline bool file_header_test(const char* buffer)
90  {
91  return strncmp(&(buffer[32]), "KaRL1.5", 7) == 0;
92  }
93 
97  uint64_t size;
98 
102  uint64_t states;
103 
108 
112  uint64_t last_timestamp;
113 
117  char file_type[8];
118 
122  uint32_t karl_version;
123 
127  char originator[64];
128 };
129 }
130 }
131 
132 #endif // _MADARA_FILE_HEADER_H_
Defines a file header which is the default for KaRL checkpointing.
Definition: FileHeader.h:37
uint64_t initial_timestamp
the timestamp for the initial checkpointing
Definition: FileHeader.h:107
uint64_t size
the size of this header plus the updates
Definition: FileHeader.h:97
static bool file_header_test(const char *buffer)
Tests the buffer for a normal message identifier.
Definition: FileHeader.h:89
uint64_t last_timestamp
the timestamp for the last checkpoint
Definition: FileHeader.h:112
uint64_t states
the number of states checkpointed in the file stream
Definition: FileHeader.h:102
uint32_t karl_version
Version of KaRL installed when file was created.
Definition: FileHeader.h:122
Provides functions and classes for the distributed knowledge base.
Copyright(c) 2020 Galois.