Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
scip2::ConnectionTcp Class Reference

#include <connection.h>

Inheritance diagram for scip2::ConnectionTcp:
Inheritance graph
[legend]

Public Types

using Ptr = std::shared_ptr< ConnectionTcp >
 
- Public Types inherited from scip2::Connection
using Ptr = std::shared_ptr< Connection >
 

Public Member Functions

 ConnectionTcp (const std::string &ip, const uint16_t port)
 
void send (const std::string &data, CallbackSend cb=CallbackSend())
 
void spin ()
 
void startWatchdog (const boost::posix_time::time_duration &duration)
 
void stop ()
 
- Public Member Functions inherited from scip2::Connection
 Connection ()
 
void registerCloseCallback (CallbackClose cb)
 
void registerConnectCallback (CallbackConnect cb)
 
void registerReceiveCallback (CallbackReceive cb)
 

Protected Member Functions

void asyncRead ()
 
void clearWatchdog ()
 
void onConnect (const boost::system::error_code &error)
 
void onConnectTimeout (const boost::system::error_code &error)
 
void onReceive (const boost::system::error_code &error)
 
void onSend (const boost::system::error_code &error, CallbackSend cb)
 
void onWatchdog (const boost::system::error_code &error)
 
- Protected Member Functions inherited from scip2::Connection
void close ()
 
void connect ()
 
void receive (boost::asio::streambuf &buf, const boost::posix_time::ptime &time_read)
 

Protected Attributes

boost::asio::streambuf buf_
 
boost::asio::io_service io_
 
boost::asio::ip::tcp::socket socket_
 
boost::asio::deadline_timer timeout_
 
boost::asio::deadline_timer watchdog_
 
boost::posix_time::time_duration watchdog_duration_
 
- Protected Attributes inherited from scip2::Connection
CallbackClose cb_close_
 
CallbackConnect cb_connect_
 
CallbackReceive cb_receive_
 

Additional Inherited Members

- Protected Types inherited from scip2::Connection
using CallbackClose = boost::function< void(void)>
 
using CallbackConnect = boost::function< void(void)>
 
using CallbackReceive = boost::function< void(boost::asio::streambuf &, const boost::posix_time::ptime &)>
 
using CallbackSend = boost::function< void(const boost::posix_time::ptime &)>
 

Detailed Description

Definition at line 87 of file connection.h.

Member Typedef Documentation

using scip2::ConnectionTcp::Ptr = std::shared_ptr<ConnectionTcp>

Definition at line 171 of file connection.h.

Constructor & Destructor Documentation

scip2::ConnectionTcp::ConnectionTcp ( const std::string &  ip,
const uint16_t  port 
)
inline

Definition at line 173 of file connection.h.

Member Function Documentation

void scip2::ConnectionTcp::asyncRead ( )
inlineprotected

Definition at line 142 of file connection.h.

void scip2::ConnectionTcp::clearWatchdog ( )
inlineprotected

Definition at line 97 of file connection.h.

void scip2::ConnectionTcp::onConnect ( const boost::system::error_code &  error)
inlineprotected

Definition at line 148 of file connection.h.

void scip2::ConnectionTcp::onConnectTimeout ( const boost::system::error_code &  error)
inlineprotected

Definition at line 160 of file connection.h.

void scip2::ConnectionTcp::onReceive ( const boost::system::error_code &  error)
inlineprotected

Definition at line 116 of file connection.h.

void scip2::ConnectionTcp::onSend ( const boost::system::error_code &  error,
CallbackSend  cb 
)
inlineprotected

Definition at line 129 of file connection.h.

void scip2::ConnectionTcp::onWatchdog ( const boost::system::error_code &  error)
inlineprotected

Definition at line 107 of file connection.h.

void scip2::ConnectionTcp::send ( const std::string &  data,
CallbackSend  cb = CallbackSend() 
)
inlinevirtual

Implements scip2::Connection.

Definition at line 200 of file connection.h.

void scip2::ConnectionTcp::spin ( )
inlinevirtual

Implements scip2::Connection.

Definition at line 192 of file connection.h.

void scip2::ConnectionTcp::startWatchdog ( const boost::posix_time::time_duration &  duration)
inlinevirtual

Implements scip2::Connection.

Definition at line 209 of file connection.h.

void scip2::ConnectionTcp::stop ( )
inlinevirtual

Implements scip2::Connection.

Definition at line 196 of file connection.h.

Member Data Documentation

boost::asio::streambuf scip2::ConnectionTcp::buf_
protected

Definition at line 92 of file connection.h.

boost::asio::io_service scip2::ConnectionTcp::io_
protected

Definition at line 90 of file connection.h.

boost::asio::ip::tcp::socket scip2::ConnectionTcp::socket_
protected

Definition at line 91 of file connection.h.

boost::asio::deadline_timer scip2::ConnectionTcp::timeout_
protected

Definition at line 93 of file connection.h.

boost::asio::deadline_timer scip2::ConnectionTcp::watchdog_
protected

Definition at line 94 of file connection.h.

boost::posix_time::time_duration scip2::ConnectionTcp::watchdog_duration_
protected

Definition at line 95 of file connection.h.


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


urg_stamped
Author(s): Atsushi Watanabe
autogenerated on Thu Jun 6 2019 19:55:59