summaryrefslogtreecommitdiff
path: root/include/caller.h
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-07-25 17:36:13 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-07-25 17:36:13 +0000
commit529f16e84b4ba1328a13be32e40a71156c4725f8 (patch)
tree0300f14ecebfe13389a5fe4418e051191dff9f26 /include/caller.h
parent89bc1282b9e1e2bf9eccacae8f1dc2b5f9ade9b7 (diff)
Shorthand macros DEFINE_HANDLER1()...DEFINE_HANDLER9() to save on defining functor classes that just implement Call()
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7569 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'include/caller.h')
-rw-r--r--include/caller.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/caller.h b/include/caller.h
index 9f251d16c..396a5ba5a 100644
--- a/include/caller.h
+++ b/include/caller.h
@@ -237,5 +237,14 @@ template <typename ReturnType, typename Param1, typename Param2, typename Param3
}
};
+#define DEFINE_HANDLER0(NAME, RETURN) \
+ class CoreExport NAME : public HandlerBase0<RETURN> { InspIRCd* Server; public: NAME(InspIRCd* Srv) : Server(Srv) { } virtual ~NAME() { } virtual RETURN Call(); };
+
+#define DEFINE_HANDLER1(NAME, RETURN, V1) \
+ class CoreExport NAME : public HandlerBase1<RETURN, V1> { InspIRCd* Server; public: NAME(InspIRCd* Srv) : Server(Srv) { } virtual ~NAME() { } virtual RETURN Call(V1); };
+
+#define DEFINE_HANDLER2(NAME, RETURN, V1, V2) \
+ class CoreExport NAME : public HandlerBase2<RETURN, V1, V2> { InspIRCd* Server; public: NAME(InspIRCd* Srv) : Server(Srv) { } virtual ~NAME() { } virtual RETURN Call(V2); };
+
#endif