 |
YARP
Yet Another Robot Platform
|
|
Go to the documentation of this file.
10 #ifndef YARP_OS_IMPL_LOCALCARRIER_H
11 #define YARP_OS_IMPL_LOCALCARRIER_H
42 std::mutex senderMutex;
43 std::mutex receiverMutex;
72 void reset()
override;
76 void close()
override;
77 bool isOk()
const override;
80 Contact localAddress, remoteAddress;
99 std::string
getName()
const override;
137 #endif // YARP_OS_IMPL_LOCALCARRIER_H
A stream which can be asked to perform bidirectional communication.
This is a base class for objects that can be both read from and be written to the YARP network.
LocalCarrier * getSender(LocalCarrier *receiver)
virtual std::string getSpecifierName() const
LocalCarrier * getReceiver()
A class for thread synchronization and mutual exclusion.
A base class for connection types (tcp, mcast, shmem, ...) which are called carriers in YARP.
bool respondToHeader(ConnectionState &proto) override
Respond to the header.
virtual void write(char ch)
Write a single byte to the stream.
Carrier * create() const override
Factory method.
void accept(yarp::os::Portable *ref)
Simple specification of the minimum functions needed from output streams.
void attach(LocalCarrier *owner, bool sender)
Coordinate ports communicating locally within a process.
bool expectExtraHeader(ConnectionState &proto) override
Receive any carrier-specific header.
bool setTypeOfService(int tos) override
A starter class for implementing simple carriers.
void write(const yarp::os::Bytes &b) override
Write a block of bytes to the stream.
void revoke(LocalCarrier *carrier)
A carrier for communicating locally within a process.
bool isConnectionless() const override
Check if this carrier is connectionless (like udp, mcast) or connection based (like tcp).
void interrupt() override
Interrupt the stream.
bool expectReplyToHeader(ConnectionState &proto) override
Process reply to header, if one is expected for this carrier.
void beginPacket() override
Mark the beginning of a logical packet.
const Contact & getLocalAddress() const override
Get the address of the local side of the stream.
OutputStream & getOutputStream() override
Get an OutputStream to write to.
void setParameters(const Bytes &header) override
Configure this carrier based on the first 8 bytes of the connection.
const Contact & getRemoteAddress() const override
Get the address of the remote side of the stream.
bool write(ConnectionState &proto, SizedWriter &writer) override
Write a message.
void endPacket() override
Mark the end of a logical packet (see beginPacket).
A stream for communicating locally within a process.
bool sendHeader(ConnectionState &proto) override
Write a header appropriate to the carrier to the connection, followed by any carrier-specific data.
static LocalCarrierManager manager
void setSender(LocalCarrier *sender)
bool canEscape() const override
Check if carrier can encode administrative messages, as opposed to just user data.
A simple abstraction for a block of bytes.
void reset() override
Reset the stream.
The basic state of a connection - route, streams in use, etc.
bool isOk() const override
Check if the stream is ok or in an error state.
void close() override
Terminate the stream.
void getHeader(Bytes &header) const override
Provide 8 bytes describing this connection sufficiently to allow the other side of a connection to se...
The main, catch-all namespace for YARP.
bool isLocal() const override
Check if carrier operates within a single process.
yarp::os::Semaphore received
InputStream & getInputStream() override
Get an InputStream to read from.
bool requireAck() const override
Check if carrier has flow control, requiring sent messages to be acknowledged by recipient.
std::string getName() const override
Get the name of this connection type ("tcp", "mcast", "shmem", ...)
virtual bool becomeLocal(ConnectionState &proto, bool sender)
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 expectIndex(ConnectionState &proto) override
Expect a message header, if there is one for this carrier.
Minimal requirements for an efficient Writer.