|
YARP
Yet Another Robot Platform
|
|
Go to the documentation of this file.
9 #ifndef TCPROSCARRIER_INC
10 #define TCPROSCARRIER_INC
21 #define TCPROS_TRANSLATE_INHIBIT (-1)
22 #define TCPROS_TRANSLATE_UNKNOWN (0)
23 #define TCPROS_TRANSLATE_IMAGE (1)
24 #define TCPROS_TRANSLATE_BOTTLE_BLOB (2)
25 #define TCPROS_TRANSLATE_TWIDDLER (3)
45 std::string wire_type;
46 std::string user_type;
48 std::string message_definition;
117 return isService?
"rossrv_carrier":
"tcpros_carrier";
122 const char *target =
"NONONONO";
123 for (
size_t i=0; i<8 && i<header.
length(); i++) {
124 header.
get()[i] = target[i];
186 bool reversed)
override;
189 void processRosHeader(
RosHeader& header);
bool expectAck(yarp::os::ConnectionState &proto) override
Receive an acknowledgement, if expected for this carrier.
bool supportReply() const override
This flag is used by YARP to determine whether the connection can carry RPC traffic,...
bool isBareMode() const override
Check if carrier excludes type information from payload.
A base class for connection types (tcp, mcast, shmem, ...) which are called carriers in YARP.
As far as YARP is concerned, on the wire to/from ROS a raw image has:
Carrier * create() const override
Factory method.
bool isConnectionless() const override
Check if this carrier is connectionless (like udp, mcast) or connection based (like tcp).
bool expectReplyToHeader(yarp::os::ConnectionState &proto) override
Process reply to header, if one is expected for this carrier.
void getHeader(yarp::os::Bytes &header) const override
Provide 8 bytes describing this connection sufficiently to allow the other side of a connection to se...
bool isTextMode() const override
Check if carrier is textual in nature.
bool respondToHeader(yarp::os::ConnectionState &proto) override
Respond to the header.
bool expectIndex(yarp::os::ConnectionState &proto) override
Expect a message header, if there is one for this carrier.
Carrier * create() const override
Factory method.
virtual bool sendIndex(yarp::os::ConnectionState &proto, yarp::os::SizedWriter &writer)
std::string getBootstrapCarrierName() const override
Get the name of the carrier that should be used prior to handshaking, if a port is registered with th...
bool expectSenderSpecifier(yarp::os::ConnectionState &proto) override
Expect the name of the sending port.
bool checkHeader(const yarp::os::Bytes &header) override
Given the first 8 bytes received on a connection, decide if this is the right carrier type to use for...
bool prepareSend(yarp::os::ConnectionState &proto) override
Perform any initialization needed before writing on a connection.
bool sendHeader(yarp::os::ConnectionState &proto) override
Write a header appropriate to the carrier to the connection, followed by any carrier-specific data.
bool canOffer() const override
Check if writing is implemented for this carrier.
A simple abstraction for a block of bytes.
bool write(yarp::os::ConnectionState &proto, yarp::os::SizedWriter &writer) override
Write a message.
The basic state of a connection - route, streams in use, etc.
virtual int connect(const yarp::os::Contact &src, const yarp::os::Contact &dest, const yarp::os::ContactStyle &style, int mode, bool reversed) override
Some carrier types may require special connection logic.
bool canAccept() const override
Check if reading is implemented for this carrier.
bool isPush() const override
Check if carrier is "push" or "pull" style.
#define TCPROS_TRANSLATE_UNKNOWN
bool canEscape() const override
Check if carrier can encode administrative messages, as opposed to just user data.
bool reply(yarp::os::ConnectionState &proto, yarp::os::SizedWriter &writer) override
bool sendAck(yarp::os::ConnectionState &proto) override
Send an acknowledgement, if needed for this carrier.
void setParameters(const yarp::os::Bytes &header) override
Configure this carrier based on the first 8 bytes of the connection.
std::string getName() const override
Get the name of this connection type ("tcp", "mcast", "shmem", ...)
std::string toString() const override
Get name of carrier.
bool requireAck() const override
Check if carrier has flow control, requiring sent messages to be acknowledged by recipient.
bool isLocal() const override
Check if carrier operates within a single process.
Minimal requirements for an efficient Writer.
bool expectExtraHeader(yarp::os::ConnectionState &proto) override
Receive any carrier-specific header.
bool isActive() const override
Check if carrier is alive and error free.