Esempio n. 1
0
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;
}
Esempio n. 2
0
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;
}
Esempio n. 3
0
	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;
}
Esempio n. 5
0
ManagedClass &ManagedClass::registerBaseClass(void)
{
    return this->registerToBaseClass(Callable(&Detail::convertToBase<ClassType, BaseClassType>));
}
Esempio n. 6
0
ManagedClass &ManagedClass::registerMethod(const std::string &name, ReturnType(ClassType::*method)(ArgsType...) const)
{
    this->registerClass<ClassType>();
    this->registerMethod(name, Callable(method));
    return *this;
}
Esempio n. 7
0
ManagedClass &ManagedClass::registerStaticMethod(const std::string &name, ReturnType(*method)(ArgsType...))
{
    this->registerStaticMethod(name, Callable(method));
    return *this;
}
Esempio n. 8
0
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;
}
Esempio n. 9
0
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;
}