Add code for dumping all registered types / functions

This commit is contained in:
Jason Turner
2009-05-27 03:27:38 +00:00
parent a8ba63277e
commit ee46b63f95
4 changed files with 135 additions and 24 deletions

View File

@@ -67,7 +67,6 @@ Boxed_Value call_func(const boost::function<Ret ()> &f, const std::vector<Boxed_
}
}
struct Param_List_Builder
{
Param_List_Builder &operator<<(const Boxed_Value &so)
@@ -89,7 +88,6 @@ struct Param_List_Builder
}
std::vector<Boxed_Value> objects;
};
@@ -128,7 +126,22 @@ class Proxy_Function_Impl : public Proxy_Function
Func m_f;
};
Boxed_Value dispatch(const std::vector<std::pair<const std::string, boost::shared_ptr<Proxy_Function> > > &funcs,
const std::vector<Boxed_Value> &plist)
{
for (std::vector<std::pair<const std::string, boost::shared_ptr<Proxy_Function> > >::const_iterator itr = funcs.begin();
itr != funcs.end();
++itr)
{
try {
return (*itr->second)(plist);
} catch (const std::bad_cast &) {
//try again
}
}
throw std::runtime_error("No mathcing function to dispatch to");
}
# endif
#else