| 1 | /* |
| 2 | * Abstraction API/layer for the various ways PvPGN can inspect sockets state |
| 3 | * 2003 (C) |
| 4 | * |
| 5 | * Code is based on the ideas found in thttpd project. |
| 6 | * |
| 7 | * select() based backend |
| 8 | * |
| 9 | * This program is free software; you can redistribute it and/or |
| 10 | * modify it under the terms of the GNU General Public License |
| 11 | * as published by the Free Software Foundation; either version 2 |
| 12 | * of the License, or (at your option) any later version. |
| 13 | * |
| 14 | * This program is distributed in the hope that it will be useful, |
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 17 | * GNU General Public License for more details. |
| 18 | * |
| 19 | * You should have received a copy of the GNU General Public License |
| 20 | * along with this program; if not, write to the Free Software |
| 21 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 22 | */ |
| 23 | #ifndef __INCLUDED_FDWATCH_SELECT__ |
| 24 | #define __INCLUDED_FDWATCH_SELECT__cxx . . $ `src/common/fdwatch_select.h:24:9`! |
| 25 | |
| 26 | #ifdef HAVE_SELECTcxx . . $ `build/config.h:65:9`! |
| 27 | |
| 28 | #include "compat/psock.h"cxx . . $ `<file>/src/compat/psock.h`/ |
| 29 | #include "common/scoped_ptr.h"cxx . . $ `<file>/src/common/scoped_ptr.h`/ |
| 30 | #include "fdwatch.h"cxx . . $ `<file>/src/common/fdwatch.h`/ |
| 31 | #include "fdwbackend.h"cxx . . $ `<file>/src/common/fdwbackend.h`/ |
| 32 | |
| 33 | namespace pvpgncxx . . $ pvpgn/ |
| 34 | { |
| 35 | |
| 36 | class FDWSelectBackendcxx . . $ pvpgn/FDWSelectBackend# : public FDWBackendcxx . . $ pvpgn/FDWBackend# |
| 37 | { |
| 38 | public: |
| 39 | explicit FDWSelectBackendcxx . . $ pvpgn/FDWSelectBackend#FDWSelectBackend(d4f767463ce0a6b3).(int nfds_); |
| 40 | ~cxx . . $ pvpgn/FDWSelectBackend#`~FDWSelectBackend`(ced63f7c635d850d).FDWSelectBackendcxx . . $ pvpgn/FDWSelectBackend#() throw(); |
| 41 | |
| 42 | int addcxx . . $ pvpgn/FDWSelectBackend#add(b223e862534b1804).(int idx, unsigned rw); |
| 43 | int delcxx . . $ pvpgn/FDWSelectBackend#del(7864480464b09eea).(int idx); |
| 44 | int watchcxx . . $ pvpgn/FDWSelectBackend#watch(a9e4e82268fd7bfa).(long timeout_msecs); |
| 45 | void handlecxx . . $ pvpgn/FDWSelectBackend#handle(49f6e7a06ebc5aa8).(); |
| 46 | |
| 47 | int cbcxx . . $ pvpgn/FDWSelectBackend#cb(1bc072288fb75793).(t_fdwatch_fdcxx . . $ pvpgn/t_fdwatch_fd#* cfd); |
| 48 | |
| 49 | private: |
| 50 | int srcxx . . $ pvpgn/FDWSelectBackend#sr., smaxfdcxx . . $ pvpgn/FDWSelectBackend#smaxfd.; |
| 51 | scoped_ptrcxx . . $ pvpgn/scoped_ptr#<t_psock_fd_setcxx . . $ `src/compat/psock.h:277:9`!> rfdscxx . . $ pvpgn/FDWSelectBackend#rfds., wfdscxx . . $ pvpgn/FDWSelectBackend#wfds., /* working sets (updated often) */ |
| 52 | trfdscxx . . $ pvpgn/FDWSelectBackend#trfds., twfdscxx . . $ pvpgn/FDWSelectBackend#twfds.; /* templates (updated rare) */ |
| 53 | }; |
| 54 | |
| 55 | } |
| 56 | |
| 57 | #endif /* HAVE_SELECT */ |
| 58 | |
| 59 | #endif /* __INCLUDED_FDWATCH_SELECT__ */ |