Simple example of adding and dispatching a function variable
This commit is contained in:
parent
600899ad77
commit
72dc27f2da
@ -79,6 +79,10 @@ Boxed_Value dynamic_function(BoxedCPP_System &ss, const std::string &name,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void test(const std::string &p)
|
||||||
|
{
|
||||||
|
std::cout << "Test: " << p << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
//Test main
|
//Test main
|
||||||
int main()
|
int main()
|
||||||
@ -175,5 +179,9 @@ int main()
|
|||||||
<< std::endl;
|
<< std::endl;
|
||||||
|
|
||||||
|
|
||||||
|
ss.set_object("myfunc", boost::shared_ptr<Proxy_Function>(new Proxy_Function_Impl<boost::function<void (const std::string &)> >(&test)));
|
||||||
|
|
||||||
|
dispatch(ss.get_function("myfunc"), Param_List_Builder() << std::string("hello function variable"));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user