hobbes
a language, embedded compiler, and runtime for efficient dynamic expression evaluation, data storage and analysis
Classes | Namespaces | Macros | Functions | Variables
tylift.H File Reference
#include <hobbes/lang/type.H>
#include <hobbes/util/array.H>
#include <hobbes/util/ptr.H>
#include <hobbes/util/str.H>
#include <hobbes/util/variant.H>
#include <hobbes/util/preprocessor.H>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <stdexcept>
Include dependency graph for tylift.H:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  hobbes::typedb
 
struct  hobbes::nulltypedb
 
struct  hobbes::typeAlias< TN, T >
 
struct  hobbes::recursive< T >
 
struct  hobbes::recursion
 
struct  hobbes::array< T >
 
struct  hobbes::seq< T >
 
struct  hobbes::lift< T, InStruct, P >
 
struct  hobbes::opaquePtrLift< T, InStruct >
 
struct  hobbes::opaquePtrLift< T, true >
 
struct  hobbes::opaquePtrLift< T, false >
 
struct  hobbes::defaultLift< T, InStruct >
 
struct  hobbes::defaultLift< const T *, InStruct >
 
struct  hobbes::defaultLift< const T &, InStruct >
 
struct  hobbes::defaultLift< T &, InStruct >
 
struct  hobbes::defaultLift< T *, InStruct >
 
struct  hobbes::lift< T, InStruct, P >
 
struct  hobbes::lift< std::string, true >
 
struct  hobbes::lift< std::string *, InStruct >
 
struct  hobbes::liftSeq< T >
 
struct  hobbes::lift< seq< T > *, InStruct >
 
struct  hobbes::liftRecursive< T >
 
struct  hobbes::lift< recursive< T > *, InStruct >
 
struct  hobbes::lift< recursion, InStruct >
 
struct  hobbes::liftPair< F, S >
 
struct  hobbes::lift< std::pair< F, S >, true >
 
struct  hobbes::lift< std::pair< F, S > *, false >
 
struct  hobbes::liftVarArray< T >
 
struct  hobbes::lift< array< T > *, InStruct >
 
struct  hobbes::lift< typeAlias< TN, T >, InStruct >
 
struct  hobbes::lift< typeAlias< TN, T > *, InStruct >
 
struct  hobbes::liftFixedArray< T, N >
 
struct  hobbes::lift< T(&)[N], InStruct >
 
struct  hobbes::lift< const T(&)[N], InStruct >
 
struct  hobbes::lift< T(*)[N], InStruct >
 
struct  hobbes::lift< const T(*)[N], InStruct >
 
struct  hobbes::lift< T[N], InStruct >
 
struct  hobbes::lift< const T[N], InStruct >
 
struct  hobbes::typeSeq< Ts >
 
struct  hobbes::typeSeq< T, Ts... >
 
struct  hobbes::liftFunction< F >
 
struct  hobbes::liftFunction< R(Args...)>
 
struct  hobbes::lift< R(Args...), true >
 
struct  hobbes::lift< R(Args...), false >
 
struct  hobbes::lift< R(*)(Args...), true >
 
struct  hobbes::lift< R(*)(Args...), false >
 
struct  hobbes::label< TN, T >
 
struct  hobbes::liftVarCtor< T, P >
 
struct  hobbes::liftVarCtor< label< TN, T > >
 
struct  hobbes::liftVarCtors< CTys >
 
struct  hobbes::liftVarCtors< CTy, CTys... >
 
struct  hobbes::liftVariant< T >
 
struct  hobbes::liftVariant< variant< CTys... > >
 
struct  hobbes::lift< variant< CTys... >, true >
 
struct  hobbes::lift< variant< CTys... > *, false >
 
struct  hobbes::liftEnum< T >
 
struct  hobbes::lift< T, true, typename T::is_hobbes_enum >
 
struct  hobbes::lift< T *, false, typename T::is_hobbes_enum >
 
struct  hobbes::liftStruct< T >
 
struct  hobbes::lift< T, true, typename T::is_hobbes_struct >
 
struct  hobbes::lift< T *, false, typename T::is_hobbes_struct >
 
struct  hobbes::liftValue< T >
 

Namespaces

 hobbes
 

Macros

#define HOBBES_LIFT_PRIMITIVE(T, n)
 
#define HOBBES_ENUM_CTOR(n, v)   n = v,
 
#define HOBBES_ENUM_METAENT(n, v)   r.push_back(MetaEnt(#n, v));
 
#define DEFINE_ENUM(T, CTORS...)
 
#define HOBBES_STRUCT_FIELD(t, n)   t n;
 
#define HOBBES_META_FIELD(t, n)   r.push_back(::hobbes::Record::Member(#n, ::hobbes::lift<t, true>::type(tenv), offsetof(SelfT, n)));
 
#define DEFINE_STRUCT(T, FIELDS...)
 

Functions

template<typename T >
const T * hobbes::begin (const array< T > *d)
 
template<typename T >
const T * hobbes::end (const array< T > *d)
 
template<typename T >
T * hobbes::begin (array< T > *d)
 
template<typename T >
T * hobbes::end (array< T > *d)
 
template<typename T >
const T * hobbes::begin (const array< T > &d)
 
template<typename T >
const T * hobbes::end (const array< T > &d)
 
template<typename T >
T * hobbes::begin (array< T > &d)
 
template<typename T >
T * hobbes::end (array< T > &d)
 
 hobbes::HOBBES_LIFT_PRIMITIVE (void, unit)
 
 hobbes::HOBBES_LIFT_PRIMITIVE (unit, unit)
 
 hobbes::HOBBES_LIFT_PRIMITIVE (bool, bool)
 
 hobbes::HOBBES_LIFT_PRIMITIVE (char, char)
 
 hobbes::HOBBES_LIFT_PRIMITIVE (unsigned char, byte)
 
 hobbes::HOBBES_LIFT_PRIMITIVE (short, short)
 
 hobbes::HOBBES_LIFT_PRIMITIVE (unsigned short, short)
 
 hobbes::HOBBES_LIFT_PRIMITIVE (int, int)
 
 hobbes::HOBBES_LIFT_PRIMITIVE (unsigned int, int)
 
 hobbes::HOBBES_LIFT_PRIMITIVE (long, long)
 
 hobbes::HOBBES_LIFT_PRIMITIVE (unsigned long, long)
 
 hobbes::HOBBES_LIFT_PRIMITIVE (float, float)
 
 hobbes::HOBBES_LIFT_PRIMITIVE (double, double)
 
template<typename T >
MonoTypePtr hobbes::prim ()
 

Variables

nulltypedb hobbes::nulltdb
 

Macro Definition Documentation

◆ DEFINE_ENUM

#define DEFINE_ENUM (   T,
  CTORS... 
)
Value:
struct T { \
enum Enum : unsigned int { \
_HOBPP_MAP(HOBBES_ENUM_CTOR, CTORS) \
}; \
explicit operator bool() const = delete; \
\
typedef void is_hobbes_enum; \
typedef std::pair<std::string, unsigned int> MetaEnt; \
typedef std::vector<MetaEnt> MetaSeq; \
\
static MetaSeq meta() { \
MetaSeq r; \
_HOBPP_MAP(HOBBES_ENUM_METAENT, CTORS) \
return r; \
} \
\
Enum value; \
operator Enum() const { \
return this->value; \
} \
T& operator=(Enum x) { \
this->value = x; \
return *this; \
} \
T() : value(Enum()) { } \
T(const T& x) : value(x.value) { } \
T(Enum x) : value(x) { } \
}
#define HOBBES_ENUM_METAENT(n, v)
Definition: tylift.H:369
#define HOBBES_ENUM_CTOR(n, v)
Definition: tylift.H:368
size_t r(const reader::MetaData &md, size_t o, T *t)
Definition: storage.H:1730

◆ DEFINE_STRUCT

#define DEFINE_STRUCT (   T,
  FIELDS... 
)
Value:
struct T { \
_HOBPP_MAP(HOBBES_STRUCT_FIELD, FIELDS) \
\
typedef void is_hobbes_struct; \
typedef T SelfT; \
_HOBPP_MAP(HOBBES_META_FIELD, FIELDS) \
} \
}
Definition: tylift.H:22
T * make(const Args &... args)
Definition: hobbes.H:60
MonoType::ptr MonoTypePtr
Definition: type.H:71
size_t r(const reader::MetaData &md, size_t o, T *t)
Definition: storage.H:1730
std::vector< Member > Members
Definition: type.H:435
#define HOBBES_META_FIELD(t, n)
Definition: tylift.H:423
#define HOBBES_STRUCT_FIELD(t, n)
Definition: tylift.H:422

◆ HOBBES_ENUM_CTOR

#define HOBBES_ENUM_CTOR (   n,
 
)    n = v,

◆ HOBBES_ENUM_METAENT

#define HOBBES_ENUM_METAENT (   n,
 
)    r.push_back(MetaEnt(#n, v));

◆ HOBBES_LIFT_PRIMITIVE

#define HOBBES_LIFT_PRIMITIVE (   T,
 
)
Value:
template <bool InStruct> \
struct lift<T, InStruct> { \
static MonoTypePtr type(typedb&) { \
return Prim::make(#n); \
} \
}
T * make(const Args &... args)
Definition: hobbes.H:60
MonoType::ptr MonoTypePtr
Definition: type.H:71

◆ HOBBES_META_FIELD

#define HOBBES_META_FIELD (   t,
 
)    r.push_back(::hobbes::Record::Member(#n, ::hobbes::lift<t, true>::type(tenv), offsetof(SelfT, n)));

◆ HOBBES_STRUCT_FIELD

#define HOBBES_STRUCT_FIELD (   t,
 
)    t n;