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);
#define TCPROS_TRANSLATE_UNKNOWN
Carrier * create() const override
Factory method.
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...
Carrier * create() const override
Factory method.
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 canEscape() const override
Check if carrier can encode administrative messages, as opposed to just user data.
bool isBareMode() const override
Check if carrier excludes type information from payload.
bool isTextMode() const override
Check if carrier is textual in nature.
bool respondToHeader(yarp::os::ConnectionState &proto) override
Respond to the header.
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 canOffer() const override
Check if writing is implemented for this carrier.
virtual bool sendIndex(yarp::os::ConnectionState &proto, yarp::os::SizedWriter &writer)
bool requireAck() const override
Check if carrier has flow control, requiring sent messages to be acknowledged by recipient.
bool reply(yarp::os::ConnectionState &proto, yarp::os::SizedWriter &writer) override
bool supportReply() const override
This flag is used by YARP to determine whether the connection can carry RPC traffic,...
void setParameters(const yarp::os::Bytes &header) override
Configure this carrier based on the first 8 bytes of the connection.
bool isPush() const override
Check if carrier is "push" or "pull" style.
bool prepareSend(yarp::os::ConnectionState &proto) override
Perform any initialization needed before writing on a connection.
bool expectExtraHeader(yarp::os::ConnectionState &proto) override
Receive any carrier-specific header.
std::string toString() const override
Get name of carrier.
bool write(yarp::os::ConnectionState &proto, yarp::os::SizedWriter &writer) override
Write a message.
bool isActive() const override
Check if carrier is alive and error free.
bool sendAck(yarp::os::ConnectionState &proto) override
Send an acknowledgement, if needed for this carrier.
bool expectIndex(yarp::os::ConnectionState &proto) override
Expect a message header, if there is one for this carrier.
bool expectSenderSpecifier(yarp::os::ConnectionState &proto) override
Expect the name of the sending port.
bool canAccept() const override
Check if reading is implemented for this carrier.
std::string getName() const override
Get the name of this connection type ("tcp", "mcast", "shmem", ...)
bool isConnectionless() const override
Check if this carrier is connectionless (like udp, mcast) or connection based (like tcp).
bool sendHeader(yarp::os::ConnectionState &proto) override
Write a header appropriate to the carrier to the connection, followed by any carrier-specific data.
bool expectAck(yarp::os::ConnectionState &proto) override
Receive an acknowledgement, if expected for this carrier.
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 isLocal() const override
Check if carrier operates within a single process.
bool expectReplyToHeader(yarp::os::ConnectionState &proto) override
Process reply to header, if one is expected for this carrier.
A simple abstraction for a block of bytes.
A base class for connection types (tcp, mcast, shmem, ...) which are called carriers in YARP.
The basic state of a connection - route, streams in use, etc.
Minimal requirements for an efficient Writer.
As far as YARP is concerned, on the wire to/from ROS a raw image has: