|
YARP
Yet Another Robot Platform
|
|
Go to the documentation of this file.
13 #include <sys/types.h>
25 for (
size_t i=0; i<8 && i<header.
length(); i++) {
34 for (
int i=0; i<8; i++) {
35 if (header.
get()[i] !=
target.c_str()[i]) {
47 if (!proto.
os().
isOk())
return false;
73 Bytes b4(uid,strlen(uid));
117 return notLocal && proto.
is().
isOk();
virtual void createStream(bool sender)=0
bool connect(std::string port)
virtual void write(char ch)
Write a single byte to the stream.
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...
Information about a connection between two ports.
bool respondToHeader(yarp::os::ConnectionState &proto) override
Respond to the header.
bool isRunning()
Returns true if the thread is running (Thread::start has been called successfully and the thread has ...
const Bytes & bytes() const
virtual void takeStreams(TwoWayStream *streams)=0
Provide streams to be used with the connection.
OutputStream & os()
Shorthand for getOutputStream()
virtual const Route & getRoute() const =0
Get the route associated with this connection.
An abstraction for a block of bytes, with optional responsibility for allocating/destroying that bloc...
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...
char unique_id[10+MPI_MAX_PROCESSOR_NAME]
virtual void setRoute(const Route &route)=0
Set the route associated with this connection.
bool notLocal(std::string other)
virtual void flush()
Make sure all pending write operations are finished.
MpiControlThread * MpiControl
A simple abstraction for a block of bytes.
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.
An interface to the operating system, including Port based communication.
#define yCDebug(component,...)
bool sendHeader(yarp::os::ConnectionState &proto) override
Write a header appropriate to the carrier to the connection, followed by any carrier-specific data.
void setFromName(const std::string &fromName)
Set the source of the route.
InputStream & is()
Shorthand for getInputStream()
const std::string & getToName() const
Get the destination of the route.
char port_name[MPI_MAX_PORT_NAME]
bool expectReplyToHeader(yarp::os::ConnectionState &proto) override
Process reply to header, if one is expected for this carrier.
#define yCTrace(component,...)
const yarp::os::LogComponent & MPI_CARRIER()
const std::string & getFromName() const
Get the source of the route.
bool expectSenderSpecifier(yarp::os::ConnectionState &proto) override
Expect the name of the sending port.