]> git.tdb.fi Git - libs/datafile.git/blobdiff - source/loaderaction.h
Move mspdatatool source to its own directory
[libs/datafile.git] / source / loaderaction.h
index 2a2a8fc0ef61dfb41624a3451ba8f4606219bf1a..ff478ec2df7aa8ed651914922516781e3f519278 100644 (file)
@@ -95,6 +95,25 @@ private:
 };
 
 
+/**
+Loads a statement by calling a function with the statement itself as argument.
+*/
+template<typename L>
+class LoaderFunc1<L, const Statement &>: public LoaderAction
+{
+public:
+       typedef void (L::*FuncType)(const Statement &);
+
+       LoaderFunc1(FuncType f): func(f) { }
+       void execute(Loader &l, const Statement &st) const
+       {
+               (dynamic_cast<L &>(l).*func)(st);
+       }
+private:
+       FuncType func;
+};
+
+
 template<typename L, typename A0, typename A1>
 class LoaderFunc2: public LoaderAction
 {