|
Goby3 3.4.0
2026.04.13
|
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 | |
| 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) | |
| std::shared_ptr< std::mutex > | poll_mutex () |
| access the mutex used for poll synchronization | |
| std::shared_ptr< std::condition_variable > | cv () |
| access the condition variable used for poll synchronization | |
| void | attach (PollerInterface *poller) |
| Attach another PollerInterface to this one so that its _transporter_poll() is also called during _poll_all() | |
Protected Member Functions | |
| PollerInterface (std::shared_ptr< std::mutex > poll_mutex, std::shared_ptr< std::condition_variable > cv) | |
Friends | |
| template<typename Transporter > | |
| class | Poller |
Defines the common interface for polling for data on Goby transporters.
Definition at line 140 of file interface.h.
|
inlineprotected |
Definition at line 196 of file interface.h.
|
inline |
Attach another PollerInterface to this one so that its _transporter_poll() is also called during _poll_all()
The attached PollerInterface must share the same poll_mutex() and cv() as this PollerInterface. The attached poller must remain valid (outlive or have the same lifetime as this instance).
| poller | Non-null pointer to the PollerInterface to attach; must not be null and must not be this |
| goby::Exception | if poller is null, is this instance, is already attached, or if poll_mutex() or cv() of the attached poller do not match those of this poller |
Definition at line 175 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 167 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 375 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 381 of file interface.h.
|
inline |
access the mutex used for poll synchronization
Definition at line 161 of file interface.h.
Definition at line 203 of file interface.h.