|
YARP
Yet Another Robot Platform
|
|
Go to the documentation of this file.
26 this->ackVariant = ackVariant;
47 if (header.
length() == 8) {
48 std::string target = getSpecifierName();
49 for (
int i = 0; i < 8; i++) {
50 if (!(target[i] == header.
get()[i])) {
61 if (header.
length() == 8) {
62 std::string target = getSpecifierName();
63 for (
int i = 0; i < 8; i++) {
64 header.
get()[i] = target[i];
92 std::string target = getSpecifierName();
115 yCDebug(TEXTCARRIER,
"TextCarrier::expectSenderSpecifier");
138 std::string from =
"<ACK>\r\n";
139 Bytes b2((
char*)from.c_str(), from.length());
157 std::string from =
"Welcome ";
A base class for connection types (tcp, mcast, shmem, ...) which are called carriers in YARP.
virtual void write(char ch)
Write a single byte to the stream.
bool requireAck() const override
Check if carrier has flow control, requiring sent messages to be acknowledged by recipient.
bool expectIndex(ConnectionState &proto) override
Expect a message header, if there is one for this carrier.
Information about a connection between two ports.
bool sendHeader(ConnectionState &proto) override
Write a header appropriate to the carrier to the connection, followed by any carrier-specific data.
OutputStream & os()
Shorthand for getOutputStream()
virtual const Route & getRoute() const =0
Get the route associated with this connection.
bool checkHeader(const Bytes &header) override
Given the first 8 bytes received on a connection, decide if this is the right carrier type to use for...
bool sendIndex(ConnectionState &proto, SizedWriter &writer) override
virtual void setRoute(const Route &route)=0
Set the route associated with this connection.
TextCarrier(bool ackVariant=false)
bool sendAck(ConnectionState &proto) override
Send an acknowledgement, if needed for this carrier.
bool supportReply() const override
This flag is used by YARP to determine whether the connection can carry RPC traffic,...
virtual void flush()
Make sure all pending write operations are finished.
A simple abstraction for a block of bytes.
virtual std::string getSpecifierName() const
The basic state of a connection - route, streams in use, etc.
virtual bool isOk() const =0
Check if the stream is ok or in an error state.
virtual std::string getSenderSpecifier() const =0
Extract a name for the sender, if the connection type supports that.
bool respondToHeader(ConnectionState &proto) override
Respond to the header.
Communicating between two ports via a plain-text protocol.
An interface to the operating system, including Port based communication.
#define yCDebug(component,...)
bool isTextMode() const override
Check if carrier is textual in nature.
void setFromName(const std::string &fromName)
Set the source of the route.
bool expectSenderSpecifier(ConnectionState &proto) override
Expect the name of the sending port.
bool expectAck(ConnectionState &proto) override
Receive an acknowledgement, if expected for this carrier.
InputStream & is()
Shorthand for getInputStream()
bool expectReplyToHeader(ConnectionState &proto) override
Process reply to header, if one is expected for this carrier.
const std::string & getFromName() const
Get the source of the route.
#define YARP_OS_LOG_COMPONENT(name, name_string)
The components from which ports and connections are built.
std::string getName() const override
Get the name of this connection type ("tcp", "mcast", "shmem", ...)
void getHeader(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.
Minimal requirements for an efficient Writer.