summaryrefslogtreecommitdiff
path: root/include/inspircd.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/inspircd.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/inspircd.h')
-rw-r--r--include/inspircd.h25
1 files changed, 5 insertions, 20 deletions
diff --git a/include/inspircd.h b/include/inspircd.h
index c2ea3f048..13b66ade7 100644
--- a/include/inspircd.h
+++ b/include/inspircd.h
@@ -239,24 +239,9 @@ typedef std::map<irc::string, unsigned int> clonemap;
class InspIRCd;
-class CoreExport IsNickHandler : public HandlerBase1<bool, const char*>
-{
- InspIRCd* Server;
- public:
- IsNickHandler(InspIRCd* Srv) : Server(Srv) { }
- virtual ~IsNickHandler() { }
- virtual bool Call(const char*);
-};
-
-class CoreExport IsIdentHandler : public HandlerBase1<bool, const char*>
-{
- InspIRCd* Server;
- public:
- IsIdentHandler(InspIRCd* Srv) : Server(Srv) { }
- virtual ~IsIdentHandler() { }
- virtual bool Call(const char*);
-};
-
+DEFINE_HANDLER1(IsNickHandler, bool, const char*);
+DEFINE_HANDLER1(IsIdentHandler, bool, const char*);
+DEFINE_HANDLER1(FindDescriptorHandler, userrec*, int);
/* Forward declaration - required */
class XLineManager;
@@ -399,8 +384,8 @@ class CoreExport InspIRCd : public classbase
/**** Functors ****/
IsNickHandler HandleIsNick;
-
IsIdentHandler HandleIsIdent;
+ FindDescriptorHandler HandleFindDescriptor;
/** InspSocket classes pending deletion after being closed.
* We don't delete these immediately as this may cause a segmentation fault.
@@ -886,7 +871,7 @@ class CoreExport InspIRCd : public classbase
* @param socket The file descriptor of a user
* @return A pointer to the user if the user exists locally on this descriptor
*/
- userrec* FindDescriptor(int socket);
+ caller1<userrec*, int> FindDescriptor;
/** Add a new mode to this server's mode parser
* @param mh The modehandler to add