ionflux.org | Impressum

IOHandler.hpp

Go to the documentation of this file.
00001 #ifndef IONFLUX_TOOLS_IOHANDLER
00002 #define IONFLUX_TOOLS_IOHANDLER
00003 /* ==========================================================================
00004  * Ionflux Tools
00005  * Copyright (c) 2004 Joern P. Meier
00006  * mail@ionflux.org
00007  * --------------------------------------------------------------------------
00008  * IOHandler.hpp                       IO event handler (abstract class).
00009  * ==========================================================================
00010  * 
00011  * This file is part of Ionflux Tools.
00012  * 
00013  * Ionflux Tools is free software; you can redistribute it and/or modify it 
00014  * under the terms of the GNU General Public License as published by the Free
00015  * Software Foundation; either version 2 of the License, or (at  your option)
00016  * any later version.
00017  * 
00018  * Ionflux Tools is distributed in the hope that it will be useful, but 
00019  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
00020  * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00021  * for more details.
00022  * 
00023  * You should have received a copy of the GNU General Public License
00024  * along with Ionflux Tools; if not, write to the Free Software Foundation, 
00025  * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
00026  * 
00027  * ========================================================================== */
00028 
00029 #include <string>
00030 #include <iostream>
00031 #include <vector>
00032 #include "ionflux/TCPRemotePeer.hpp"
00033 
00034 namespace Ionflux
00035 {
00036 
00037 namespace Tools
00038 {
00039 
00045 struct IOEvent
00046 {
00048     IOEvent() : data(0), peer(0) { }
00050     int fd;
00052     int type;
00054     void *data;
00056     TCPRemotePeer *peer;
00058     static const int IO_READ;
00060     static const int IO_WRITE;
00062     static const int IO_EXCEPT;
00063 };
00064 
00070 class IOHandler
00071 {
00072     protected:
00073         
00074     public:
00075         
00080          virtual ~IOHandler() { };
00081         
00090         virtual void onIO(const IOEvent &event) = 0;
00091 };
00092 
00093 }
00094 
00095 }
00096 
00100 #endif

Generated on Tue Mar 14 20:58:29 2006 for Ionflux Tools Class Library (iftools) by  doxygen 1.4.6