Public Member Functions | Private Member Functions | Private Attributes | List of all members
rosserial_server::AsyncReadBuffer< AsyncReadStream > Class Template Reference

#include <async_read_buffer.h>

Public Member Functions

 AsyncReadBuffer (AsyncReadStream &s, size_t capacity, boost::function< void(const boost::system::error_code &)> error_callback)
 
void read (size_t requested_bytes, boost::function< void(ros::serialization::IStream &)> callback)
 Commands a fixed number of bytes from the buffer. This may be fulfilled from existing buffer content, or following a hardware read if required. More...
 

Private Member Functions

size_t bytesAvailable ()
 
size_t bytesHeadroom ()
 
void callback (const boost::system::error_code &error, size_t bytes_transferred)
 The internal callback which is called by the boost::asio::async_read invocation in the public read method above. More...
 
void callSuccessCallback ()
 Calls the user's callback. This is a separate function because it gets called from two places, depending whether or not an actual HW read is required to fill the request. More...
 
void reset ()
 

Private Attributes

boost::function< void(const boost::system::error_code &)> error_callback_
 
std::vector< uint8_t > mem_
 
size_t read_index_
 
size_t read_requested_bytes_
 
boost::function< void(ros::serialization::IStream &)> read_success_callback_
 
AsyncReadStream & stream_
 
size_t write_index_
 

Detailed Description

template<typename AsyncReadStream>
class rosserial_server::AsyncReadBuffer< AsyncReadStream >

Definition at line 47 of file async_read_buffer.h.

Constructor & Destructor Documentation

template<typename AsyncReadStream>
rosserial_server::AsyncReadBuffer< AsyncReadStream >::AsyncReadBuffer ( AsyncReadStream &  s,
size_t  capacity,
boost::function< void(const boost::system::error_code &)>  error_callback 
)
inline

Definition at line 50 of file async_read_buffer.h.

Member Function Documentation

template<typename AsyncReadStream>
size_t rosserial_server::AsyncReadBuffer< AsyncReadStream >::bytesAvailable ( )
inlineprivate

Definition at line 116 of file async_read_buffer.h.

template<typename AsyncReadStream>
size_t rosserial_server::AsyncReadBuffer< AsyncReadStream >::bytesHeadroom ( )
inlineprivate

Definition at line 121 of file async_read_buffer.h.

template<typename AsyncReadStream>
void rosserial_server::AsyncReadBuffer< AsyncReadStream >::callback ( const boost::system::error_code &  error,
size_t  bytes_transferred 
)
inlineprivate

The internal callback which is called by the boost::asio::async_read invocation in the public read method above.

Definition at line 130 of file async_read_buffer.h.

template<typename AsyncReadStream>
void rosserial_server::AsyncReadBuffer< AsyncReadStream >::callSuccessCallback ( )
inlineprivate

Calls the user's callback. This is a separate function because it gets called from two places, depending whether or not an actual HW read is required to fill the request.

Definition at line 159 of file async_read_buffer.h.

template<typename AsyncReadStream>
void rosserial_server::AsyncReadBuffer< AsyncReadStream >::read ( size_t  requested_bytes,
boost::function< void(ros::serialization::IStream &)>  callback 
)
inline

Commands a fixed number of bytes from the buffer. This may be fulfilled from existing buffer content, or following a hardware read if required.

Definition at line 62 of file async_read_buffer.h.

template<typename AsyncReadStream>
void rosserial_server::AsyncReadBuffer< AsyncReadStream >::reset ( )
inlineprivate

Definition at line 110 of file async_read_buffer.h.

Member Data Documentation

template<typename AsyncReadStream>
boost::function<void(const boost::system::error_code&)> rosserial_server::AsyncReadBuffer< AsyncReadStream >::error_callback_
private

Definition at line 187 of file async_read_buffer.h.

template<typename AsyncReadStream>
std::vector<uint8_t> rosserial_server::AsyncReadBuffer< AsyncReadStream >::mem_
private

Definition at line 183 of file async_read_buffer.h.

template<typename AsyncReadStream>
size_t rosserial_server::AsyncReadBuffer< AsyncReadStream >::read_index_
private

Definition at line 186 of file async_read_buffer.h.

template<typename AsyncReadStream>
size_t rosserial_server::AsyncReadBuffer< AsyncReadStream >::read_requested_bytes_
private

Definition at line 190 of file async_read_buffer.h.

template<typename AsyncReadStream>
boost::function<void(ros::serialization::IStream&)> rosserial_server::AsyncReadBuffer< AsyncReadStream >::read_success_callback_
private

Definition at line 189 of file async_read_buffer.h.

template<typename AsyncReadStream>
AsyncReadStream& rosserial_server::AsyncReadBuffer< AsyncReadStream >::stream_
private

Definition at line 182 of file async_read_buffer.h.

template<typename AsyncReadStream>
size_t rosserial_server::AsyncReadBuffer< AsyncReadStream >::write_index_
private

Definition at line 185 of file async_read_buffer.h.


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


rosserial_server
Author(s): Mike Purvis
autogenerated on Mon Jun 10 2019 14:53:36