22 std::reference_wrapper<T> referenceToWrapper(T &v)
28 std::reference_wrapper<T> pointerToWrapper(T *v)
34 std::reference_wrapper<T> sharedToWrapper(std::shared_ptr<T> &v)
39 template <
typename T,
typename Base>
40 std::reference_wrapper<Base> convertToBase(T &v)
42 return std::ref<Base>(v);
46 void deleteValue(T &v)
51 template <
typename ClassType,
typename ValueType>
52 static const ValueType &getField(ClassType &i,
const std::function<ValueType &(ClassType *)> &getRef)
57 template <
typename ClassType,
typename ValueType>
58 static void setField(ClassType &i,
const std::function<ValueType &(ClassType *)> &getRef,
const ValueType &v)
65 template <
typename ClassType>
73 registerMethod(
"delete", Callable(&Detail::deleteValue<ClassType>));
78 template <
typename ClassType,
typename BaseClassType>
81 return this->
registerToBaseClass(Callable(&Detail::convertToBase<ClassType, BaseClassType>));
84 template <
typename ClassType,
typename ValueType>
87 std::function<ValueType &(ClassType *)> getRef = std::mem_fn(member);
88 this->
registerMethod(
"get:"+name, Callable(&Detail::getField<ClassType, ValueType>).bind(getRef, 1));
89 this->
registerMethod(
"set:"+name, Callable(&Detail::setField<ClassType, ValueType>).bind(getRef, 1));
93 #for $NARGS in range($MAX_ARGS)
94 template <
typename ClassType, $expand('
typename A%d', $NARGS)>
97 this->registerClass<ClassType>();
104 template <$expand('
typename A%d', $NARGS),
typename ReturnType>
111 template <$expand('
typename A%d', $NARGS),
typename ReturnType,
typename ClassType>
114 this->registerClass<ClassType>();
119 template <$expand('
typename A%d', $NARGS),
typename ReturnType,
typename ClassType>
122 this->registerClass<ClassType>();
129 template <
typename ClassType>
132 this->registerClass<ClassType>();
ManagedClass & registerOpaqueConstructor(void)
Definition: ClassImpl.hpp:425
ManagedClass & registerPointerToWrapper(const Callable &toPointer)
const Callable & getReferenceToWrapper(void) const
Definition: Callable.tmpl.hpp:30
static Callable factoryShared(void)
Definition: CallableImpl.hpp:1006
ManagedClass & registerToBaseClass(const Callable &toBase)
ManagedClass & registerMethod(const std::string &name, ReturnType(ClassType::*method)())
Definition: ClassImpl.hpp:111
ManagedClass & registerReferenceToWrapper(const Callable &toPointer)
ManagedClass & registerBaseClass(void)
Definition: ClassImpl.hpp:79
ManagedClass & registerClass(void)
Definition: ClassImpl.hpp:66
static Callable factoryNew(void)
Definition: CallableImpl.hpp:1000
const Callable & getPointerToWrapper(void) const
ManagedClass & registerField(const std::string &name, ValueType ClassType::*member)
Definition: ClassImpl.hpp:85
static Callable factory(void)
Definition: CallableImpl.hpp:994
ManagedClass & registerStaticMethod(const std::string &name, ReturnType(*method)())
Definition: ClassImpl.hpp:104
const Callable & getSharedToWrapper(void) const
ManagedClass & registerSharedToWrapper(const Callable &toPointer)
ManagedClass & registerConstructor(void)
Definition: ClassImpl.hpp:94