diff --git a/typelesscpp/scripting_functions.hpp b/typelesscpp/scripting_functions.hpp index 1c9e3785..f0463269 100644 --- a/typelesscpp/scripting_functions.hpp +++ b/typelesscpp/scripting_functions.hpp @@ -3,13 +3,35 @@ #include "scripting_object.hpp" - +#include "scripting_type_info.hpp" #include #include #include #include #include +template +std::vector build_param_type_list(const boost::function &f) +{ + return std::vector(); +} + +template +std::vector build_param_type_list(const boost::function &f) +{ + std::vector ti; + ti.push_back(Get_Type_Info()()); + return ti; +} + +template +std::vector build_param_type_list(const boost::function &f) +{ + std::vector ti; + ti.push_back(Get_Type_Info()()); + ti.push_back(Get_Type_Info()()); + return ti; +} // handle_return implementations template @@ -83,6 +105,8 @@ class Function_Handler { public: virtual Scripting_Object operator()(const std::vector ¶ms) = 0; + virtual std::vector get_param_types() = 0; + }; template @@ -99,6 +123,11 @@ class Function_Handler_Impl : public Function_Handler return call_func(m_f, params); } + virtual std::vector get_param_types() + { + return build_param_type_list(m_f); + } + private: Func m_f; }; @@ -125,7 +154,5 @@ std::vector build_param_list(const Scripting_Object &so1, con return sos; } - - #endif