OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FlatBuffer.h File Reference
#include <cstring>
#include "../../Shared/funcannotations.h"
#include <float.h>
#include <string.h>
#include <ostream>
#include <string>
#include <vector>
+ Include dependency graph for FlatBuffer.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  FlatBufferManager
 
struct  FlatBufferManager::BaseWorker
 
struct  FlatBufferManager::GeoPoint
 
struct  FlatBufferManager::GeoPointWorker
 
struct  FlatBufferManager::NestedArrayWorker
 
struct  FlatBufferManager::NestedArray
 
struct  FlatBufferManager::NestedArrayItem< NDIM >
 

Macros

#define RETURN_ERROR(exc)   return (exc)
 
#define FLATBUFFER_UNREACHABLE()   { abort(); }
 
#define FLATBUFFER_SIZES_T_VALUE_TYPE   Int32
 
#define FLATBUFFER_OFFSETS_T_VALUE_TYPE   UInt64
 
#define FLATBUFFER_MANAGER_FORMAT_TOOLS(TYPENAME)
 
#define FLATBUFFER_MANAGER_FORMAT_TOOLS_NEW(TYPENAME)
 
#define FLATBUFFER_MANAGER_SET_OFFSET(OBJ, NAME, SIZE)
 
#define FLATBUFFER_GET_BUFFER_METHODS(BUFFERNAME, BUFFERTYPE)
 

Enumerations

enum  FlatBufferFormat { GeoPointFormatId = 0x67656f706f696e74, NestedArrayFormatId = 0x6e65737465644152 }
 

Functions

int64_t _align_to_int64 (int64_t addr)
 

Macro Definition Documentation

#define FLATBUFFER_GET_BUFFER_METHODS (   BUFFERNAME,
  BUFFERTYPE 
)
Value:
HOST DEVICE inline BUFFERTYPE* get_##BUFFERNAME() { \
int64_t offset = 0; \
switch (format()) { \
offset = getNestedArrayWorker()->BUFFERNAME##_offset; \
break; \
return nullptr; \
} \
return reinterpret_cast<BUFFERTYPE*>(buffer + offset); \
} \
HOST DEVICE inline const BUFFERTYPE* get_##BUFFERNAME() const { \
int64_t offset = 0; \
switch (format()) { \
offset = getNestedArrayWorker()->BUFFERNAME##_offset; \
break; \
return nullptr; \
} \
return reinterpret_cast<BUFFERTYPE*>(buffer + offset); \
}
#define DEVICE
#define HOST

Definition at line 955 of file FlatBuffer.h.

#define FLATBUFFER_MANAGER_FORMAT_TOOLS (   TYPENAME)
Value:
HOST DEVICE inline TYPENAME##Worker* get##TYPENAME##Worker() { \
auto* base = getBaseWorker(); \
return reinterpret_cast<TYPENAME##Worker*>(buffer + base->format_worker_offset); \
} \
HOST DEVICE inline TYPENAME* get##TYPENAME##Metadata() { \
auto* base = getBaseWorker(); \
return reinterpret_cast<TYPENAME*>(buffer + base->format_metadata_offset); \
} \
HOST DEVICE inline const TYPENAME##Worker* get##TYPENAME##Worker() const { \
const auto* base = getBaseWorker(); \
return reinterpret_cast<const TYPENAME##Worker*>(buffer + \
base->format_worker_offset); \
} \
HOST DEVICE inline const TYPENAME* get##TYPENAME##Metadata() const { \
const auto* base = getBaseWorker(); \
return reinterpret_cast<const TYPENAME*>(buffer + base->format_metadata_offset); \
}
#define DEVICE
#define HOST

Definition at line 668 of file FlatBuffer.h.

#define FLATBUFFER_MANAGER_FORMAT_TOOLS_NEW (   TYPENAME)
Value:
HOST DEVICE inline NestedArrayWorker* get##TYPENAME##Worker() { \
auto* base = getBaseWorker(); \
return reinterpret_cast<NestedArrayWorker*>(buffer + base->format_worker_offset); \
} \
HOST DEVICE inline TYPENAME* get##TYPENAME##Metadata() { \
auto* base = getBaseWorker(); \
return reinterpret_cast<TYPENAME*>(buffer + base->format_metadata_offset); \
} \
HOST DEVICE inline const NestedArrayWorker* get##TYPENAME##Worker() const { \
const auto* base = getBaseWorker(); \
return reinterpret_cast<const NestedArrayWorker*>(buffer + \
base->format_worker_offset); \
} \
HOST DEVICE inline const TYPENAME* get##TYPENAME##Metadata() const { \
const auto* base = getBaseWorker(); \
return reinterpret_cast<const TYPENAME*>(buffer + base->format_metadata_offset); \
}
#define DEVICE
#define HOST

Definition at line 690 of file FlatBuffer.h.

#define FLATBUFFER_MANAGER_SET_OFFSET (   OBJ,
  NAME,
  SIZE 
)
Value:
offset = OBJ->NAME##_offset = offset + _align_to_int64(previous_size); \
previous_size = SIZE;
int64_t _align_to_int64(int64_t addr)
Definition: FlatBuffer.h:329

Definition at line 714 of file FlatBuffer.h.

Referenced by FlatBufferManager::initializeNestedArray().

#define FLATBUFFER_OFFSETS_T_VALUE_TYPE   UInt64

Definition at line 395 of file FlatBuffer.h.

#define FLATBUFFER_SIZES_T_VALUE_TYPE   Int32

Definition at line 394 of file FlatBuffer.h.

Enumeration Type Documentation

Enumerator
GeoPointFormatId 
NestedArrayFormatId 

Definition at line 324 of file FlatBuffer.h.

324  {
325  GeoPointFormatId = 0x67656f706f696e74, // hex repr of 'geopoint'
326  NestedArrayFormatId = 0x6e65737465644152 // hex repr of 'nestedAR'
327 };

Function Documentation

int64_t _align_to_int64 ( int64_t  addr)
inline

Definition at line 329 of file FlatBuffer.h.

Referenced by FlatBufferManager::compute_flatbuffer_size(), FlatBufferManager::computeBufferSizeNestedArray(), FlatBufferManager::get_values_buffer_size(), FlatBufferManager::initialize(), and FlatBufferManager::initializeNestedArray().

329  {
330  addr += sizeof(int64_t) - 1;
331  return (int64_t)(((uint64_t)addr >> 3) << 3);
332 }

+ Here is the caller graph for this function: