X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Floaderaction.h;fp=source%2Floaderaction.h;h=ff478ec2df7aa8ed651914922516781e3f519278;hb=db9c49893c2a9475cb5efa4a53bc481a5f66231f;hp=2a2a8fc0ef61dfb41624a3451ba8f4606219bf1a;hpb=11ed2b907c9b031b57c3d4fc5491fdc3460303c9;p=libs%2Fdatafile.git diff --git a/source/loaderaction.h b/source/loaderaction.h index 2a2a8fc..ff478ec 100644 --- a/source/loaderaction.h +++ b/source/loaderaction.h @@ -95,6 +95,25 @@ private: }; +/** +Loads a statement by calling a function with the statement itself as argument. +*/ +template +class LoaderFunc1: 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).*func)(st); + } +private: + FuncType func; +}; + + template class LoaderFunc2: public LoaderAction {