Go to the documentation of this file.
35 #ifndef ROSCPP_TRANSPORT_H
36 #define ROSCPP_TRANSPORT_H
39 #include <boost/function.hpp>
40 #include <boost/shared_ptr.hpp>
41 #include <boost/enable_shared_from_this.hpp>
55 class Transport :
public boost::enable_shared_from_this<Transport>
67 virtual int32_t
read(uint8_t* buffer, uint32_t size) = 0;
74 virtual int32_t
write(uint8_t* buffer, uint32_t size) = 0;
97 virtual void close() = 0;
103 virtual const char*
getType() = 0;
156 #endif // ROSCPP_TRANSPORT_H
virtual int32_t read(uint8_t *buffer, uint32_t size)=0
Read a number of bytes into the supplied buffer. Not guaranteed to actually read that number of bytes...
std::vector< std::string > allowed_hosts_
void setDisconnectCallback(const Callback &cb)
Set the function to call when this transport has disconnected, either through a call to close()....
virtual void disableRead()=0
Disable reading on this transport. Allows derived classes to, for example, disable read polling for a...
Abstract base class that allows abstraction of the transport type, eg. TCP, shared memory,...
virtual void disableWrite()=0
Disable writing on this transport. Allows derived classes to, for example, disable write polling for ...
virtual void close()=0
Close this transport. Once this call has returned, writing on this transport should always return an ...
virtual void enableWrite()=0
Enable writing on this transport. Allows derived classes to, for example, enable write polling for as...
virtual int32_t write(uint8_t *buffer, uint32_t size)=0
Write a number of bytes from the supplied buffer. Not guaranteed to actually write that number of byt...
boost::function< void(const TransportPtr &)> Callback
void setReadCallback(const Callback &cb)
Set the function to call when there is data available to be read by this transport.
virtual const char * getType()=0
Return a string that details the type of transport (Eg. TCPROS)
bool isOnlyLocalhostAllowed() const
returns true if this transport is only allowed to talk to localhost
bool isHostAllowed(const std::string &host) const
returns true if the transport is allowed to connect to the host passed to it.
virtual void parseHeader(const Header &header)
Provides an opportunity for transport-specific options to come in through the header.
boost::shared_ptr< Transport > TransportPtr
bool only_localhost_allowed_
void setWriteCallback(const Callback &cb)
Set the function to call when there is space available to write on this transport.
virtual bool requiresHeader()
Returns a boolean to indicate if the transport mechanism is reliable or not.
virtual void enableRead()=0
Enable reading on this transport. Allows derived classes to, for example, enable read polling for asy...
virtual std::string getTransportInfo()=0
Returns a string description of both the type of transport and who the transport is connected to.
roscpp
Author(s): Morgan Quigley, Josh Faust, Brian Gerkey, Troy Straszheim, Dirk Thomas
, Jacob Perron
autogenerated on Sat Sep 14 2024 02:59:36