nidas
v1.2-1520
|
Public Member Functions | |
throw (nidas::util::IOException) | |
~PolledDSMSensor () | |
Destructor does not close(). More... | |
bool | handlePollEvents (uint32_t events) throw () |
DSMSensor * | getDSMSensor () |
int | getFd () const |
const std::string | getName () const |
int | getTimeoutMsecs () const |
void | setupTimeouts (int checkIntervalMsecs) |
SensorHandler implements a fairly crude way to detect timeouts on data read from sensors. More... | |
bool | checkTimeout () |
The SensorHandler will call this method of each opened sensor at the interval specified previously in the call to setupTimeouts(int), or perhaps somewhat less often, due to normal overhead. More... | |
void | close () throw (nidas::util::IOException) |
Remove this DSMSensor from those being polled, then call its close() method. More... | |
Private Member Functions | |
PolledDSMSensor (const PolledDSMSensor &) | |
PolledDSMSensor & | operator= (const PolledDSMSensor &) |
Private Attributes | |
DSMSensor * | _sensor |
SensorHandler * | _handler |
int | _nTimeoutChecks |
How many times this sensor has been checked for timeouts since the last time data was reads. More... | |
int | _nTimeoutChecksMax |
How many timeout checks constitute an timeout on this sensor. More... | |
int | _lastCheckInterval |
What the previous timeout check interval was. More... | |
|
inline |
Destructor does not close().
|
private |
bool SensorHandler::PolledDSMSensor::checkTimeout | ( | ) |
The SensorHandler will call this method of each opened sensor at the interval specified previously in the call to setupTimeouts(int), or perhaps somewhat less often, due to normal overhead.
If handlePollEvents(events) with an event mask of EPOLLEDIN has not bee called since the last call to checkTimeout, then increment _nTimeoutChecks.
References nidas::util::Thread::getName(), MSECS_PER_SEC, and WLOG.
Referenced by nidas::core::SensorHandler::checkTimeouts().
void SensorHandler::PolledDSMSensor::close | ( | ) | ||
throw | ( | nidas::util::IOException | ||
) |
Remove this DSMSensor from those being polled, then call its close() method.
References _handler, _sensor, nidas::core::DSMSensor::close(), nidas::core::SensorHandler::getEpollFd(), getFd(), and getName().
Referenced by nidas::core::SensorHandler::~SensorHandler().
|
inline |
References _sensor.
Referenced by nidas::core::SensorHandler::handlePollingChange().
|
inlinevirtual |
Implements nidas::core::Polled.
References _sensor, and nidas::core::DSMSensor::getReadFd().
Referenced by close(), and nidas::core::SensorHandler::handlePollingChange().
|
inline |
References _sensor, and nidas::core::DSMSensor::getName().
Referenced by close().
|
inline |
References _sensor, and nidas::core::DSMSensor::getTimeoutMsecs().
Referenced by nidas::core::SensorHandler::handlePollingChange().
|
virtual |
Implements nidas::core::Polled.
References nidas::util::Exception::getErrno(), nidas::util::Thread::getName(), N_POLLERR, N_POLLHUP, N_POLLIN, N_POLLRDHUP, NLOG, PLOG, nidas::util::Exception::what(), and WLOG.
|
private |
void SensorHandler::PolledDSMSensor::setupTimeouts | ( | int | checkIntervalMsecs | ) |
SensorHandler implements a fairly crude way to detect timeouts on data read from sensors.
It determines the minimum timeout value for the currently opened sensors. This value, but not less than 1000 milliseconds, is the parameter msecs, which is passed here to each opened sensor from time to time as the group of sensors changes.
In this simple implementation, this method sets the value of _nTimeoutChecksMax to: getTimeoutMsecs() + msecs -1)/msecs
Referenced by nidas::core::SensorHandler::setupTimeouts().
nidas::core::SensorHandler::PolledDSMSensor::throw | ( | nidas::util::IOException | ) |
|
private |
Referenced by close().
|
private |
What the previous timeout check interval was.
This value is used to scale _nTimeoutChecks if the check interval changes, which happens when the list of polled sensors changes.
|
private |
How many times this sensor has been checked for timeouts since the last time data was reads.
|
private |
How many timeout checks constitute an timeout on this sensor.
|
private |
Referenced by close(), getDSMSensor(), getFd(), getName(), and getTimeoutMsecs().