ionflux.org | Impressum

FDSet.hpp

Go to the documentation of this file.
00001 #ifndef IONFLUX_TOOLS_FDSET
00002 #define IONFLUX_TOOLS_FDSET
00003 /* ==========================================================================
00004  * Ionflux Tools
00005  * Copyright (c) 2004 Joern P. Meier
00006  * mail@ionflux.org
00007  * --------------------------------------------------------------------------
00008  * FDSet.hpp                    File descriptor set.
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 <sys/select.h>
00033 
00034 namespace Ionflux
00035 {
00036 
00037 namespace Tools
00038 {
00039 
00047 class FDSet
00048 {
00049     protected:
00051         fd_set masterRead;
00053         fd_set masterWrite;
00055         fd_set masterExcept;
00057         fd_set activeRead;
00059         fd_set activeWrite;
00061         fd_set activeExcept;
00063         timeval *timeout;
00064         
00065     public:
00070         FDSet();
00071         
00076         virtual ~FDSet();
00077         
00088         virtual void addFD(int fd);
00089         
00096         virtual void addReadFD(int fd);
00097         
00104         virtual void addWriteFD(int fd);
00105         
00112         virtual void addExceptFD(int fd);
00113         
00124         virtual void removeFD(int fd);
00125         
00132         virtual void removeReadFD(int fd);
00133         
00140         virtual void removeWriteFD(int fd);
00141         
00148         virtual void removeExceptFD(int fd);
00149         
00165         virtual bool isSet(int fd);
00166         
00177         virtual bool isSetRead(int fd);
00178         
00189         virtual bool isSetWrite(int fd);
00190         
00201         virtual bool isSetExcept(int fd);
00202         
00209         virtual int select();
00210         
00218         virtual void setTimeout(int secs, int usecs);
00219         
00221         virtual void clear();
00222         
00224         virtual void clearRead();
00225         
00227         virtual void clearWrite();
00228         
00230         virtual void clearExcept();
00231 };
00232 
00233 }
00234 
00235 }
00236 
00240 #endif

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