- LoaderFunc0(FuncType f): func(f) { }
- void execute(Loader &l, const Statement &st) const
- {
- if(st.args.size()!=0) throw TypeError(st.get_location()+": Wrong number of arguments");
- (dynamic_cast<L &>(l).*func)();
- };
-private:
- FuncType func;
-};
-
-
-/**
-Loads a statement by calling a function that takes one argument.
-*/
-template<typename L, typename A0>
-class LoaderFunc1: public LoaderAction
-{
-public:
- typedef void (L::*FuncType)(A0);
-
- LoaderFunc1(FuncType f): func(f) { }
- void execute(Loader &l, const Statement &st) const
- {
- if(st.args.size()!=1) throw TypeError(st.get_location()+": Wrong number of arguments");
- (dynamic_cast<L &>(l).*func)(st.args[0].get<A0>());
- }
-private:
- FuncType func;
-};