|
reSIProcate/rutil
9694
|
#include <Poll.hxx>

Public Types | |
| enum | FDStateBitMaskEnum { fdsbmReadable = 0x0001, fdsbmWritable = 0x0004, fdsbmError = 0x0008, fdsbmAll } |
| enum | ResipStateBitMaskEnum { rsbmIsTransport = 0x0040, rsbmIsWritePending = 0x0080 } |
| typedef unsigned short | StateBitMask |
| typedef StateBitMask | FDStateBitMask |
| typedef StateBitMask | ResipStateBitMask |
Public Member Functions | |
| FDEntry (Poll *poll, bool isTransport, int fd) | |
| virtual | ~FDEntry () |
| int | getFD () const |
| Poll::FDEntry::StateBitMask | getStateBitMask () const |
| void | clearFDState () |
Protected Member Functions | |
| void | setIsWritePending (bool isWritePending) |
| virtual void | doRead () |
| virtual void | doWrite () |
| virtual void | doError () |
Private Member Functions | |
| FDEntry (const Poll::FDEntry &from) | |
| Poll::FDEntry & | operator= (const Poll::FDEntry &from) |
Static Private Member Functions | |
| static int | compare (const Poll::FDEntry *leftFDEntry, const Poll::FDEntry *rightFDEntry) |
Private Attributes | |
| Poll * | _poll |
| int | _fd |
| Poll::FDEntry::StateBitMask | _stateBitMask |
| unsigned short | _index |
Friends | |
| class | Poll |
| typedef unsigned short resip::Poll::FDEntry::StateBitMask |
Definition at line 62 of file Poll.hxx.
{
fdsbmReadable = 0x0001, // (POLLIN)
fdsbmWritable = 0x0004, // (POLLOUT)
fdsbmError = 0x0008, // (POLLERR)
fdsbmAll = Poll::FDEntry::fdsbmReadable |
Poll::FDEntry::fdsbmWritable |
Poll::FDEntry::fdsbmError
};
Definition at line 71 of file Poll.hxx.
{
rsbmIsTransport = 0x0040,
rsbmIsWritePending = 0x0080
};
| Poll::FDEntry::FDEntry | ( | Poll * | poll, |
| bool | isTransport, | ||
| int | fd | ||
| ) |
Definition at line 14 of file Poll.cxx.
References _fd, resip::Poll::_fdEntryMap, resip::Poll::_fdEntryVector, resip::Poll::_maxFDPlus1, _poll, and resip::Poll::_readFDSet.
: _poll(poll), _fd(fd), _stateBitMask(isTransport ? Poll::FDEntry::rsbmIsTransport : 0), _index((unsigned short)poll->_fdEntryVector.size()) { _poll->_fdEntryVector.push_back(this); #ifdef RESIP_POLL_IMPL_POLL pollfd pollFD; pollFD.fd = fd; pollFD.events = POLLIN; _poll->_pollFDVector.push_back(pollFD); #endif #ifdef RESIP_POLL_IMPL_SELECT if (_fd >= _poll->_maxFDPlus1) { _poll->_maxFDPlus1 = _fd + 1; } FD_SET(_fd, &(_poll->_readFDSet)); #endif #ifdef RESIP_POLL_EXTERN _poll->_fdEntryMap.insert(std::pair<int/*FD*/, Poll::FDEntry *>(_fd, this)); #endif }
| Poll::FDEntry::~FDEntry | ( | ) | [virtual] |
Definition at line 42 of file Poll.cxx.
References _index.
{
vector<Poll::FDEntry *> &fdEntryVector = _poll->_fdEntryVector;
Poll::FDEntry *lastFDEntry = fdEntryVector[fdEntryVector.size() - 1];
lastFDEntry->_index = _index;
fdEntryVector[_index] = lastFDEntry;
fdEntryVector.pop_back();
#ifdef RESIP_POLL_IMPL_POLL
vector<pollfd> &pollFDVector = _poll->_pollFDVector;
pollFDVector[_index] = pollFDVector[pollFDVector.size() - 1];
pollFDVector.pop_back();
#endif
#ifdef RESIP_POLL_IMPL_SELECT
FD_CLR(_fd, &(_poll->_readFDSet));
FD_CLR(_fd, &(_poll->_writeFDSet));
#endif
#ifdef RESIP_POLL_EXTERN
_poll->_fdEntryMap.erase(_fd);
#endif
}
| resip::Poll::FDEntry::FDEntry | ( | const Poll::FDEntry & | from | ) | [private] |
| void Poll::FDEntry::clearFDState | ( | ) |
Definition at line 64 of file Poll.cxx.
{
_stateBitMask &= ~Poll::FDEntry::fdsbmAll;
}
| int Poll::FDEntry::compare | ( | const Poll::FDEntry * | leftFDEntry, |
| const Poll::FDEntry * | rightFDEntry | ||
| ) | [static, private] |
| virtual void resip::Poll::FDEntry::doError | ( | ) | [inline, protected, virtual] |
| virtual void resip::Poll::FDEntry::doRead | ( | ) | [inline, protected, virtual] |
| virtual void resip::Poll::FDEntry::doWrite | ( | ) | [inline, protected, virtual] |
| int resip::Poll::FDEntry::getFD | ( | ) | const [inline] |
| Poll::FDEntry::StateBitMask resip::Poll::FDEntry::getStateBitMask | ( | ) | const [inline] |
| Poll::FDEntry& resip::Poll::FDEntry::operator= | ( | const Poll::FDEntry & | from | ) | [private] |
| void Poll::FDEntry::setIsWritePending | ( | bool | isWritePending | ) | [protected] |
Definition at line 70 of file Poll.cxx.
References fdsbmWritable, and rsbmIsWritePending.
{
if (isWritePending)
{
_stateBitMask |= Poll::FDEntry::rsbmIsWritePending;
#ifdef RESIP_POLL_IMPL_POLL
_poll->_pollFDVector[_index].events |= Poll::FDEntry::fdsbmWritable;
#endif
#ifdef RESIP_POLL_IMPL_SELECT
FD_SET(_fd, &(_poll->_writeFDSet));
#endif
} else
{
_stateBitMask &= ~Poll::FDEntry::rsbmIsWritePending;
#ifdef RESIP_POLL_IMPL_POLL
_poll->_pollFDVector[_index].events &= ~Poll::FDEntry::fdsbmWritable;
#endif
#ifdef RESIP_POLL_IMPL_SELECT
FD_CLR(_fd, &(_poll->_writeFDSet));
#endif
}
}
int resip::Poll::FDEntry::_fd [private] |
unsigned short resip::Poll::FDEntry::_index [private] |
Definition at line 88 of file Poll.hxx.
Referenced by ~FDEntry().
Poll* resip::Poll::FDEntry::_poll [private] |
Definition at line 87 of file Poll.hxx.
Referenced by getStateBitMask().
1.7.5.1