Geometrize  1.0
An application for geometrizing images into geometric primitives
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros
bindingshelpers.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "chaiscript/chaiscript.hpp"
4 
5 #define COMMA ,
6 
7 #define ADD_CONST_VAR(Class, Name) try { module->add(chaiscript::const_var(&Class::Name), #Name); } catch(...) { assert(0 && #Name); }
8 #define ADD_FREE_FUN(Name) try { module->add(chaiscript::fun(&Name), #Name); } catch(...) { assert(0 && #Name); }
9 #define ADD_FREE_FUN_TEMPLATE(Name, Params) try { module->add(chaiscript::fun(&Name<Params>), #Name); } catch(...) { assert(0 && #Name); }
10 #define ADD_MEMBER(Class, Name) try { module->add(chaiscript::fun(&Class::Name), #Name); } catch(...) { assert(0 && #Name); }
11 #define ADD_CONST_REF_MEMBER(Class, Name) try { module->add(chaiscript::fun([](const Class &r) -> decltype(auto) { return (r.Name); }), #Name); } catch(...) { assert(0 && #Name); }
12 #define ADD_TYPE(Class) try { module->add(chaiscript::user_type<Class>(), #Class); } catch(...) { assert(0 && #Class); }
13 #define ADD_BASE_CLASS(Base, Derived) try { module->add(chaiscript::base_class<Base, Derived>()); } catch (...) { assert(0 && #Base); }
14 #define ADD_CONSTRUCTOR(Class, Signature) try { module->add(chaiscript::constructor<Signature>(), #Class); } catch(...) { assert(0 && #Signature); }
15 #define ADD_GLOBAL_CONST(Name, Value) try { module->add_global_const(chaiscript::const_var(Value), Name); } catch (...) { assert(0 && Name); }