|
YARP
Yet Another Robot Platform
|
|
Go to the documentation of this file.
10 #ifndef YARP_OS_CARRIER_H
11 #define YARP_OS_CARRIER_H
15 #define YARP_ENACT_CONNECT 1
16 #define YARP_ENACT_DISCONNECT 2
17 #define YARP_ENACT_EXISTS 3
27 class ConnectionReader;
28 class ConnectionState;
115 bool isBroadcast()
const override;
157 void handleEnvelope(
const std::string& envelope)
override;
197 bool isPush()
const override;
297 void prepareDisconnect()
override;
310 virtual void close();
331 virtual std::string getBootstrapCarrierName()
const;
347 virtual int connect(
const Contact& src,
360 bool modifiesIncomingData()
const override;
393 bool modifiesOutgoingData()
const override;
413 bool modifiesReply()
const override;
430 bool acceptOutgoingData(
const PortWriter& writer)
override;
446 void setCarrierParams(
const Property& params)
override;
453 void getCarrierParams(
Property& params)
const override;
465 #endif // YARP_OS_CARRIER_H
void getHeader(Bytes &header) const override=0
Provide 8 bytes describing this connection sufficiently to allow the other side of a connection to se...
virtual bool sendAck(ConnectionState &proto)=0
Send an acknowledgement, if needed for this carrier.
bool canEscape() const override=0
Check if carrier can encode administrative messages, as opposed to just user data.
A base class for connection types (tcp, mcast, shmem, ...) which are called carriers in YARP.
virtual bool sendHeader(ConnectionState &proto)=0
Write a header appropriate to the carrier to the connection, followed by any carrier-specific data.
virtual bool prepareSend(ConnectionState &proto)=0
Perform any initialization needed before writing on a connection.
bool isActive() const override=0
Check if carrier is alive and error free.
virtual Carrier * create() const =0
Factory method.
virtual bool write(ConnectionState &proto, SizedWriter &writer)=0
Write a message.
virtual ~Carrier()
Destructor.
bool isConnectionless() const override=0
Check if this carrier is connectionless (like udp, mcast) or connection based (like tcp).
virtual bool expectSenderSpecifier(ConnectionState &proto)=0
Expect the name of the sending port.
bool isLocal() const override=0
Check if carrier operates within a single process.
bool requireAck() const override=0
Check if carrier has flow control, requiring sent messages to be acknowledged by recipient.
Interface implemented by all objects that can write themselves to the network, such as Bottle objects...
bool isTextMode() const override=0
Check if carrier is textual in nature.
virtual bool expectReplyToHeader(ConnectionState &proto)=0
Process reply to header, if one is expected for this carrier.
Interface implemented by all objects that can read themselves from the network, such as Bottle object...
virtual bool expectExtraHeader(ConnectionState &proto)=0
Receive any carrier-specific header.
virtual bool checkHeader(const Bytes &header)=0
Given the first 8 bytes received on a connection, decide if this is the right carrier type to use for...
virtual void setParameters(const Bytes &header)=0
Configure this carrier based on the first 8 bytes of the connection.
virtual bool expectAck(ConnectionState &proto)=0
Receive an acknowledgement, if expected for this carrier.
A simple abstraction for a block of bytes.
An interface for reading from a network connection.
The basic state of a connection - route, streams in use, etc.
virtual bool canOffer() const =0
Check if writing is implemented for this carrier.
The main, catch-all namespace for YARP.
virtual bool expectIndex(ConnectionState &proto)=0
Expect a message header, if there is one for this carrier.
A controller for an individual connection.
virtual std::string toString() const =0
Get name of carrier.
The initial point-of-contact with a port.
Minimal requirements for an efficient Writer.
A class for storing options and configuration information.
bool supportReply() const override=0
This flag is used by YARP to determine whether the connection can carry RPC traffic,...
virtual bool respondToHeader(ConnectionState &proto)=0
Respond to the header.
virtual bool canAccept() const =0
Check if reading is implemented for this carrier.