ManagedClass &ManagedClass::registerField(const std::string &name, ValueType ClassType::*member) { std::function<ValueType &(ClassType *)> getRef = std::mem_fn(member); this->registerMethod("get:"+name, Callable(&Detail::getField<ClassType, ValueType>).bind(getRef, 1)); this->registerMethod("set:"+name, Callable(&Detail::setField<ClassType, ValueType>).bind(getRef, 1)); return *this; }
ManagedClass &ManagedClass::registerClass(void) { if (not getReferenceToWrapper() or not getPointerToWrapper() or not getSharedToWrapper()) { registerReferenceToWrapper(Callable(&Detail::referenceToWrapper<ClassType>)); registerPointerToWrapper(Callable(&Detail::pointerToWrapper<ClassType>)); registerSharedToWrapper(Callable(&Detail::sharedToWrapper<ClassType>)); registerMethod("delete", Callable(&Detail::deleteValue<ClassType>)); } return *this; }
auto invoke_and_store_exception(callable&& Callable, fallback&& Fallback) { try { return Callable(); } CATCH_AND_SAVE_EXCEPTION_TO(GlobalExceptionPtr()) return Fallback(); }
LLEventDispatcher::Callable LLEventDispatcher::get(const std::string& name) const { DispatchMap::const_iterator found = mDispatch.find(name); if (found == mDispatch.end()) { return Callable(); } return found->second.mFunc; }
ManagedClass &ManagedClass::registerBaseClass(void) { return this->registerToBaseClass(Callable(&Detail::convertToBase<ClassType, BaseClassType>)); }
ManagedClass &ManagedClass::registerMethod(const std::string &name, ReturnType(ClassType::*method)(ArgsType...) const) { this->registerClass<ClassType>(); this->registerMethod(name, Callable(method)); return *this; }
ManagedClass &ManagedClass::registerStaticMethod(const std::string &name, ReturnType(*method)(ArgsType...)) { this->registerStaticMethod(name, Callable(method)); return *this; }
ManagedClass &ManagedClass::registerMethod(const std::string &name, ReturnType(ClassType::*method)(A0, A1, A2, A3, A4, A5, A6, A7, A8) const) { this->registerClass<ClassType>(); this->registerMethod(name, Callable(method)); return *this; }
ManagedClass &ManagedClass::registerStaticMethod(const std::string &name, ReturnType(*method)(A0, A1, A2, A3, A4, A5, A6, A7, A8)) { this->registerStaticMethod(name, Callable(method)); return *this; }