|
reSIProcate/rutil
9694
|
This class abstracts the Unix system call "poll". More...
#include <Poll.hxx>
Classes | |
| class | FDEntry |
Public Member Functions | |
| Poll () | |
| ~Poll () | |
| const std::vector < Poll::FDEntry * > & | beforeExternWait () |
| bool | setEntryFDStateForExternWait (int fd, Poll::FDEntry::StateBitMask fdStateBitMask) |
| const std::vector < Poll::FDEntry * > & | afterExternWait () |
Static Public Member Functions | |
| static int | findFDInWaitResult (int fd, const std::vector< Poll::FDEntry * > &waitResult) |
Private Member Functions | |
| Poll (const Poll &from) | |
| defined(RESIP_POLL_EXTERN) } | |
| Poll & | operator= (const Poll &from) |
Private Attributes | |
| std::vector< Poll::FDEntry * > | _fdEntryVector |
| int | _maxFDPlus1 |
| fd_set | _readFDSet |
| fd_set | _writeFDSet |
| std::map< int, Poll::FDEntry * > | _fdEntryMap |
| std::vector< Poll::FDEntry * > | _waitResult |
Friends | |
| class | Poll::FDEntry |
This class abstracts the Unix system call "poll".
It offers implementations in terms of "poll" itself, "epoll", and "select". (Respectively #ifdef'd by RESIP_POLL_IMPL_POLL, RESIP_POLL_IMPL_SELECT, and RESIP_POLL_IMPL_EPOLL.) File descriptors are wrapped by inner class "Poll::FDEntry". The actual "poll" call is represented by method "wait", or if an application wants to control the system call directly, it can instead use methods "beforeExternWait", "setEntryFDStateForExternWait", and "afterExternWait". (The latter are selected by #define-ing RESIP_POLL_EXTERN.)
| Poll::Poll | ( | ) |
Definition at line 127 of file Poll.cxx.
References _readFDSet, and _writeFDSet.
: _maxFDPlus1(0) #endif { #ifdef RESIP_POLL_IMPL_SELECT FD_ZERO(&_readFDSet); FD_ZERO(&_writeFDSet); #endif }
| resip::Poll::Poll | ( | const Poll & | from | ) | [private] |
defined(RESIP_POLL_EXTERN) }
| const std::vector<Poll::FDEntry *>& resip::Poll::afterExternWait | ( | ) |
| const std::vector<Poll::FDEntry *>& resip::Poll::beforeExternWait | ( | ) |
| int Poll::findFDInWaitResult | ( | int | fd, |
| const std::vector< Poll::FDEntry * > & | waitResult | ||
| ) | [static] |
Definition at line 105 of file Poll.cxx.
{
unsigned int lowIndex = 0;
unsigned int highIndex = (unsigned int)waitResult.size();
while (lowIndex + 1 < highIndex)
{
// The goal fd is in waitResult in the range [lowIndex, highIndex[.
unsigned int midIndex = (lowIndex + highIndex) / 2;
if (waitResult[midIndex]->_fd > fd)
{
highIndex = midIndex - 1;
}
else
{
lowIndex = midIndex;
}
}//while
return lowIndex;
}
| bool resip::Poll::setEntryFDStateForExternWait | ( | int | fd, |
| Poll::FDEntry::StateBitMask | fdStateBitMask | ||
| ) |
friend class Poll::FDEntry [friend] |
std::map<int, Poll::FDEntry *> resip::Poll::_fdEntryMap [private] |
Definition at line 151 of file Poll.hxx.
Referenced by resip::Poll::FDEntry::FDEntry().
std::vector<Poll::FDEntry *> resip::Poll::_fdEntryVector [private] |
Definition at line 141 of file Poll.hxx.
Referenced by resip::Poll::FDEntry::FDEntry().
int resip::Poll::_maxFDPlus1 [private] |
Definition at line 146 of file Poll.hxx.
Referenced by resip::Poll::FDEntry::FDEntry().
fd_set resip::Poll::_readFDSet [private] |
Definition at line 147 of file Poll.hxx.
Referenced by resip::Poll::FDEntry::FDEntry(), and Poll().
std::vector<Poll::FDEntry *> resip::Poll::_waitResult [private] |
fd_set resip::Poll::_writeFDSet [private] |
1.7.5.1