Goby3  3.1.5a
2024.05.23
goby::middleware::io::detail::SerialThread< line_in_group, line_out_group, publish_layer, subscribe_layer, ThreadType, use_indexed_groups > Class Template Reference

#include <goby/middleware/io/detail/serial_interface.h>

Inheritance diagram for goby::middleware::io::detail::SerialThread< line_in_group, line_out_group, publish_layer, subscribe_layer, ThreadType, use_indexed_groups >:
goby::middleware::io::detail::IOThread< line_in_group, line_out_group, publish_layer, subscribe_layer, goby::middleware::protobuf::SerialConfig, boost::asio::serial_port, ThreadType, false > goby::middleware::io::detail::IOPublishTransporter< IOThread< line_in_group, line_out_group, publish_layer, subscribe_layer, goby::middleware::protobuf::SerialConfig, boost::asio::serial_port, ThreadType, use_indexed_groups >, line_in_group, publish_layer, use_indexed_groups > goby::middleware::io::detail::IOSubscribeTransporter< IOThread< line_in_group, line_out_group, publish_layer, subscribe_layer, goby::middleware::protobuf::SerialConfig, boost::asio::serial_port, ThreadType, use_indexed_groups >, line_out_group, subscribe_layer, use_indexed_groups >

Public Member Functions

 SerialThread (const goby::middleware::protobuf::SerialConfig &config, int index=-1)
 Constructs the thread. More...
 
virtual ~SerialThread () override
 
- Public Member Functions inherited from goby::middleware::io::detail::IOThread< line_in_group, line_out_group, publish_layer, subscribe_layer, goby::middleware::protobuf::SerialConfig, boost::asio::serial_port, ThreadType, false >
 IOThread (const goby::middleware::protobuf::SerialConfig &config, int index, std::string glog_group="i/o")
 Constructs the thread. More...
 
void initialize () override
 
void finalize () override
 
virtual ~IOThread ()
 

Protected Member Functions

boost::asio::serial_port & mutable_serial_port ()
 Access the (mutable) serial_port object. More...
 
- Protected Member Functions inherited from goby::middleware::io::detail::IOThread< line_in_group, line_out_group, publish_layer, subscribe_layer, goby::middleware::protobuf::SerialConfig, boost::asio::serial_port, ThreadType, false >
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)
 
boost::asio::serial_port & mutable_socket ()
 Access the (mutable) socket (or serial_port) object. More...
 
boost::asio::io_contextmutable_io ()
 
bool socket_is_open ()
 Does the socket exist and is it open? More...
 
virtual void async_read ()=0
 Starts an asynchronous read on the socket. More...
 
const std::string & glog_group ()
 

Detailed Description

template<const goby::middleware::Group & line_in_group, const goby::middleware::Group & line_out_group, PubSubLayer publish_layer, PubSubLayer subscribe_layer, template< class > class ThreadType, bool use_indexed_groups = false>
class goby::middleware::io::detail::SerialThread< line_in_group, line_out_group, publish_layer, subscribe_layer, ThreadType, use_indexed_groups >

Definition at line 59 of file serial_interface.h.

Constructor & Destructor Documentation

◆ SerialThread()

template<const goby::middleware::Group & line_in_group, const goby::middleware::Group & line_out_group, PubSubLayer publish_layer, PubSubLayer subscribe_layer, template< class > class ThreadType, bool use_indexed_groups = false>
goby::middleware::io::detail::SerialThread< line_in_group, line_out_group, publish_layer, subscribe_layer, ThreadType, use_indexed_groups >::SerialThread ( const goby::middleware::protobuf::SerialConfig config,
int  index = -1 
)
inline

Constructs the thread.

Parameters
configA reference to the Protocol Buffers config read by the main application at launch
indexThread index for multiple instances in a given application (-1 indicates a single instance)

Definition at line 71 of file serial_interface.h.

◆ ~SerialThread()

template<const goby::middleware::Group & line_in_group, const goby::middleware::Group & line_out_group, PubSubLayer publish_layer, PubSubLayer subscribe_layer, template< class > class ThreadType, bool use_indexed_groups = false>
virtual goby::middleware::io::detail::SerialThread< line_in_group, line_out_group, publish_layer, subscribe_layer, ThreadType, use_indexed_groups >::~SerialThread ( )
inlineoverridevirtual

Definition at line 136 of file serial_interface.h.

Member Function Documentation

◆ mutable_serial_port()

template<const goby::middleware::Group & line_in_group, const goby::middleware::Group & line_out_group, PubSubLayer publish_layer, PubSubLayer subscribe_layer, template< class > class ThreadType, bool use_indexed_groups = false>
boost::asio::serial_port& goby::middleware::io::detail::SerialThread< line_in_group, line_out_group, publish_layer, subscribe_layer, ThreadType, use_indexed_groups >::mutable_serial_port ( )
inlineprotected

Access the (mutable) serial_port object.

Definition at line 143 of file serial_interface.h.


The documentation for this class was generated from the following file: