Provide some cleaner examples and some additional bootstrapped functions

This commit is contained in:
Jason Turner
2009-05-27 13:30:17 +00:00
parent 6538008172
commit fbb9534601
3 changed files with 72 additions and 10 deletions

View File

@@ -103,6 +103,28 @@ class Proxy_Function
};
class Dynamic_Proxy_Function : public Proxy_Function
{
public:
Dynamic_Proxy_Function(const boost::function<Boxed_Value (const std::vector<Boxed_Value> &)> &t_f)
: m_f(t_f)
{
}
virtual Boxed_Value operator()(const std::vector<Boxed_Value> &params)
{
return m_f(params);
}
virtual std::vector<Type_Info> get_param_types()
{
return build_param_type_list(m_f);
}
private:
boost::function<Boxed_Value (const std::vector<Boxed_Value> &)> m_f;
};
template<typename Func>
class Proxy_Function_Impl : public Proxy_Function
{