FuncPtr func;
public:
- TypedFunction(FuncPtr f, const std::string & d):
+ TypedFunction(FuncPtr f, const std::string &d):
Function(d),
func(f)
{ }
}
};
+template<typename T, typename A>
+class TypedFunction1: public Function
+{
+private:
+ typedef void (T::*FuncPtr)(A);
+
+ FuncPtr func;
+ A arg;
+
+public:
+ TypedFunction1(FuncPtr f, const A &a, const std::string &d):
+ Function(d),
+ func(f),
+ arg(a)
+ { }
+
+ virtual void run(Test &t) const
+ {
+ (dynamic_cast<T &>(t).*func)(arg);
+ }
+};
+
} // namespace Test
} // namespace Msp