Goby3
3.1.5a
2024.05.23
|
Defines the common interface for polling for data on Goby transporters. More...
#include <goby/middleware/transport/interface.h>
Public Member Functions | |
template<class Clock = std::chrono::system_clock, class Duration = typename Clock::duration> | |
int | poll (const std::chrono::time_point< Clock, Duration > &timeout=std::chrono::time_point< Clock, Duration >::max()) |
poll for data. Blocks until a data event occurs or a timeout when a particular time has been reached More... | |
template<class Clock = std::chrono::system_clock, class Duration = typename Clock::duration> | |
int | poll (Duration wait_for) |
poll for data. Blocks until a data event occurs or a certain duration of time elapses (timeout) More... | |
std::shared_ptr< std::timed_mutex > | poll_mutex () |
access the mutex used for poll synchronization More... | |
std::shared_ptr< std::condition_variable_any > | cv () |
access the condition variable used for poll synchronization More... | |
Protected Member Functions | |
PollerInterface (std::shared_ptr< std::timed_mutex > poll_mutex, std::shared_ptr< std::condition_variable_any > cv) | |
Friends | |
template<typename Transporter > | |
class | Poller |
Defines the common interface for polling for data on Goby transporters.
Definition at line 139 of file interface.h.
|
inlineprotected |
Definition at line 169 of file interface.h.
|
inline |
access the condition variable used for poll synchronization
Notifications on this condition variable will cause the poll() loop to assume there is incoming data available (typically this is notified by the publishing thread in InterThreadTransporter, but can be used to synchronize the Goby poller infrastructure with other synchronous events, such as boost::asio, file descriptors, etc. For an example, see io::IOThread)
Definition at line 166 of file interface.h.
int goby::middleware::PollerInterface::poll | ( | const std::chrono::time_point< Clock, Duration > & | timeout = std::chrono::time_point<Clock, Duration>::max() | ) |
poll for data. Blocks until a data event occurs or a timeout when a particular time has been reached
timeout | timeout defined using a SystemClock or std::chrono::system_clock time_point. Defaults to never timing out |
Definition at line 345 of file interface.h.
int goby::middleware::PollerInterface::poll | ( | Duration | wait_for | ) |
poll for data. Blocks until a data event occurs or a certain duration of time elapses (timeout)
wait_for | timeout duration |
Definition at line 351 of file interface.h.
|
inline |
access the mutex used for poll synchronization
Definition at line 160 of file interface.h.
Definition at line 176 of file interface.h.