Eradicate global base_class registrations to prevent problems with threading and general memory management issues with knowing how and when to clean them up.
This commit is contained in:
@@ -32,10 +32,10 @@ namespace chaiscript
|
||||
*/
|
||||
template<typename FunctionType>
|
||||
boost::function<FunctionType>
|
||||
functor(const std::vector<Const_Proxy_Function> &funcs)
|
||||
functor(const std::vector<Const_Proxy_Function> &funcs, const Dynamic_Cast_Conversions &t_conversions)
|
||||
{
|
||||
FunctionType *p=0;
|
||||
return detail::build_function_caller_helper(p, funcs);
|
||||
return detail::build_function_caller_helper(p, funcs, t_conversions);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -53,11 +53,11 @@ namespace chaiscript
|
||||
*/
|
||||
template<typename FunctionType>
|
||||
boost::function<FunctionType>
|
||||
functor(Const_Proxy_Function func)
|
||||
functor(Const_Proxy_Function func, const Dynamic_Cast_Conversions &t_conversions)
|
||||
{
|
||||
std::vector<Const_Proxy_Function> funcs;
|
||||
funcs.push_back(func);
|
||||
return functor<FunctionType>(funcs);
|
||||
return functor<FunctionType>(funcs, t_conversions);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -66,9 +66,9 @@ namespace chaiscript
|
||||
*/
|
||||
template<typename FunctionType>
|
||||
boost::function<FunctionType>
|
||||
functor(const Boxed_Value &bv)
|
||||
functor(const Boxed_Value &bv, const Dynamic_Cast_Conversions &t_conversions)
|
||||
{
|
||||
return functor<FunctionType>(boxed_cast<Const_Proxy_Function >(bv));
|
||||
return functor<FunctionType>(boxed_cast<Const_Proxy_Function >(bv, t_conversions), t_conversions);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,13 +81,13 @@ namespace chaiscript
|
||||
{
|
||||
typedef boost::function<Signature> Result_Type;
|
||||
|
||||
static Result_Type cast(const Boxed_Value &ob)
|
||||
static Result_Type cast(const Boxed_Value &ob, const Dynamic_Cast_Conversions &t_conversions)
|
||||
{
|
||||
if (ob.get_type_info().bare_equal(user_type<Const_Proxy_Function>()))
|
||||
{
|
||||
return dispatch::functor<Signature>(ob);
|
||||
return dispatch::functor<Signature>(ob, t_conversions);
|
||||
} else {
|
||||
return Cast_Helper_Inner<const boost::function<Signature> &>::cast(ob);
|
||||
return Cast_Helper_Inner<const boost::function<Signature> &>::cast(ob, t_conversions);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -100,13 +100,13 @@ namespace chaiscript
|
||||
{
|
||||
typedef boost::function<Signature> Result_Type;
|
||||
|
||||
static Result_Type cast(const Boxed_Value &ob)
|
||||
static Result_Type cast(const Boxed_Value &ob, const Dynamic_Cast_Conversions &t_conversions)
|
||||
{
|
||||
if (ob.get_type_info().bare_equal(user_type<Const_Proxy_Function>()))
|
||||
{
|
||||
return dispatch::functor<Signature>(ob);
|
||||
return dispatch::functor<Signature>(ob, t_conversions);
|
||||
} else {
|
||||
return Cast_Helper_Inner<boost::function<Signature> >::cast(ob);
|
||||
return Cast_Helper_Inner<boost::function<Signature> >::cast(ob, t_conversions);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -119,13 +119,13 @@ namespace chaiscript
|
||||
{
|
||||
typedef boost::function<Signature> Result_Type;
|
||||
|
||||
static Result_Type cast(const Boxed_Value &ob)
|
||||
static Result_Type cast(const Boxed_Value &ob, const Dynamic_Cast_Conversions &t_conversions)
|
||||
{
|
||||
if (ob.get_type_info().bare_equal(user_type<Const_Proxy_Function>()))
|
||||
{
|
||||
return dispatch::functor<Signature>(ob);
|
||||
return dispatch::functor<Signature>(ob, t_conversions);
|
||||
} else {
|
||||
return Cast_Helper_Inner<const boost::function<Signature> >::cast(ob);
|
||||
return Cast_Helper_Inner<const boost::function<Signature> >::cast(ob, t_conversions);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user