hobbes
a language, embedded compiler, and runtime for efficient dynamic expression evaluation, data storage and analysis
Classes | Namespaces | Macros | Typedefs | Enumerations | Functions
storage.H File Reference
#include <map>
#include <vector>
#include <string>
#include <string.h>
#include <tuple>
#include <functional>
#include <iostream>
#include <sstream>
#include <stdexcept>
#include <stdlib.h>
#include <stdint.h>
#include <assert.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <sys/un.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <netinet/in.h>
#include <netdb.h>
#include <fcntl.h>
#include <linux/futex.h>
#include <sys/syscall.h>
Include dependency graph for storage.H:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  hobbes::storage::pqueue_config
 
struct  hobbes::storage::ShQueueHeader
 
struct  hobbes::storage::ShQueueData
 
class  hobbes::storage::writer
 
class  hobbes::storage::wpipe
 
struct  hobbes::storage::QueueConnection
 
class  hobbes::storage::reader
 
class  hobbes::storage::rpipe
 
struct  hobbes::storage::store< T, P >
 
struct  hobbes::storage::cannot_memcpy< T, P >
 
struct  hobbes::storage::cannot_memcpy< T, typename store< T >::can_memcpy >
 
struct  hobbes::storage::store_tuple_types< Ts >
 
struct  hobbes::storage::store_tuple_types< T, Ts... >
 
struct  hobbes::storage::storeTuple< i, e, Ts >
 
struct  hobbes::storage::storeTuple< e, e, Ts... >
 
struct  hobbes::storage::store< std::tuple< Ts... > >
 
struct  hobbes::storage::store< T, typename T::is_packed_hstore_struct >
 
struct  hobbes::storage::store< T, typename T::is_hstore_struct >
 
struct  hobbes::storage::store< std::pair< U, V > >
 
struct  hobbes::storage::store< T, typename T::is_hstore_enum >
 
struct  hobbes::storage::store< T, typename T::is_hstore_variant >
 
struct  hobbes::storage::recursion
 
struct  hobbes::storage::recursive< T >
 
struct  hobbes::storage::store< recursion >
 
struct  hobbes::storage::store< recursive< T > >
 
struct  hobbes::storage::unit
 
struct  hobbes::storage::store< unit >
 
struct  hobbes::storage::store< T, typename T::is_hstore_alias >
 
struct  hobbes::storage::fixedArrTyDesc< T, N >
 
struct  hobbes::storage::fixedArrMemcpyWrite< T, N >
 
struct  hobbes::storage::fixedArrIterWrite< T, N >
 
struct  hobbes::storage::store< T[N], typename store< T >::can_memcpy >
 
struct  hobbes::storage::store< T[N], typename cannot_memcpy< T >::type >
 
struct  hobbes::storage::store< std::vector< T >, typename store< T >::can_memcpy >
 
struct  hobbes::storage::store< std::vector< T >, typename cannot_memcpy< T >::type >
 
struct  hobbes::storage::store< const char * >
 
struct  hobbes::storage::store< std::string >
 
struct  hobbes::storage::hstore_payload_types< Ts >
 
struct  hobbes::storage::hstore_payload_types< T, Ts... >
 
struct  hobbes::storage::strpack< pcs >
 
struct  hobbes::storage::StorageStatement< Group, G, File, Line, StmtName, Flags, FormatStr, ArgTyList >
 
struct  hobbes::storage::StorageGroup< Name, cm >
 
struct  hobbes::storage::StorageGroup< Name, cm >::StmtData
 
struct  hobbes::storage::serialize_values< Ts >
 
struct  hobbes::storage::serialize_values< T, Ts... >
 
struct  hobbes::storage::statement
 
class  hobbes::storage::Transaction
 

Namespaces

 hobbes
 
 hobbes::storage
 

Macros

#define HSTORE_VERSION   ((uint32_t)0x00010000)
 
#define _HSTORE_LIKELY(x)   __builtin_expect((x),1)
 
#define _HSTORE_UNLIKELY(x)   __builtin_expect((x),0)
 
#define xchg   __sync_lock_test_and_set
 
#define _HSTORE_STATE_UNBLOCKED   0
 
#define _HSTORE_STATE_READER_WAITING   1
 
#define _HSTORE_STATE_WRITER_WAITING   2
 
#define _HSTORE_PAGE_STATE_TENTATIVE   ((uint8_t)0)
 
#define _HSTORE_PAGE_STATE_CONT   ((uint8_t)1)
 
#define _HSTORE_PAGE_STATE_COMMIT   ((uint8_t)2)
 
#define _HSTORE_PAGE_STATE_ROLLBACK   ((uint8_t)3)
 
#define _HSTORE_TYCTOR_PRIM   ((int)0)
 
#define _HSTORE_TYCTOR_TVAR   ((int)2)
 
#define _HSTORE_TYCTOR_FIXEDARR   ((int)4)
 
#define _HSTORE_TYCTOR_ARR   ((int)5)
 
#define _HSTORE_TYCTOR_VARIANT   ((int)6)
 
#define _HSTORE_TYCTOR_STRUCT   ((int)7)
 
#define _HSTORE_TYCTOR_SIZE   ((int)11)
 
#define _HSTORE_TYCTOR_RECURSIVE   ((int)13)
 
#define _HSTORE_DEFINE_PRIMTYS(T, n)
 
#define _HSTORE_FIRST(a, ...)   a
 
#define _HSTORE_SECOND(a, b, ...)   b
 
#define _HSTORE_JOIN(a, b)   a ## b
 
#define _HSTORE_IS_NEGATE(...)   _HSTORE_SECOND(__VA_ARGS__, 0)
 
#define _HSTORE_NOT(x)   _HSTORE_IS_NEGATE(_HSTORE_JOIN(_HSTORE__NOT_, x))
 
#define _HSTORE__NOT_0   NEGATE, 1
 
#define _HSTORE_BOOL(x)   _HSTORE_NOT(_HSTORE_NOT(x))
 
#define _HSTORE_IF_ELSE(condition)   _HSTORE__IF_ELSE(_HSTORE_BOOL(condition))
 
#define _HSTORE__IF_ELSE(condition)   _HSTORE_JOIN(_HSTORE__IF_, condition)
 
#define _HSTORE__IF_1(...)   __VA_ARGS__ _HSTORE__IF_1_ELSE
 
#define _HSTORE__IF_0(...)   _HSTORE__IF_0_ELSE
 
#define _HSTORE__IF_1_ELSE(...)
 
#define _HSTORE__IF_0_ELSE(...)   __VA_ARGS__
 
#define _HSTORE_EMPTY()
 
#define _HSTORE_EVAL(...)   _HSTORE_EVAL256(__VA_ARGS__)
 
#define _HSTORE_EVAL256(...)   _HSTORE_EVAL128(_HSTORE_EVAL128(__VA_ARGS__))
 
#define _HSTORE_EVAL128(...)   _HSTORE_EVAL64(_HSTORE_EVAL64(__VA_ARGS__))
 
#define _HSTORE_EVAL64(...)   _HSTORE_EVAL32(_HSTORE_EVAL32(__VA_ARGS__))
 
#define _HSTORE_EVAL32(...)   _HSTORE_EVAL16(_HSTORE_EVAL16(__VA_ARGS__))
 
#define _HSTORE_EVAL16(...)   _HSTORE_EVAL8(_HSTORE_EVAL8(__VA_ARGS__))
 
#define _HSTORE_EVAL8(...)   _HSTORE_EVAL4(_HSTORE_EVAL4(__VA_ARGS__))
 
#define _HSTORE_EVAL4(...)   _HSTORE_EVAL2(_HSTORE_EVAL2(__VA_ARGS__))
 
#define _HSTORE_EVAL2(...)   _HSTORE_EVAL1(_HSTORE_EVAL1(__VA_ARGS__))
 
#define _HSTORE_EVAL1(...)   __VA_ARGS__
 
#define _HSTORE_DEFER2(m)   m _HSTORE_EMPTY _HSTORE_EMPTY()()
 
#define _HSTORE_HAS_PARGS(...)   _HSTORE_BOOL(_HSTORE_FIRST(_HSTORE__EOAP_ __VA_ARGS__)())
 
#define _HSTORE__EOAP_(...)   _HSTORE_BOOL(_HSTORE_FIRST(_HSTORE__EOA_ __VA_ARGS__)())
 
#define _HSTORE__EOA_()   0
 
#define _HSTORE_MAP(f, VS...)   _HSTORE_EVAL(_HSTORE_MAPP(f, VS))
 
#define _HSTORE_MAPP(f, H, T...)
 
#define _HSTORE__MAPP()   _HSTORE_MAPP
 
#define HSTORE_FIELDC_SUCC(t, n)   +1
 
#define HSTORE_FIELD_COUNT(FIELDS...)   (0 _HSTORE_MAP(HSTORE_FIELDC_SUCC, FIELDS))
 
#define HSTORE_FIELDS_SUCC(t, n)   +::hobbes::storage::store< t >::size(this-> n)
 
#define HSTORE_FIELD_SIZE(FIELDS...)   (0 _HSTORE_MAP(HSTORE_FIELDS_SUCC, FIELDS))
 
#define HSTORE_FIELDW_SUCC(t, n)   &&::hobbes::storage::store< t >::write(p, this-> n)
 
#define HSTORE_FIELD_WRITES(FIELDS...)   (true _HSTORE_MAP(HSTORE_FIELDW_SUCC, FIELDS))
 
#define HSTORE_STRUCT_FIELD(t, n)   t n;
 
#define HSTORE_STRUCT_FIELD_ENC(t, n)   ::hobbes::storage::ws(#n, out); ::hobbes::storage::w((int)-1, out); ::hobbes::storage::store< t >::encode(out);
 
#define HSTORE_STRUCT_FIELD_DESC(t, n)   + (", " #n " : " + ::hobbes::storage::store< t >::describe())
 
#define DEFINE_PACKED_HSTORE_STRUCT(T, FIELDS...)
 
#define DEFINE_HSTORE_STRUCT(T, FIELDS...)
 
#define HSTORE_ENUM_CTOR_DEF(n)   n ,
 
#define HSTORE_ENUM_CTOR_CTOR(n)   static const SelfT n() { return SelfT(SelfT::Enum::n); }
 
#define HSTORE_ENUM_CTORC_SUCC(n)   +1
 
#define HSTORE_ENUM_CTOR_STR(n)   + "|" #n
 
#define HSTORE_ENUM_CTOR_ENCODE(n)
 
#define DEFINE_HSTORE_ENUM(T, CTORS...)
 
#define DEFINE_HSTORE_VARIANT_GEN(T, VDECL, VCTORS, VCOPY, VDESTROY, CTORCOUNT, VENCODE, VDESC, VSIZE, VWRITE, VVISITCASE, VEQCASE, CTAGS, CDATA)
 
#define HSTORE_VARIANT_CTOR(n, t)   static SelfT n(const t & x) { SelfT r; r.tag = Enum::tag_##n; new (r.data) t(x); return r; }
 
#define HSTORE_VARIANT_CTOR_STR(n, t)   + "," #n ":" + ::hobbes::storage::store< t >::describe()
 
#define HSTORE_VARIANT_CTOR_TAG(n, t)   tag_##n,
 
#define HSTORE_VARIANT_SIZE_CASE(n, t)   case Enum::tag_##n: return sizeof(int) + ::hobbes::storage::store< t >::size(this->n##_data);
 
#define HSTORE_VARIANT_WRITE_CASE(n, t)   case Enum::tag_##n: return ::hobbes::storage::store<int>::write(p, (int)this->tag) && ::hobbes::storage::store< t >::write(p, this->n##_data);
 
#define HSTORE_VARIANT_PCOPY(n, t)   case Enum::tag_##n: new (this->data) t(rhs.n##_data); break;
 
#define HSTORE_VARIANT_PDESTROY(n, t)   case Enum::tag_##n: { typedef t __DT; ((__DT*)&this->n##_data)->~__DT(); } break;
 
#define HSTORE_VARIANT_SUCC(n, t)   +1
 
#define HSTORE_VARIANT_CTOR_OPAQUEDATA(n, t)   t n##_data;
 
#define HSTORE_VARIANT_CTOR_ENCODE(n, t)
 
#define HSTORE_VARIANT_VDECL(n, t)   virtual R n(const t & x) const = 0;
 
#define HSTORE_VARIANT_VCASE(n, t)   case Enum::tag_##n: return v. n (this->n##_data);
 
#define HSTORE_VARIANT_EQCASE(n, t)   case Enum::tag_##n: return (this->n##_data == rhs.n##_data);
 
#define DEFINE_HSTORE_VARIANT(T, CTORS...)   DEFINE_HSTORE_VARIANT_GEN(T, _HSTORE_MAP(HSTORE_VARIANT_VDECL, CTORS), _HSTORE_MAP(HSTORE_VARIANT_CTOR, CTORS), _HSTORE_MAP(HSTORE_VARIANT_PCOPY, CTORS), _HSTORE_MAP(HSTORE_VARIANT_PDESTROY, CTORS), _HSTORE_MAP(HSTORE_VARIANT_SUCC, CTORS), _HSTORE_MAP(HSTORE_VARIANT_CTOR_ENCODE, CTORS), _HSTORE_MAP(HSTORE_VARIANT_CTOR_STR, CTORS), _HSTORE_MAP(HSTORE_VARIANT_SIZE_CASE, CTORS), _HSTORE_MAP(HSTORE_VARIANT_WRITE_CASE, CTORS), _HSTORE_MAP(HSTORE_VARIANT_VCASE, CTORS), _HSTORE_MAP(HSTORE_VARIANT_EQCASE, CTORS), _HSTORE_MAP(HSTORE_VARIANT_CTOR_TAG, CTORS), _HSTORE_MAP(HSTORE_VARIANT_CTOR_OPAQUEDATA, CTORS))
 
#define HSTORE_VARIANT_LBL_CTOR(n, lbl, t)   static SelfT n(const t & x) { SelfT r; r.tag = Enum::tag_##n; new (r.data) t(x); return r; }
 
#define HSTORE_VARIANT_LBL_CTOR_STR(n, lbl, t)   + "," #n ":" + ::hobbes::storage::store< t >::describe()
 
#define HSTORE_VARIANT_LBL_CTOR_TAG(n, lbl, t)   tag_##n,
 
#define HSTORE_VARIANT_LBL_SIZE_CASE(n, lbl, t)   case Enum::tag_##n: return sizeof(int) + ::hobbes::storage::store< t >::size(this->n##_data);
 
#define HSTORE_VARIANT_LBL_WRITE_CASE(n, lbl, t)   case Enum::tag_##n: return ::hobbes::storage::store<int>::write(p, (int)this->tag) && ::hobbes::storage::store< t >::write(p, this->n##_data);
 
#define HSTORE_VARIANT_LBL_PCOPY(n, lbl, t)   case Enum::tag_##n: new (this->data) t(rhs.n##_data); break;
 
#define HSTORE_VARIANT_LBL_PDESTROY(n, lbl, t)   case Enum::tag_##n: { typedef t __DT; ((__DT*)&this->n##_data)->~__DT(); } break;
 
#define HSTORE_VARIANT_LBL_SUCC(n, lbl, t)   +1
 
#define HSTORE_VARIANT_LBL_CTOR_OPAQUEDATA(n, lbl, t)   t n##_data;
 
#define HSTORE_VARIANT_LBL_CTOR_ENCODE(n, lbl, t)
 
#define HSTORE_VARIANT_LBL_VDECL(n, lbl, t)   virtual R n(const t & x) const = 0;
 
#define HSTORE_VARIANT_LBL_VCASE(n, lbl, t)   case Enum::tag_##n: return v. n (this->n##_data);
 
#define HSTORE_VARIANT_LBL_EQCASE(n, lbl, t)   case Enum::tag_##n: return (this->n##_data == rhs.n##_data);
 
#define DEFINE_HSTORE_VARIANT_WITH_LABELS(T, CTORS...)   DEFINE_HSTORE_VARIANT_GEN(T, _HSTORE_MAP(HSTORE_VARIANT_LBL_VDECL, CTORS), _HSTORE_MAP(HSTORE_VARIANT_LBL_CTOR, CTORS), _HSTORE_MAP(HSTORE_VARIANT_LBL_PCOPY, CTORS), _HSTORE_MAP(HSTORE_VARIANT_LBL_PDESTROY, CTORS), _HSTORE_MAP(HSTORE_VARIANT_LBL_SUCC, CTORS), _HSTORE_MAP(HSTORE_VARIANT_LBL_CTOR_ENCODE, CTORS), _HSTORE_MAP(HSTORE_VARIANT_LBL_CTOR_STR, CTORS), _HSTORE_MAP(HSTORE_VARIANT_LBL_SIZE_CASE, CTORS), _HSTORE_MAP(HSTORE_VARIANT_LBL_WRITE_CASE, CTORS), _HSTORE_MAP(HSTORE_VARIANT_LBL_VCASE, CTORS), _HSTORE_MAP(HSTORE_VARIANT_LBL_EQCASE, CTORS), _HSTORE_MAP(HSTORE_VARIANT_LBL_CTOR_TAG, CTORS), _HSTORE_MAP(HSTORE_VARIANT_LBL_CTOR_OPAQUEDATA, CTORS))
 
#define DEFINE_HSTORE_TYPE_ALIAS(_ATY, _REPTY)
 
#define _HSTORE_TSTR32(i, s)   ::hobbes::storage::at8(i+(8*0),s),::hobbes::storage::at8(i+(8*1),s),::hobbes::storage::at8(i+(8*2),s),::hobbes::storage::at8(i+(8*3),s)
 
#define _HSTORE_TSTR128(i, s)   _HSTORE_TSTR32(i+(32*0),s),_HSTORE_TSTR32(i+(32*1),s),_HSTORE_TSTR32(i+(32*2),s),_HSTORE_TSTR32(i+(32*3),s)
 
#define _HSTORE_TSTR512(i, s)   _HSTORE_TSTR128(i+(128*0),s),_HSTORE_TSTR128(i+(128*1),s),_HSTORE_TSTR128(i+(128*2),s),_HSTORE_TSTR128(i+(128*3),s)
 
#define _HSTORE_TSTR1024(i, s)   _HSTORE_TSTR512(i+(512*0),s),_HSTORE_TSTR512(i+(512*1),s)
 
#define _HSTORE_TSTR(s)   ::hobbes::storage::strpack<_HSTORE_TSTR1024(0,s)>
 
#define DECLARE_STORAGE_GROUP(NAME, cm)   extern ::hobbes::storage::StorageGroup<_HSTORE_TSTR(#NAME),cm> NAME
 
#define DEFINE_STORAGE_GROUP(NAME, pagec, qos, cm)   ::hobbes::storage::StorageGroup<_HSTORE_TSTR(#NAME),cm> NAME = { 0, qos, pagec, -1 }
 
#define APPLY_HSTORE_STMT(GROUP, NAME, FLAGS, FMTSTR, ARGS...)   ::hobbes::storage::write(&GROUP, ({static_assert(::hobbes::storage::maxVarRef(FMTSTR) <= decltype(::hobbes::storage::makePayloadTypes(ARGS))::count, "Log format string and payload arity mismatch"); ::hobbes::storage::StorageStatement<decltype(GROUP),&GROUP,_HSTORE_TSTR(__FILE__),__LINE__,_HSTORE_TSTR(#NAME),FLAGS,_HSTORE_TSTR(FMTSTR),decltype(::hobbes::storage::makePayloadTypes(ARGS))>::id;}), ## ARGS)
 
#define HSTORE(GROUP, NAME, ARGS...)   APPLY_HSTORE_STMT(GROUP, NAME, 0, "", ## ARGS)
 
#define HLOG(GROUP, NAME, FMTSTR, ARGS...)   APPLY_HSTORE_STMT(GROUP, NAME, 1, FMTSTR, ## ARGS)
 

Typedefs

typedef std::vector< uint8_t > hobbes::storage::bytes
 
typedef std::pair< uint64_t, uint64_t > hobbes::storage::ProcThread
 
typedef void(* hobbes::storage::tydescfn) (bytes *, std::string *)
 
typedef std::vector< statement > hobbes::storage::statements
 

Enumerations

enum  hobbes::storage::PipeQOS { hobbes::storage::Reliable = 0, hobbes::storage::Unreliable }
 
enum  hobbes::storage::CommitMethod { hobbes::storage::AutoCommit = 0, hobbes::storage::ManualCommit }
 

Functions

static long hobbes::storage::sys_futex (volatile uint32_t *p, int op, int v, struct timespec *timeout, void *p2, int v2)
 
static void hobbes::storage::waitForUpdate (volatile uint32_t *p, int eqV)
 
static void hobbes::storage::wakeN (volatile uint32_t *p, int c)
 
template<typename T >
hobbes::storage::align (T x, T m)
 
static void hobbes::storage::uxchg (volatile uint32_t *px, uint32_t nx)
 
void hobbes::storage::mqwrite (int fd, const uint8_t *x, size_t len)
 
int hobbes::storage::mqconnect (const std::string &fileName)
 
int hobbes::storage::mqlisten (const std::string &fileName)
 
std::string hobbes::storage::tempDir ()
 
int hobbes::storage::connectGroupHost (const std::string &groupName)
 
int hobbes::storage::makeGroupHost (const std::string &groupName)
 
ProcThread hobbes::storage::thisProcThread ()
 
std::string hobbes::storage::sharedMemName (const std::string &groupName, const ProcThread &pt)
 
std::string hobbes::storage::sharedMemName (const std::string &groupName)
 
void hobbes::storage::registerSHMAlloc (int *mqserver, const std::string &groupName)
 
QueueConnection hobbes::storage::consumeQueue (const std::string &shmname)
 
QueueConnection hobbes::storage::consumeGroup (const std::string &gname, const ProcThread &pt)
 
template<typename T >
void hobbes::storage::w (const T &x, bytes *out)
 
void hobbes::storage::ws (const char *x, bytes *out)
 
void hobbes::storage::ws (const std::string &x, bytes *out)
 
void hobbes::storage::ws (const bytes &x, bytes *out)
 
void hobbes::storage::encode_primty (const char *tn, bytes *out)
 
 hobbes::storage::_HSTORE_DEFINE_PRIMTYS (bool, "bool")
 
 hobbes::storage::_HSTORE_DEFINE_PRIMTYS (uint8_t, "byte")
 
 hobbes::storage::_HSTORE_DEFINE_PRIMTYS (char, "char")
 
 hobbes::storage::_HSTORE_DEFINE_PRIMTYS (int16_t, "short")
 
 hobbes::storage::_HSTORE_DEFINE_PRIMTYS (uint16_t, "short")
 
 hobbes::storage::_HSTORE_DEFINE_PRIMTYS (int32_t, "int")
 
 hobbes::storage::_HSTORE_DEFINE_PRIMTYS (uint32_t, "int")
 
 hobbes::storage::_HSTORE_DEFINE_PRIMTYS (int64_t, "long")
 
 hobbes::storage::_HSTORE_DEFINE_PRIMTYS (uint64_t, "long")
 
 hobbes::storage::_HSTORE_DEFINE_PRIMTYS (float, "float")
 
 hobbes::storage::_HSTORE_DEFINE_PRIMTYS (double, "double")
 
template<typename ... Ts>
hstore_payload_types< Ts... > hobbes::storage::makePayloadTypes (const Ts &...)
 
template<typename TyList >
void hobbes::storage::makeTyDescF (bytes *e, std::string *d)
 
template<size_t N>
constexpr char hobbes::storage::at (size_t i, const char(&s)[N])
 
template<size_t N>
constexpr size_t hobbes::storage::at8S (size_t i, size_t k, const char(&s)[N])
 
template<size_t N>
constexpr size_t hobbes::storage::at8 (size_t i, const char(&s)[N])
 
template<uint32_t * X>
uint32_t hobbes::storage::forceRegistration ()
 
template<typename GName , typename ... Ts>
bool hobbes::storage::write (StorageGroup< GName, AutoCommit > *g, uint32_t id, const Ts &... xs)
 
template<typename GName , typename ... Ts>
bool hobbes::storage::write (StorageGroup< GName, ManualCommit > *g, uint32_t id, const Ts &... xs)
 
template<size_t N>
static constexpr size_t hobbes::storage::readInt (const char(&fmt)[N], size_t i, size_t e, size_t n)
 
static constexpr size_t hobbes::storage::maxV (size_t x, size_t y)
 
template<size_t N>
static constexpr size_t hobbes::storage::maxVarRefS (const char(&fmt)[N], size_t i, size_t s, size_t vri, size_t maxvr)
 
template<size_t N>
static constexpr size_t hobbes::storage::maxVarRef (const char(&fmt)[N])
 
size_t hobbes::storage::rs (const reader::MetaData &md, size_t o, size_t n, uint8_t *b)
 
template<typename T >
size_t hobbes::storage::r (const reader::MetaData &md, size_t o, T *t)
 
size_t hobbes::storage::rs (const reader::MetaData &md, size_t o, std::string *s)
 
size_t hobbes::storage::rs (const reader::MetaData &md, size_t o, bytes *s)
 
void hobbes::storage::runReadProcess (const QueueConnection &qc, const std::function< std::function< void(Transaction &)>(PipeQOS, CommitMethod, const statements &)> &initF)
 

Macro Definition Documentation

◆ _HSTORE__EOA_

#define _HSTORE__EOA_ ( )    0

◆ _HSTORE__EOAP_

#define _HSTORE__EOAP_ (   ...)    _HSTORE_BOOL(_HSTORE_FIRST(_HSTORE__EOA_ __VA_ARGS__)())

◆ _HSTORE__IF_0

#define _HSTORE__IF_0 (   ...)    _HSTORE__IF_0_ELSE

◆ _HSTORE__IF_0_ELSE

#define _HSTORE__IF_0_ELSE (   ...)    __VA_ARGS__

◆ _HSTORE__IF_1

#define _HSTORE__IF_1 (   ...)    __VA_ARGS__ _HSTORE__IF_1_ELSE

◆ _HSTORE__IF_1_ELSE

#define _HSTORE__IF_1_ELSE (   ...)

◆ _HSTORE__IF_ELSE

#define _HSTORE__IF_ELSE (   condition)    _HSTORE_JOIN(_HSTORE__IF_, condition)

◆ _HSTORE__MAPP

#define _HSTORE__MAPP ( )    _HSTORE_MAPP

◆ _HSTORE__NOT_0

#define _HSTORE__NOT_0   NEGATE, 1

◆ _HSTORE_BOOL

#define _HSTORE_BOOL (   x)    _HSTORE_NOT(_HSTORE_NOT(x))

◆ _HSTORE_DEFER2

#define _HSTORE_DEFER2 (   m)    m _HSTORE_EMPTY _HSTORE_EMPTY()()

◆ _HSTORE_DEFINE_PRIMTYS

#define _HSTORE_DEFINE_PRIMTYS (   T,
 
)
Value:
template <> \
struct store<T> { \
typedef void can_memcpy; \
static void encode(bytes* out) { encode_primty(n, out); } \
static std::string describe() { return n; } \
static size_t size(const T&) { return sizeof(T); } \
static bool write(wpipe& p, const T& x) { return p.write((const uint8_t*)&x, sizeof(x)); } \
}
void encode(const PrimitivePtr &, std::ostream &)
Definition: expr.C:1674
bool write(StorageGroup< GName, ManualCommit > *g, uint32_t id, const Ts &... xs)
Definition: storage.H:1663
std::vector< uint8_t > bytes
Definition: storage.H:77
#define out
Definition: netio.H:19
void encode_primty(const char *tn, bytes *out)
Definition: storage.H:746

◆ _HSTORE_EMPTY

#define _HSTORE_EMPTY ( )

◆ _HSTORE_EVAL

#define _HSTORE_EVAL (   ...)    _HSTORE_EVAL256(__VA_ARGS__)

◆ _HSTORE_EVAL1

#define _HSTORE_EVAL1 (   ...)    __VA_ARGS__

◆ _HSTORE_EVAL128

#define _HSTORE_EVAL128 (   ...)    _HSTORE_EVAL64(_HSTORE_EVAL64(__VA_ARGS__))

◆ _HSTORE_EVAL16

#define _HSTORE_EVAL16 (   ...)    _HSTORE_EVAL8(_HSTORE_EVAL8(__VA_ARGS__))

◆ _HSTORE_EVAL2

#define _HSTORE_EVAL2 (   ...)    _HSTORE_EVAL1(_HSTORE_EVAL1(__VA_ARGS__))

◆ _HSTORE_EVAL256

#define _HSTORE_EVAL256 (   ...)    _HSTORE_EVAL128(_HSTORE_EVAL128(__VA_ARGS__))

◆ _HSTORE_EVAL32

#define _HSTORE_EVAL32 (   ...)    _HSTORE_EVAL16(_HSTORE_EVAL16(__VA_ARGS__))

◆ _HSTORE_EVAL4

#define _HSTORE_EVAL4 (   ...)    _HSTORE_EVAL2(_HSTORE_EVAL2(__VA_ARGS__))

◆ _HSTORE_EVAL64

#define _HSTORE_EVAL64 (   ...)    _HSTORE_EVAL32(_HSTORE_EVAL32(__VA_ARGS__))

◆ _HSTORE_EVAL8

#define _HSTORE_EVAL8 (   ...)    _HSTORE_EVAL4(_HSTORE_EVAL4(__VA_ARGS__))

◆ _HSTORE_FIRST

#define _HSTORE_FIRST (   a,
  ... 
)    a

◆ _HSTORE_HAS_PARGS

#define _HSTORE_HAS_PARGS (   ...)    _HSTORE_BOOL(_HSTORE_FIRST(_HSTORE__EOAP_ __VA_ARGS__)())

◆ _HSTORE_IF_ELSE

#define _HSTORE_IF_ELSE (   condition)    _HSTORE__IF_ELSE(_HSTORE_BOOL(condition))

◆ _HSTORE_IS_NEGATE

#define _HSTORE_IS_NEGATE (   ...)    _HSTORE_SECOND(__VA_ARGS__, 0)

◆ _HSTORE_JOIN

#define _HSTORE_JOIN (   a,
 
)    a ## b

◆ _HSTORE_LIKELY

#define _HSTORE_LIKELY (   x)    __builtin_expect((x),1)

◆ _HSTORE_MAP

#define _HSTORE_MAP (   f,
  VS... 
)    _HSTORE_EVAL(_HSTORE_MAPP(f, VS))

◆ _HSTORE_MAPP

#define _HSTORE_MAPP (   f,
  H,
  T... 
)
Value:
f H \
_HSTORE_DEFER2(_HSTORE__MAPP)()(f, T) \
)( \
)
#define _HSTORE_HAS_PARGS(...)
Definition: storage.H:888
#define _HSTORE_IF_ELSE(condition)
Definition: storage.H:870
#define _HSTORE__MAPP()
Definition: storage.H:898

◆ _HSTORE_NOT

#define _HSTORE_NOT (   x)    _HSTORE_IS_NEGATE(_HSTORE_JOIN(_HSTORE__NOT_, x))

◆ _HSTORE_PAGE_STATE_COMMIT

#define _HSTORE_PAGE_STATE_COMMIT   ((uint8_t)2)

◆ _HSTORE_PAGE_STATE_CONT

#define _HSTORE_PAGE_STATE_CONT   ((uint8_t)1)

◆ _HSTORE_PAGE_STATE_ROLLBACK

#define _HSTORE_PAGE_STATE_ROLLBACK   ((uint8_t)3)

◆ _HSTORE_PAGE_STATE_TENTATIVE

#define _HSTORE_PAGE_STATE_TENTATIVE   ((uint8_t)0)

◆ _HSTORE_SECOND

#define _HSTORE_SECOND (   a,
  b,
  ... 
)    b

◆ _HSTORE_STATE_READER_WAITING

#define _HSTORE_STATE_READER_WAITING   1

◆ _HSTORE_STATE_UNBLOCKED

#define _HSTORE_STATE_UNBLOCKED   0

◆ _HSTORE_STATE_WRITER_WAITING

#define _HSTORE_STATE_WRITER_WAITING   2

◆ _HSTORE_TSTR

#define _HSTORE_TSTR (   s)    ::hobbes::storage::strpack<_HSTORE_TSTR1024(0,s)>

◆ _HSTORE_TSTR1024

#define _HSTORE_TSTR1024 (   i,
 
)    _HSTORE_TSTR512(i+(512*0),s),_HSTORE_TSTR512(i+(512*1),s)

◆ _HSTORE_TSTR128

#define _HSTORE_TSTR128 (   i,
 
)    _HSTORE_TSTR32(i+(32*0),s),_HSTORE_TSTR32(i+(32*1),s),_HSTORE_TSTR32(i+(32*2),s),_HSTORE_TSTR32(i+(32*3),s)

◆ _HSTORE_TSTR32

#define _HSTORE_TSTR32 (   i,
 
)    ::hobbes::storage::at8(i+(8*0),s),::hobbes::storage::at8(i+(8*1),s),::hobbes::storage::at8(i+(8*2),s),::hobbes::storage::at8(i+(8*3),s)

◆ _HSTORE_TSTR512

#define _HSTORE_TSTR512 (   i,
 
)    _HSTORE_TSTR128(i+(128*0),s),_HSTORE_TSTR128(i+(128*1),s),_HSTORE_TSTR128(i+(128*2),s),_HSTORE_TSTR128(i+(128*3),s)

◆ _HSTORE_TYCTOR_ARR

#define _HSTORE_TYCTOR_ARR   ((int)5)

◆ _HSTORE_TYCTOR_FIXEDARR

#define _HSTORE_TYCTOR_FIXEDARR   ((int)4)

◆ _HSTORE_TYCTOR_PRIM

#define _HSTORE_TYCTOR_PRIM   ((int)0)

◆ _HSTORE_TYCTOR_RECURSIVE

#define _HSTORE_TYCTOR_RECURSIVE   ((int)13)

◆ _HSTORE_TYCTOR_SIZE

#define _HSTORE_TYCTOR_SIZE   ((int)11)

◆ _HSTORE_TYCTOR_STRUCT

#define _HSTORE_TYCTOR_STRUCT   ((int)7)

◆ _HSTORE_TYCTOR_TVAR

#define _HSTORE_TYCTOR_TVAR   ((int)2)

◆ _HSTORE_TYCTOR_VARIANT

#define _HSTORE_TYCTOR_VARIANT   ((int)6)

◆ _HSTORE_UNLIKELY

#define _HSTORE_UNLIKELY (   x)    __builtin_expect((x),0)

◆ APPLY_HSTORE_STMT

#define APPLY_HSTORE_STMT (   GROUP,
  NAME,
  FLAGS,
  FMTSTR,
  ARGS... 
)    ::hobbes::storage::write(&GROUP, ({static_assert(::hobbes::storage::maxVarRef(FMTSTR) <= decltype(::hobbes::storage::makePayloadTypes(ARGS))::count, "Log format string and payload arity mismatch"); ::hobbes::storage::StorageStatement<decltype(GROUP),&GROUP,_HSTORE_TSTR(__FILE__),__LINE__,_HSTORE_TSTR(#NAME),FLAGS,_HSTORE_TSTR(FMTSTR),decltype(::hobbes::storage::makePayloadTypes(ARGS))>::id;}), ## ARGS)

◆ DECLARE_STORAGE_GROUP

#define DECLARE_STORAGE_GROUP (   NAME,
  cm 
)    extern ::hobbes::storage::StorageGroup<_HSTORE_TSTR(#NAME),cm> NAME

◆ DEFINE_HSTORE_ENUM

#define DEFINE_HSTORE_ENUM (   T,
  CTORS... 
)
Value:
struct T { \
typedef void is_hstore_enum; \
enum class Enum : uint32_t { \
_HSTORE_MAP(HSTORE_ENUM_CTOR_DEF, CTORS) \
COUNT \
}; \
Enum value; \
T() : value() { } \
T(Enum v) : value(v) { } \
T& operator=(Enum v) { this->value = v; return *this; } \
operator Enum() { return this->value; } \
typedef T SelfT; \
_HSTORE_MAP(HSTORE_ENUM_CTOR_CTOR, CTORS) \
static void encode(::hobbes::storage::bytes* out) { \
_HSTORE_MAP(HSTORE_ENUM_CTOR_ENCODE, CTORS); \
} \
static std::string describe() { \
return (std::string("") _HSTORE_MAP(HSTORE_ENUM_CTOR_STR, CTORS)).substr(1); \
} \
}
void w(const T &x, bytes *out)
Definition: storage.H:729
void encode(const PrimitivePtr &, std::ostream &)
Definition: expr.C:1674
#define HSTORE_ENUM_CTOR_DEF(n)
Definition: storage.H:1003
#define _HSTORE_MAP(f, VS...)
Definition: storage.H:891
std::vector< uint8_t > bytes
Definition: storage.H:77
#define _HSTORE_TYCTOR_VARIANT
Definition: storage.H:720
#define HSTORE_ENUM_CTOR_CTOR(n)
Definition: storage.H:1004
#define HSTORE_ENUM_CTORC_SUCC(n)
Definition: storage.H:1005
#define HSTORE_ENUM_CTOR_STR(n)
Definition: storage.H:1006
#define out
Definition: netio.H:19
#define HSTORE_ENUM_CTOR_ENCODE(n)
Definition: storage.H:1007

◆ DEFINE_HSTORE_STRUCT

#define DEFINE_HSTORE_STRUCT (   T,
  FIELDS... 
)
Value:
struct T { \
_HSTORE_MAP(HSTORE_STRUCT_FIELD, FIELDS) /* struct fields */ \
typedef void is_hstore_struct; /* identify this type as a struct */ \
static void encode(::hobbes::storage::bytes* out) { \
size_t localArity = HSTORE_FIELD_COUNT(FIELDS); \
if (localArity > 0) { \
::hobbes::storage::w(localArity, out); \
_HSTORE_MAP(HSTORE_STRUCT_FIELD_ENC, FIELDS) \
} else { \
} \
} \
static std::string describe() { \
return "{" + ( std::string("") _HSTORE_MAP(HSTORE_STRUCT_FIELD_DESC, FIELDS) ).substr(2) + "}"; \
} \
size_t size() const { \
return HSTORE_FIELD_SIZE(FIELDS); \
} \
bool write(::hobbes::storage::wpipe& p) const { \
return HSTORE_FIELD_WRITES(FIELDS); \
} \
}
Definition: storage.H:415
void w(const T &x, bytes *out)
Definition: storage.H:729
void encode(const PrimitivePtr &, std::ostream &)
Definition: expr.C:1674
#define HSTORE_STRUCT_FIELD_ENC(t, n)
Definition: storage.H:911
bool write(StorageGroup< GName, ManualCommit > *g, uint32_t id, const Ts &... xs)
Definition: storage.H:1663
#define HSTORE_STRUCT_FIELD_DESC(t, n)
Definition: storage.H:912
#define _HSTORE_MAP(f, VS...)
Definition: storage.H:891
std::vector< uint8_t > bytes
Definition: storage.H:77
#define _HSTORE_TYCTOR_STRUCT
Definition: storage.H:721
#define HSTORE_FIELD_COUNT(FIELDS...)
Definition: storage.H:902
#define HSTORE_STRUCT_FIELD(t, n)
Definition: storage.H:910
#define HSTORE_FIELD_SIZE(FIELDS...)
Definition: storage.H:905
#define out
Definition: netio.H:19
#define HSTORE_FIELD_WRITES(FIELDS...)
Definition: storage.H:908
void encode_primty(const char *tn, bytes *out)
Definition: storage.H:746

◆ DEFINE_HSTORE_TYPE_ALIAS

#define DEFINE_HSTORE_TYPE_ALIAS (   _ATY,
  _REPTY 
)
Value:
struct _ATY { \
typedef void is_hstore_alias; \
typedef _REPTY type; \
static const char* name() { return #_ATY; } \
inline operator _REPTY() { return this->value; } \
_REPTY value; \
_ATY() : value() { } \
_ATY(const _REPTY& x) : value(x) { } \
_ATY(const _ATY& x) : value(x.value) { } \
_ATY& operator=(const _ATY& x) { this->value = x.value; return *this; } \
}

◆ DEFINE_HSTORE_VARIANT

◆ DEFINE_HSTORE_VARIANT_GEN

#define DEFINE_HSTORE_VARIANT_GEN (   T,
  VDECL,
  VCTORS,
  VCOPY,
  VDESTROY,
  CTORCOUNT,
  VENCODE,
  VDESC,
  VSIZE,
  VWRITE,
  VVISITCASE,
  VEQCASE,
  CTAGS,
  CDATA 
)

◆ DEFINE_HSTORE_VARIANT_WITH_LABELS

◆ DEFINE_PACKED_HSTORE_STRUCT

#define DEFINE_PACKED_HSTORE_STRUCT (   T,
  FIELDS... 
)
Value:
struct T { \
_HSTORE_MAP(HSTORE_STRUCT_FIELD, FIELDS) /* struct fields */ \
typedef void is_packed_hstore_struct; /* identify this type as a packed struct */ \
static void encode(::hobbes::storage::bytes* out) { \
size_t localArity = HSTORE_FIELD_COUNT(FIELDS); \
if (localArity > 0) { \
::hobbes::storage::w(localArity, out); \
_HSTORE_MAP(HSTORE_STRUCT_FIELD_ENC, FIELDS) \
} else { \
} \
} \
static std::string describe() { \
return "{" + ( std::string("") _HSTORE_MAP(HSTORE_STRUCT_FIELD_DESC, FIELDS) ).substr(2) + "}"; \
} \
} __attribute__((packed))
void w(const T &x, bytes *out)
Definition: storage.H:729
void encode(const PrimitivePtr &, std::ostream &)
Definition: expr.C:1674
#define HSTORE_STRUCT_FIELD_ENC(t, n)
Definition: storage.H:911
#define HSTORE_STRUCT_FIELD_DESC(t, n)
Definition: storage.H:912
#define _HSTORE_MAP(f, VS...)
Definition: storage.H:891
std::vector< uint8_t > bytes
Definition: storage.H:77
#define _HSTORE_TYCTOR_STRUCT
Definition: storage.H:721
#define HSTORE_FIELD_COUNT(FIELDS...)
Definition: storage.H:902
#define HSTORE_STRUCT_FIELD(t, n)
Definition: storage.H:910
#define out
Definition: netio.H:19
void encode_primty(const char *tn, bytes *out)
Definition: storage.H:746

◆ DEFINE_STORAGE_GROUP

#define DEFINE_STORAGE_GROUP (   NAME,
  pagec,
  qos,
  cm 
)    ::hobbes::storage::StorageGroup<_HSTORE_TSTR(#NAME),cm> NAME = { 0, qos, pagec, -1 }

◆ HLOG

#define HLOG (   GROUP,
  NAME,
  FMTSTR,
  ARGS... 
)    APPLY_HSTORE_STMT(GROUP, NAME, 1, FMTSTR, ## ARGS)

◆ HSTORE

#define HSTORE (   GROUP,
  NAME,
  ARGS... 
)    APPLY_HSTORE_STMT(GROUP, NAME, 0, "", ## ARGS)

◆ HSTORE_ENUM_CTOR_CTOR

#define HSTORE_ENUM_CTOR_CTOR (   n)    static const SelfT n() { return SelfT(SelfT::Enum::n); }

◆ HSTORE_ENUM_CTOR_DEF

#define HSTORE_ENUM_CTOR_DEF (   n)    n ,

◆ HSTORE_ENUM_CTOR_ENCODE

#define HSTORE_ENUM_CTOR_ENCODE (   n)
Value:
::hobbes::storage::w((uint32_t)(Enum :: n), out); \
void w(const T &x, bytes *out)
Definition: storage.H:729
void ws(const bytes &x, bytes *out)
Definition: storage.H:741
#define out
Definition: netio.H:19
void encode_primty(const char *tn, bytes *out)
Definition: storage.H:746

◆ HSTORE_ENUM_CTOR_STR

#define HSTORE_ENUM_CTOR_STR (   n)    + "|" #n

◆ HSTORE_ENUM_CTORC_SUCC

#define HSTORE_ENUM_CTORC_SUCC (   n)    +1

◆ HSTORE_FIELD_COUNT

#define HSTORE_FIELD_COUNT (   FIELDS...)    (0 _HSTORE_MAP(HSTORE_FIELDC_SUCC, FIELDS))

◆ HSTORE_FIELD_SIZE

#define HSTORE_FIELD_SIZE (   FIELDS...)    (0 _HSTORE_MAP(HSTORE_FIELDS_SUCC, FIELDS))

◆ HSTORE_FIELD_WRITES

#define HSTORE_FIELD_WRITES (   FIELDS...)    (true _HSTORE_MAP(HSTORE_FIELDW_SUCC, FIELDS))

◆ HSTORE_FIELDC_SUCC

#define HSTORE_FIELDC_SUCC (   t,
 
)    +1

◆ HSTORE_FIELDS_SUCC

#define HSTORE_FIELDS_SUCC (   t,
 
)    +::hobbes::storage::store< t >::size(this-> n)

◆ HSTORE_FIELDW_SUCC

#define HSTORE_FIELDW_SUCC (   t,
 
)    &&::hobbes::storage::store< t >::write(p, this-> n)

◆ HSTORE_STRUCT_FIELD

#define HSTORE_STRUCT_FIELD (   t,
 
)    t n;

◆ HSTORE_STRUCT_FIELD_DESC

#define HSTORE_STRUCT_FIELD_DESC (   t,
 
)    + (", " #n " : " + ::hobbes::storage::store< t >::describe())

◆ HSTORE_STRUCT_FIELD_ENC

#define HSTORE_STRUCT_FIELD_ENC (   t,
 
)    ::hobbes::storage::ws(#n, out); ::hobbes::storage::w((int)-1, out); ::hobbes::storage::store< t >::encode(out);

◆ HSTORE_VARIANT_CTOR

#define HSTORE_VARIANT_CTOR (   n,
 
)    static SelfT n(const t & x) { SelfT r; r.tag = Enum::tag_##n; new (r.data) t(x); return r; }

◆ HSTORE_VARIANT_CTOR_ENCODE

#define HSTORE_VARIANT_CTOR_ENCODE (   n,
 
)
Value:
::hobbes::storage::w((uint32_t)Enum::tag_##n, out); \
void w(const T &x, bytes *out)
Definition: storage.H:729
void encode(const PrimitivePtr &, std::ostream &)
Definition: expr.C:1674
void ws(const bytes &x, bytes *out)
Definition: storage.H:741
#define out
Definition: netio.H:19

◆ HSTORE_VARIANT_CTOR_OPAQUEDATA

#define HSTORE_VARIANT_CTOR_OPAQUEDATA (   n,
 
)    t n##_data;

◆ HSTORE_VARIANT_CTOR_STR

#define HSTORE_VARIANT_CTOR_STR (   n,
 
)    + "," #n ":" + ::hobbes::storage::store< t >::describe()

◆ HSTORE_VARIANT_CTOR_TAG

#define HSTORE_VARIANT_CTOR_TAG (   n,
 
)    tag_##n,

◆ HSTORE_VARIANT_EQCASE

#define HSTORE_VARIANT_EQCASE (   n,
 
)    case Enum::tag_##n: return (this->n##_data == rhs.n##_data);

◆ HSTORE_VARIANT_LBL_CTOR

#define HSTORE_VARIANT_LBL_CTOR (   n,
  lbl,
 
)    static SelfT n(const t & x) { SelfT r; r.tag = Enum::tag_##n; new (r.data) t(x); return r; }

◆ HSTORE_VARIANT_LBL_CTOR_ENCODE

#define HSTORE_VARIANT_LBL_CTOR_ENCODE (   n,
  lbl,
 
)
Value:
::hobbes::storage::w((uint32_t)Enum::tag_##n, out); \
void w(const T &x, bytes *out)
Definition: storage.H:729
void encode(const PrimitivePtr &, std::ostream &)
Definition: expr.C:1674
void ws(const bytes &x, bytes *out)
Definition: storage.H:741
#define out
Definition: netio.H:19

◆ HSTORE_VARIANT_LBL_CTOR_OPAQUEDATA

#define HSTORE_VARIANT_LBL_CTOR_OPAQUEDATA (   n,
  lbl,
 
)    t n##_data;

◆ HSTORE_VARIANT_LBL_CTOR_STR

#define HSTORE_VARIANT_LBL_CTOR_STR (   n,
  lbl,
 
)    + "," #n ":" + ::hobbes::storage::store< t >::describe()

◆ HSTORE_VARIANT_LBL_CTOR_TAG

#define HSTORE_VARIANT_LBL_CTOR_TAG (   n,
  lbl,
 
)    tag_##n,

◆ HSTORE_VARIANT_LBL_EQCASE

#define HSTORE_VARIANT_LBL_EQCASE (   n,
  lbl,
 
)    case Enum::tag_##n: return (this->n##_data == rhs.n##_data);

◆ HSTORE_VARIANT_LBL_PCOPY

#define HSTORE_VARIANT_LBL_PCOPY (   n,
  lbl,
 
)    case Enum::tag_##n: new (this->data) t(rhs.n##_data); break;

◆ HSTORE_VARIANT_LBL_PDESTROY

#define HSTORE_VARIANT_LBL_PDESTROY (   n,
  lbl,
 
)    case Enum::tag_##n: { typedef t __DT; ((__DT*)&this->n##_data)->~__DT(); } break;

◆ HSTORE_VARIANT_LBL_SIZE_CASE

#define HSTORE_VARIANT_LBL_SIZE_CASE (   n,
  lbl,
 
)    case Enum::tag_##n: return sizeof(int) + ::hobbes::storage::store< t >::size(this->n##_data);

◆ HSTORE_VARIANT_LBL_SUCC

#define HSTORE_VARIANT_LBL_SUCC (   n,
  lbl,
 
)    +1

◆ HSTORE_VARIANT_LBL_VCASE

#define HSTORE_VARIANT_LBL_VCASE (   n,
  lbl,
 
)    case Enum::tag_##n: return v. n (this->n##_data);

◆ HSTORE_VARIANT_LBL_VDECL

#define HSTORE_VARIANT_LBL_VDECL (   n,
  lbl,
 
)    virtual R n(const t & x) const = 0;

◆ HSTORE_VARIANT_LBL_WRITE_CASE

#define HSTORE_VARIANT_LBL_WRITE_CASE (   n,
  lbl,
 
)    case Enum::tag_##n: return ::hobbes::storage::store<int>::write(p, (int)this->tag) && ::hobbes::storage::store< t >::write(p, this->n##_data);

◆ HSTORE_VARIANT_PCOPY

#define HSTORE_VARIANT_PCOPY (   n,
 
)    case Enum::tag_##n: new (this->data) t(rhs.n##_data); break;

◆ HSTORE_VARIANT_PDESTROY

#define HSTORE_VARIANT_PDESTROY (   n,
 
)    case Enum::tag_##n: { typedef t __DT; ((__DT*)&this->n##_data)->~__DT(); } break;

◆ HSTORE_VARIANT_SIZE_CASE

#define HSTORE_VARIANT_SIZE_CASE (   n,
 
)    case Enum::tag_##n: return sizeof(int) + ::hobbes::storage::store< t >::size(this->n##_data);

◆ HSTORE_VARIANT_SUCC

#define HSTORE_VARIANT_SUCC (   n,
 
)    +1

◆ HSTORE_VARIANT_VCASE

#define HSTORE_VARIANT_VCASE (   n,
 
)    case Enum::tag_##n: return v. n (this->n##_data);

◆ HSTORE_VARIANT_VDECL

#define HSTORE_VARIANT_VDECL (   n,
 
)    virtual R n(const t & x) const = 0;

◆ HSTORE_VARIANT_WRITE_CASE

#define HSTORE_VARIANT_WRITE_CASE (   n,
 
)    case Enum::tag_##n: return ::hobbes::storage::store<int>::write(p, (int)this->tag) && ::hobbes::storage::store< t >::write(p, this->n##_data);

◆ HSTORE_VERSION

#define HSTORE_VERSION   ((uint32_t)0x00010000)

◆ xchg

#define xchg   __sync_lock_test_and_set