X-Git-Url: http://git.tdb.fi/?p=libs%2Fdatafile.git;a=blobdiff_plain;f=source%2Floaderaction.h;h=c7c593829a1b24a3ccd161dad400f14b06d207e8;hp=a3b04437d279e3e6835bd20538d2c99311721064;hb=9c95942d24a92abea14bb9e11d33daae2d017321;hpb=e3f3e62c6320f4120f1f7d3c4b2d45d19283cc93 diff --git a/source/loaderaction.h b/source/loaderaction.h index a3b0443..c7c5938 100644 --- a/source/loaderaction.h +++ b/source/loaderaction.h @@ -8,7 +8,6 @@ namespace Msp { namespace DataFile { -#if __cplusplus>=201103L template std::string create_signature(const std::string &prefix = std::string()) { return prefix+std::string(1, TypeInfo::signature); } @@ -16,7 +15,6 @@ std::string create_signature(const std::string &prefix = std::string()) template std::string create_signature(const std::string &prefix = std::string()) { return create_signature(prefix+std::string(1, TypeInfo::signature)); } -#endif class Loader; @@ -169,137 +167,6 @@ public: }; -template -class LoaderFunc2: public LoaderAction -{ -private: - typedef void (L::*FuncType)(A0, A1); - - FuncType func; - -public: - LoaderFunc2(FuncType f): func(f) { } - - virtual void execute(Loader &l, const Statement &st) const - { - (dynamic_cast(l).*func)(st.args[0].get(), st.args[1].get()); - } - - virtual void execute(Loader &l, const ArgumentStore &as) const - { - (dynamic_cast(l).*func)(as.get(0), as.get(1)); - } - - virtual std::string get_signature() const - { - std::string result; - result += TypeInfo::signature; - result += TypeInfo::signature; - return result; - } -}; - - -template -class LoaderFunc3: public LoaderAction -{ -private: - typedef void (L::*FuncType)(A0, A1, A2); - - FuncType func; - -public: - LoaderFunc3(FuncType f): func(f) { } - - virtual void execute(Loader &l, const Statement &st) const - { - (dynamic_cast(l).*func)(st.args[0].get(), st.args[1].get(), st.args[2].get()); - } - - virtual void execute(Loader &l, const ArgumentStore &as) const - { - (dynamic_cast(l).*func)(as.get(0), as.get(1), as.get(2)); - } - - virtual std::string get_signature() const - { - std::string result; - result += TypeInfo::signature; - result += TypeInfo::signature; - result += TypeInfo::signature; - return result; - } -}; - - -template -class LoaderFunc4: public LoaderAction -{ -private: - typedef void (L::*FuncType)(A0, A1, A2, A3); - - FuncType func; - -public: - LoaderFunc4(FuncType f): func(f) { } - - virtual void execute(Loader &l, const Statement &st) const - { - (dynamic_cast(l).*func)(st.args[0].get(), st.args[1].get(), st.args[2].get(), st.args[3].get()); - } - - virtual void execute(Loader &l, const ArgumentStore &as) const - { - (dynamic_cast(l).*func)(as.get(0), as.get(1), as.get(2), as.get(3)); - } - - virtual std::string get_signature() const - { - std::string result; - result += TypeInfo::signature; - result += TypeInfo::signature; - result += TypeInfo::signature; - result += TypeInfo::signature; - return result; - } -}; - - -template -class LoaderFunc5: public LoaderAction -{ -private: - typedef void (L::*FuncType)(A0, A1, A2, A3, A4); - - FuncType func; - -public: - LoaderFunc5(FuncType f): func(f) { } - - virtual void execute(Loader &l, const Statement &st) const - { - (dynamic_cast(l).*func)(st.args[0].get(), st.args[1].get(), st.args[2].get(), st.args[3].get(), st.args[4].get()); - } - - virtual void execute(Loader &l, const ArgumentStore &as) const - { - (dynamic_cast(l).*func)(as.get(0), as.get(1), as.get(2), as.get(3), as.get(4)); - } - - virtual std::string get_signature() const - { - std::string result; - result += TypeInfo::signature; - result += TypeInfo::signature; - result += TypeInfo::signature; - result += TypeInfo::signature; - result += TypeInfo::signature; - return result; - } -}; - - -#if __cplusplus>=201103L template struct Apply; @@ -388,7 +255,6 @@ public: virtual std::string get_signature() const { return create_signature(); } }; -#endif template