-template<typename L, typename A0, typename A1>
-class LoaderFunc2: public LoaderAction
-{
-public:
- typedef void (L::*FuncType)(A0, A1);
-
- LoaderFunc2(FuncType f): func(f) { }
- void execute(Loader &l, const Statement &st) const
- {
- if(st.args.size()!=2) throw TypeError(st.get_location()+": Wrong number of arguments");
- (dynamic_cast<L &>(l).*func)(st.args[0].get<A0>(), st.args[1].get<A1>());
- }
-private:
- FuncType func;
-};
-
-
-template<typename L, typename A0, typename A1, typename A2>
-class LoaderFunc3: public LoaderAction
-{
-public:
- typedef void (L::*FuncType)(A0, A1, A2);
-
- LoaderFunc3(FuncType f): func(f) { }
- void execute(Loader &l, const Statement &st) const
- {
- if(st.args.size()!=3) throw TypeError(st.get_location()+": Wrong number of arguments");
- (dynamic_cast<L &>(l).*func)(st.args[0].get<A0>(), st.args[1].get<A1>(), st.args[2].get<A2>());
- }
-private:
- FuncType func;
-};