Go to the documentation of this file.
36 #ifndef ROSCPP_TRANSPORT_H
37 #define ROSCPP_TRANSPORT_H
39 #include <ros/types.h>
56 class Transport :
public std::enable_shared_from_this<Transport>
68 virtual int32_t
read(uint8_t* buffer, uint32_t size) = 0;
75 virtual int32_t
write(uint8_t* buffer, uint32_t size) = 0;
98 virtual void close() = 0;
104 virtual const char*
getType() = 0;
157 #endif // ROSCPP_TRANSPORT_H
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 const char * getType()=0
Return a string that details the type of transport (Eg. TCPROS)
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...
virtual void disableRead()=0
Disable reading on this transport. Allows derived classes to, for example, disable read polling for a...
virtual void enableWrite()=0
Enable writing on this transport. Allows derived classes to, for example, enable write polling for as...
virtual void close()=0
Close this transport. Once this call has returned, writing on this transport should always return an ...
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...
void setReadCallback(const Callback &cb)
Set the function to call when there is data available to be read by this transport.
std::shared_ptr< Transport > TransportPtr
virtual void parseHeader(const Header &header)
Provides an opportunity for transport-specific options to come in through the header.
void setDisconnectCallback(const Callback &cb)
Set the function to call when this transport has disconnected, either through a call to close()....
virtual void enableRead()=0
Enable reading on this transport. Allows derived classes to, for example, enable read polling for asy...
bool isHostAllowed(const std::string &host) const
returns true if the transport is allowed to connect to the host passed to it.
bool only_localhost_allowed_
virtual std::string getTransportInfo()=0
Returns a string description of both the type of transport and who the transport is connected to.
std::function< void(const TransportPtr &)> 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,...
std::vector< std::string > allowed_hosts_
bool isOnlyLocalhostAllowed() const
returns true if this transport is only allowed to talk to localhost
virtual void disableWrite()=0
Disable writing on this transport. Allows derived classes to, for example, disable write polling for ...
sick_scan_xd
Author(s): Michael Lehning
, Jochen Sprickerhof , Martin Günther
autogenerated on Fri Oct 25 2024 02:47:12