DUNE: Uniform Navigational Environment  2.3.1
DUNE::System::IOMultiplexing Class Reference

Public Types

enum  Result { PRES_OK, PRES_NONE, PRES_SIGNAL, PRES_ERROR }
 

Public Member Functions

 IOMultiplexing (void)
 
 ~IOMultiplexing (void)
 
void add (void *src)
 
void del (void *src)
 
bool poll (double timeout)
 
bool wasTriggered (void *src)
 

Member Enumeration Documentation

Enumerator
PRES_OK 
PRES_NONE 
PRES_SIGNAL 
PRES_ERROR 

Constructor & Destructor Documentation

DUNE::System::IOMultiplexing::IOMultiplexing ( void  )

Constructor.

DUNE::System::IOMultiplexing::~IOMultiplexing ( void  )

Destructor.

Member Function Documentation

void DUNE::System::IOMultiplexing::add ( void *  src)

Add os-specific i/o handle to the polling pool.

Only supports unix file descriptors so far.

Parameters
[in]srcpointer to os-specific i/o handle.

Referenced by DUNE::Network::TCPSocket::addToPoll(), DUNE::Network::UDPSocket::addToPoll(), DUNE::Hardware::SerialPort::addToPoll(), and DUNE::Hardware::Buttons::poll().

void DUNE::System::IOMultiplexing::del ( void *  src)

Remove os-specific i/o handle from the polling pool.

Only supports unix file descriptors so far.

Parameters
[in]srcpointer to os-specific i/o handle.

Referenced by DUNE::Network::TCPSocket::delFromPoll(), DUNE::Network::UDPSocket::delFromPoll(), and DUNE::Hardware::SerialPort::delFromPoll().

bool DUNE::System::IOMultiplexing::poll ( double  timeout)

Wait for new input from the i/o handle pool.

Parameters
[in]timeouttimeout in seconds, negative for no timeout.
Returns
true if there is i/o activity, false otherwise.

References DUNE::System::Error::getLastMessage().

Referenced by DUNE::Hardware::Buttons::poll(), DUNE::Network::HTTPServer::poll(), and Transports::Evologics::Listener::run().

bool DUNE::System::IOMultiplexing::wasTriggered ( void *  src)

Check if new input became available for the os-specific i/o handle during the previous call to poll().

Only supports unix file descriptors so far.

Parameters
[in]srcpointer to os-specific i/o handle.
Returns
true if there was i/o activity, false otherwise.

Referenced by DUNE::Network::TCPSocket::wasTriggered(), DUNE::Network::UDPSocket::wasTriggered(), and DUNE::Hardware::SerialPort::wasTriggered().

Collaboration diagram for DUNE::System::IOMultiplexing:
Collaboration graph