From 7aa5e059a8f66d91bd8b69c58c657ceb70b4baff Mon Sep 17 00:00:00 2001 From: danieldg Date: Wed, 30 Sep 2009 18:31:05 +0000 Subject: Remove include/inspircd_se_config.h and socketengine-specific headers git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11784 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/socketengines/socketengine_select.cpp | 52 ++++++++++++++++++++++++++++++- 1 file changed, 51 insertions(+), 1 deletion(-) (limited to 'src/socketengines/socketengine_select.cpp') diff --git a/src/socketengines/socketengine_select.cpp b/src/socketengines/socketengine_select.cpp index b35558a70..f0668aafb 100644 --- a/src/socketengines/socketengine_select.cpp +++ b/src/socketengines/socketengine_select.cpp @@ -15,7 +15,52 @@ #ifndef WINDOWS #include #endif // WINDOWS -#include "socketengines/socketengine_select.h" +/* +------------------------------------+ + * | Inspire Internet Relay Chat Daemon | + * +------------------------------------+ + * + * InspIRCd: (C) 2002-2009 InspIRCd Development Team + * See: http://wiki.inspircd.org/Credits + * + * This program is free but copyrighted software; see + * the file COPYING for details. + * + * --------------------------------------------------- + */ + +#ifndef __SOCKETENGINE_SELECT__ +#define __SOCKETENGINE_SELECT__ + +#include +#include +#include +#ifndef WINDOWS +#include +#endif // WINDOWS +#include "inspircd_config.h" +#include "inspircd.h" +#include "socketengine.h" + +/** A specialisation of the SocketEngine class, designed to use traditional select(). + */ +class SelectEngine : public SocketEngine +{ +public: + /** Create a new SelectEngine + */ + SelectEngine(); + /** Delete a SelectEngine + */ + virtual ~SelectEngine(); + virtual bool AddFd(EventHandler* eh, int event_mask); + virtual bool DelFd(EventHandler* eh, bool force = false); + void OnSetEvent(EventHandler* eh, int, int); + virtual int DispatchEvents(); + virtual std::string GetName(); +}; + +#endif + SelectEngine::SelectEngine() @@ -148,3 +193,8 @@ std::string SelectEngine::GetName() { return "select"; } + +SocketEngine* CreateSocketEngine() +{ + return new SelectEngine; +} -- cgit v1.2.3