ZeroBuf  0.1.0
ZeroBuf is a replacement for FlatBuffers
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Schema.h
1 
2 /* Copyright (c) 2015, Human Brain Project
3  * Daniel.Nachbaur@epfl.ch
4  */
5 
6 #ifndef ZEROBUF_SCHEMA_H
7 #define ZEROBUF_SCHEMA_H
8 
9 #include <zerobuf/api.h>
10 #include <zerobuf/NonMovingAllocator.h>
11 #include <servus/uint128_t.h>
12 #include <tuple>
13 
14 namespace zerobuf
15 {
16 
21 struct Schema
22 {
27  const size_t staticSize;
28 
33  const size_t numDynamic;
34 
39  const servus::uint128_t type;
40 
42  enum FieldEnum
43  {
50  };
51 
53  typedef std::tuple< std::string, std::string, size_t, size_t, bool > Field;
54 
56  const std::vector< Field > fields;
57 };
58 
59 }
60 
61 #endif
Defines export visibility macros for library ZeroBuf.
std::tuple< std::string, std::string, size_t, size_t, bool > Field
Contains the necessary information to describe one object field.
Definition: Schema.h:53
const size_t staticSize
The static size of the object.
Definition: Schema.h:27
A runtime and optimized representation of the schema file input, which describes the data layout of a...
Definition: Schema.h:21
bool if the field is static or not
Definition: Schema.h:49
FieldEnum
Access enums for the field tuple in the object.
Definition: Schema.h:42
const size_t numDynamic
The number of dynamic fields in the object.
Definition: Schema.h:33
const servus::uint128_t type
The type identifier of the object.
Definition: Schema.h:39
the data offset in the allocator
Definition: Schema.h:46
size of static arrays, size offset in the allocator for dynamic arrays
Definition: Schema.h:47
const std::vector< Field > fields
All the fields in object.
Definition: Schema.h:56
the type of the field
Definition: Schema.h:45
the name of the field
Definition: Schema.h:44