Goby3 3.2.3
2025.05.13
Loading...
Searching...
No Matches
goby::middleware::io::TCPClientThreadCOBS< packet_in_group, packet_out_group, publish_layer, subscribe_layer, Config, ThreadType, use_indexed_groups > Class Template Reference

Reads/Writes strings from/to a TCP connection using a Consistent Overhead Byte Stuffing (COBS) binary protocol. More...

#include <goby/middleware/io/cobs/tcp_client.h>

Inheritance diagram for goby::middleware::io::TCPClientThreadCOBS< packet_in_group, packet_out_group, publish_layer, subscribe_layer, Config, ThreadType, use_indexed_groups >:
goby::middleware::io::detail::TCPClientThread< line_in_group, line_out_group, publish_layer, subscribe_layer, Config, ThreadType, use_indexed_groups > goby::middleware::io::detail::IOThread< line_in_group, line_out_group, publish_layer, subscribe_layer, IOConfig, SocketType, ThreadType, use_indexed_groups > goby::middleware::io::detail::IOPublishTransporter< Derived, line_in_group, layer, use_indexed_group > goby::middleware::io::detail::IOSubscribeTransporter< Derived, line_out_group, layer, use_indexed_group >

Public Member Functions

 TCPClientThreadCOBS (const goby::middleware::protobuf::TCPClientConfig &config, int index=-1)
 Constructs the thread.
 
 ~TCPClientThreadCOBS ()
 
- Public Member Functions inherited from goby::middleware::io::detail::TCPClientThread< line_in_group, line_out_group, publish_layer, subscribe_layer, Config, ThreadType, use_indexed_groups >
 TCPClientThread (const Config &config, int index=-1)
 Constructs the thread.
 
 ~TCPClientThread () override
 
- Public Member Functions inherited from goby::middleware::io::detail::IOThread< line_in_group, line_out_group, publish_layer, subscribe_layer, IOConfig, SocketType, ThreadType, use_indexed_groups >
 IOThread (const IOConfig &config, int index, std::string glog_group="i/o")
 Constructs the thread.
 
void initialize () override
 
void finalize () override
 
virtual ~IOThread ()
 

Friends

template<class Thread >
void cobs_async_write (Thread *this_thread, std::shared_ptr< const goby::middleware::protobuf::IOData > io_msg)
 
template<class Thread , class ThreadBase >
void cobs_async_read (Thread *this_thread, std::shared_ptr< ThreadBase > self)
 

Additional Inherited Members

- Protected Member Functions inherited from goby::middleware::io::detail::TCPClientThread< line_in_group, line_out_group, publish_layer, subscribe_layer, Config, ThreadType, use_indexed_groups >
void insert_endpoints (std::shared_ptr< goby::middleware::protobuf::IOData > &io_msg)
 
- Protected Member Functions inherited from goby::middleware::io::detail::IOThread< line_in_group, line_out_group, publish_layer, subscribe_layer, IOConfig, SocketType, ThreadType, use_indexed_groups >
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_contextmutable_io ()
 
bool socket_is_open ()
 Does the socket exist and is it open?
 
const std::string & glog_group ()
 

Detailed Description

template<const goby::middleware::Group & packet_in_group, const goby::middleware::Group & packet_out_group, PubSubLayer publish_layer = PubSubLayer::INTERPROCESS, PubSubLayer subscribe_layer = PubSubLayer::INTERTHREAD, typename Config = goby::middleware::protobuf::TCPClientConfig, template< class > class ThreadType = goby::middleware::SimpleThread, bool use_indexed_groups = false>
class goby::middleware::io::TCPClientThreadCOBS< packet_in_group, packet_out_group, publish_layer, subscribe_layer, Config, ThreadType, use_indexed_groups >

Reads/Writes strings from/to a TCP connection using a Consistent Overhead Byte Stuffing (COBS) binary protocol.

Template Parameters
packet_in_groupgoby::middleware::Group to publish to after receiving data from the TCP socket
packet_out_groupgoby::middleware::Group to subcribe to for data to send to the TCP socket

Definition at line 74 of file tcp_client.h.

Constructor & Destructor Documentation

◆ TCPClientThreadCOBS()

template<const goby::middleware::Group & packet_in_group, const goby::middleware::Group & packet_out_group, PubSubLayer publish_layer = PubSubLayer::INTERPROCESS, PubSubLayer subscribe_layer = PubSubLayer::INTERTHREAD, typename Config = goby::middleware::protobuf::TCPClientConfig, template< class > class ThreadType = goby::middleware::SimpleThread, bool use_indexed_groups = false>
goby::middleware::io::TCPClientThreadCOBS< packet_in_group, packet_out_group, publish_layer, subscribe_layer, Config, ThreadType, use_indexed_groups >::TCPClientThreadCOBS ( const goby::middleware::protobuf::TCPClientConfig 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 85 of file tcp_client.h.

◆ ~TCPClientThreadCOBS()

template<const goby::middleware::Group & packet_in_group, const goby::middleware::Group & packet_out_group, PubSubLayer publish_layer = PubSubLayer::INTERPROCESS, PubSubLayer subscribe_layer = PubSubLayer::INTERTHREAD, typename Config = goby::middleware::protobuf::TCPClientConfig, template< class > class ThreadType = goby::middleware::SimpleThread, bool use_indexed_groups = false>
goby::middleware::io::TCPClientThreadCOBS< packet_in_group, packet_out_group, publish_layer, subscribe_layer, Config, ThreadType, use_indexed_groups >::~TCPClientThreadCOBS ( )
inline

Definition at line 90 of file tcp_client.h.

Friends And Related Symbol Documentation

◆ cobs_async_read

template<const goby::middleware::Group & packet_in_group, const goby::middleware::Group & packet_out_group, PubSubLayer publish_layer = PubSubLayer::INTERPROCESS, PubSubLayer subscribe_layer = PubSubLayer::INTERTHREAD, typename Config = goby::middleware::protobuf::TCPClientConfig, template< class > class ThreadType = goby::middleware::SimpleThread, bool use_indexed_groups = false>
template<class Thread , class ThreadBase >
void cobs_async_read ( Thread this_thread,
std::shared_ptr< ThreadBase >  self = std::shared_ptr<ThreadBase>() 
)
friend

Definition at line 90 of file common.h.

◆ cobs_async_write

template<const goby::middleware::Group & packet_in_group, const goby::middleware::Group & packet_out_group, PubSubLayer publish_layer = PubSubLayer::INTERPROCESS, PubSubLayer subscribe_layer = PubSubLayer::INTERTHREAD, typename Config = goby::middleware::protobuf::TCPClientConfig, template< class > class ThreadType = goby::middleware::SimpleThread, bool use_indexed_groups = false>
template<class Thread >
void cobs_async_write ( Thread this_thread,
std::shared_ptr< const goby::middleware::protobuf::IOData io_msg 
)
friend

Definition at line 44 of file common.h.


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