MADARA  3.1.8
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/MADARA_export.h"
13 
14 namespace madara
15 {
16  namespace knowledge
17  {
35  class MADARA_Export FileHeader
36  {
37  public:
38 
42  FileHeader ();
43 
47  virtual ~FileHeader ();
48 
54  static uint32_t encoded_size (void);
55 
64  virtual const char * read (const char * buffer,
65  int64_t & buffer_remaining);
66 
75  virtual char * write (char * buffer, int64_t & buffer_remaining);
76 
82  virtual bool equals (const FileHeader & other);
83 
88  static inline bool file_header_test (const char * buffer)
89  {
90  return strncmp (&(buffer[32]), "KaRL", 4) == 0;
91  }
92 
96  uint64_t size;
97 
101  uint64_t states;
102 
107 
111  uint64_t last_timestamp;
112 
116  char file_type[8];
117 
121  uint32_t karl_version;
122 
126  char originator[64];
127  };
128  }
129 }
130 
131 
132 #endif // _MADARA_FILE_HEADER_H_
Defines a file header which is the default for KaRL checkpointing.
Definition: FileHeader.h:35
uint64_t initial_timestamp
the timestamp for the initial checkpointing
Definition: FileHeader.h:106
uint64_t last_timestamp
the timestamp for the last checkpoint
Definition: FileHeader.h:111
uint64_t size
the size of this header plus the updates
Definition: FileHeader.h:96
uint32_t karl_version
Version of KaRL installed when file was created.
Definition: FileHeader.h:121
uint64_t states
the number of states checkpointed in the file stream
Definition: FileHeader.h:101
static bool file_header_test(const char *buffer)
Tests the buffer for a normal message identifier.
Definition: FileHeader.h:88
Provides functions and classes for the distributed knowledge base.
Copyright (c) 2015 Carnegie Mellon University.