| 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 | * poll() 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_POLL__ |
| 24 | #define __INCLUDED_FDWATCH_POLL__cxx . . $ `src/common/fdwatch_poll.h:24:9`! |
| 25 | |
| 26 | #ifdef HAVE_POLLcxx . . $ `build/config.h:62:9`! |
| 27 | |
| 28 | #ifdef HAVE_POLL_Hcxx . . $ `build/config.h:19:9`! |
| 29 | # include <poll.h> |
| 30 | #else |
| 31 | # ifdef HAVE_SYS_POLL_H |
| 32 | # include <sys/poll.h> |
| 33 | # endif |
| 34 | #endif |
| 35 | |
| 36 | #include "scoped_array.h"cxx . . $ `<file>/src/common/scoped_array.h`/ |
| 37 | #include "fdwbackend.h"cxx . . $ `<file>/src/common/fdwbackend.h`/ |
| 38 | |
| 39 | namespace pvpgncxx . . $ pvpgn/ |
| 40 | { |
| 41 | |
| 42 | class FDWPollBackendcxx . . $ pvpgn/FDWPollBackend# : public FDWBackendcxx . . $ pvpgn/FDWBackend# |
| 43 | { |
| 44 | public: |
| 45 | explicit FDWPollBackendcxx . . $ pvpgn/FDWPollBackend#FDWPollBackend(d4f767463ce0a6b3).(int nfds_); |
| 46 | ~cxx . . $ pvpgn/FDWPollBackend#`~FDWPollBackend`(ced63f7c635d850d).FDWPollBackendcxx . . $ pvpgn/FDWPollBackend#() throw(); |
| 47 | |
| 48 | int addcxx . . $ pvpgn/FDWPollBackend#add(b223e862534b1804).(int idx, unsigned rw); |
| 49 | int delcxx . . $ pvpgn/FDWPollBackend#del(7864480464b09eea).(int idx); |
| 50 | int watchcxx . . $ pvpgn/FDWPollBackend#watch(a9e4e82268fd7bfa).(long timeout_msecs); |
| 51 | void handlecxx . . $ pvpgn/FDWPollBackend#handle(49f6e7a06ebc5aa8).(); |
| 52 | |
| 53 | private: |
| 54 | int srcxx . . $ pvpgn/FDWPollBackend#sr.; |
| 55 | scoped_arraycxx . . $ pvpgn/scoped_array#<struct pollfdcxx . . $ pollfd#> fdscxx . . $ pvpgn/FDWPollBackend#fds.; /* working set */ |
| 56 | scoped_arraycxx . . $ pvpgn/scoped_array#<int> rridxcxx . . $ pvpgn/FDWPollBackend#rridx.; |
| 57 | scoped_arraycxx . . $ pvpgn/scoped_array#<int> ridxcxx . . $ pvpgn/FDWPollBackend#ridx.; |
| 58 | unsigned nofdscxx . . $ pvpgn/FDWPollBackend#nofds.; |
| 59 | |
| 60 | }; |
| 61 | |
| 62 | } |
| 63 | |
| 64 | #endif /* HAVE_POLL */ |
| 65 | |
| 66 | #endif /* __INCLUDED_FDWATCH_POLL__ */ |