Goby3 3.2.3
2025.05.13
|
#include <goby/middleware/io/detail/io_interface.h>
Public Member Functions | |
IOThread (const IOConfig &config, int index, std::string glog_group="i/o") | |
Constructs the thread. | |
void | initialize () override |
void | finalize () override |
virtual | ~IOThread () |
Protected Member Functions | |
void | write (std::shared_ptr< const goby::middleware::protobuf::IOData > io_msg) |
void | handle_read_success (std::size_t bytes_transferred, const std::string &bytes) |
void | handle_read_success (std::size_t bytes_transferred, std::shared_ptr< goby::middleware::protobuf::IOData > io_msg) |
void | handle_write_success (std::size_t bytes_transferred) |
void | handle_read_error (const boost::system::error_code &ec) |
void | handle_write_error (const boost::system::error_code &ec) |
SocketType & | mutable_socket () |
Access the (mutable) socket (or serial_port) object. | |
boost::asio::io_context & | mutable_io () |
bool | socket_is_open () |
Does the socket exist and is it open? | |
virtual void | open_socket ()=0 |
Opens the newly created socket/serial_port. | |
virtual void | async_read ()=0 |
Starts an asynchronous read on the socket. | |
virtual void | async_write (std::shared_ptr< const goby::middleware::protobuf::IOData > io_msg)=0 |
Starts an asynchronous write from data published. | |
const std::string & | glog_group () |
Friends | |
template<class IOThreadImplementation > | |
void | basic_async_write (IOThreadImplementation *this_thread, std::shared_ptr< const goby::middleware::protobuf::IOData > io_msg) |
Definition at line 79 of file io_interface.h.
|
inline |
Constructs the thread.
config | A reference to the configuration read by the main application at launch |
index | Thread index for multiple instances in a given application (-1 indicates a single instance) |
glog_group | String name for group to use for glog |
Definition at line 94 of file io_interface.h.
|
inlinevirtual |
Definition at line 151 of file io_interface.h.
|
protectedpure virtual |
Starts an asynchronous read on the socket.
Implemented in goby::middleware::io::UDPOneToManyThread< line_in_group, line_out_group, publish_layer, subscribe_layer, Config, ThreadType, use_indexed_groups >, and goby::middleware::io::UDPOneToManyThread< line_in_group, line_out_group, PubSubLayer::INTERPROCESS, PubSubLayer::INTERTHREAD, goby::middleware::protobuf::UDPPointToPointConfig, goby::middleware::SimpleThread, false >.
|
protectedpure virtual |
Starts an asynchronous write from data published.
Implemented in goby::middleware::io::UDPOneToManyThread< line_in_group, line_out_group, publish_layer, subscribe_layer, Config, ThreadType, use_indexed_groups >, and goby::middleware::io::UDPOneToManyThread< line_in_group, line_out_group, PubSubLayer::INTERPROCESS, PubSubLayer::INTERTHREAD, goby::middleware::protobuf::UDPPointToPointConfig, goby::middleware::SimpleThread, false >.
|
inlineoverride |
Definition at line 140 of file io_interface.h.
|
inlineprotected |
Definition at line 234 of file io_interface.h.
|
protected |
Definition at line 389 of file io_interface.h.
|
inlineprotected |
Definition at line 185 of file io_interface.h.
|
inlineprotected |
Definition at line 193 of file io_interface.h.
|
protected |
Definition at line 415 of file io_interface.h.
|
inlineprotected |
Definition at line 207 of file io_interface.h.
|
inlineoverride |
Definition at line 124 of file io_interface.h.
|
inlineprotected |
Definition at line 220 of file io_interface.h.
|
inlineprotected |
Access the (mutable) socket (or serial_port) object.
Definition at line 212 of file io_interface.h.
|
protectedpure virtual |
Opens the newly created socket/serial_port.
|
inlineprotected |
Does the socket exist and is it open?
Definition at line 223 of file io_interface.h.
|
inlineprotected |
Definition at line 171 of file io_interface.h.
|
friend |
Definition at line 261 of file io_interface.h.