Go to the documentation of this file.
36 #ifndef ROSCPP_CONNECTION_H
37 #define ROSCPP_CONNECTION_H
39 #include "ros/header.h"
51 #define READ_BUFFER_SIZE (1024*64)
92 void drop(DropReason reason);
108 void sendHeaderError(
const std::string& error_message);
153 boost::signals2::connection addDropListener(
const DropFunc& slot);
154 void removeDropListener(
const boost::signals2::connection&
c);
176 std::string getCallerId();
177 std::string getRemoteString();
204 void readTransport();
208 void writeTransport();
272 #endif // ROSCPP_CONNECTION_H
std::shared_ptr< Connection > ConnectionPtr
volatile uint32_t has_read_callback_
std::function< bool(const ConnectionPtr &, const Header &)> HeaderReceivedFunc
std::function< void(const ConnectionPtr &, DropReason reason)> DropFunc
uint32_t read_size_
Size of the read buffer, in bytes.
std::function< void(const ConnectionPtr &, const boost::shared_array< uint8_t > &, uint32_t, bool)> ReadFinishedFunc
bool sending_header_error_
If we're sending a header error we disable most other calls.
bool dropped_
Have we dropped?
boost::shared_array< uint8_t > read_buffer_
Read buffer that ends up being passed to the read callback.
std::map< std::string, std::string > M_string
Header header_
Incoming header.
boost::recursive_mutex drop_mutex_
Synchronizes drop() calls.
bool writing_
Flag telling us if we're in the middle of a write (mostly used to avoid recursive deadlocking)
ROSCONSOLE_DECL void initialize()
Don't call this directly. Performs any required initialization/configuration. Happens automatically w...
std::shared_ptr< Transport > TransportPtr
Header & getHeader()
Get the Header associated with this connection.
DropSignal drop_signal_
Signal raised when this connection is dropped.
uint32_t write_size_
Size of the write buffer.
boost::shared_array< uint8_t > write_buffer_
Buffer to write from.
boost::recursive_mutex write_mutex_
Mutex used for protecting writing. Recursive because a write can immediately cause another write thro...
boost::signals2::signal< void(const ConnectionPtr &, DropReason reason)> DropSignal
bool isSendingHeaderError()
Returns true if we're currently sending a header error (and will be automatically dropped when it's f...
std::function< void(const ConnectionPtr &)> WriteFinishedFunc
WriteFinishedFunc header_written_callback_
Function to call when the outgoing header has finished writing.
HeaderReceivedFunc header_func_
Function that handles the incoming header.
ReadFinishedFunc read_callback_
Function to call when the read is finished.
uint32_t write_sent_
Amount of data we've written from the write buffer.
boost::recursive_mutex read_mutex_
Mutex used for protecting reading. Recursive because a read can immediately cause another read throug...
WriteFinishedFunc write_callback_
Function to call when the current write is finished.
TransportPtr transport_
Transport associated with us.
T read(const std::string &str)
General template which is unimplemented; implemented specializations follow below.
uint32_t read_filled_
Amount of data currently in the read buffer, in bytes.
bool is_server_
Are we a server? Servers wait for clients to send a header and then send a header in response.
volatile uint32_t has_write_callback_
std_msgs::Header * header(M &m)
returns Header<M>::pointer(m);
Abstract base class that allows abstraction of the transport type, eg. TCP, shared memory,...
bool reading_
Flag telling us if we're in the middle of a read (mostly to avoid recursive deadlocking)
std::mutex write_callback_mutex_
void setHeader(const Header &header)
Set the Header associated with this connection (used with UDPROS, which receives the connection durin...
const TransportPtr & getTransport()
Get the Transport associated with this connection.
int writeHeader(roslz4_stream *str)
Encapsulates a connection to a remote host, independent of the transport type.
sick_scan_xd
Author(s): Michael Lehning
, Jochen Sprickerhof , Martin Günther
autogenerated on Fri Oct 25 2024 02:47:08