summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-07-25 16:58:56 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-07-25 16:58:56 +0000
commitf827df84032bafa4384acb21957456e3809bc3be (patch)
tree4a0d9386aac3ee63f272ee06ff6f57f8aa959232 /include
parent77b0de3fedf130ce0d3b50bb2a2e8d98dcf5d3f4 (diff)
Add stuff for functors. Currently, as a test case only InspIRCd::IsNick has been 'functorized'
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7564 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'include')
-rw-r--r--include/inspircd.h30
1 files changed, 25 insertions, 5 deletions
diff --git a/include/inspircd.h b/include/inspircd.h
index cf7201c59..ba6c2b174 100644
--- a/include/inspircd.h
+++ b/include/inspircd.h
@@ -38,6 +38,7 @@
#include "snomasks.h"
#include "cull_list.h"
#include "filelogger.h"
+#include "caller.h"
/**
* Used to define the maximum number of parameters a command may have.
@@ -61,6 +62,8 @@
*/
#define IS_SINGLE(x,y) ( (*x == y) && (*(x+1) == 0) )
+
+
/** Delete a pointer, and NULL its value
*/
template<typename T> inline void DELETE(T* x)
@@ -234,6 +237,18 @@ typedef std::vector<std::pair<std::string, long> > FailedPortList;
/** A list of ip addresses cross referenced against clone counts */
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*);
+};
+
+
/* Forward declaration - required */
class XLineManager;
@@ -367,6 +382,15 @@ class CoreExport InspIRCd : public classbase
public:
+ /** Global cull list, will be processed on next iteration
+ */
+ CullList GlobalCulls;
+
+
+ /**** Functors ****/
+
+ IsNickHandler HandleIsNick;
+
/** InspSocket classes pending deletion after being closed.
* We don't delete these immediately as this may cause a segmentation fault.
*/
@@ -470,10 +494,6 @@ class CoreExport InspIRCd : public classbase
*/
time_t next_call;
- /** Global cull list, will be processed on next iteration
- */
- CullList GlobalCulls;
-
/** Get the current time
* Because this only calls time() once every time around the mainloop,
* it is much faster than calling time() directly.
@@ -842,7 +862,7 @@ class CoreExport InspIRCd : public classbase
* @param n A nickname to verify
* @return True if the nick is valid
*/
- bool IsNick(const char* n);
+ caller1<bool, const char*> IsNick;
/** Return true if an ident is valid
* @param An ident to verify