7#ifndef YARP_OS_CARRIER_H
8#define YARP_OS_CARRIER_H
12#define YARP_ENACT_CONNECT 1
13#define YARP_ENACT_DISCONNECT 2
14#define YARP_ENACT_EXISTS 3
23class ConnectionReader;
111 bool isBroadcast()
const override;
153 void handleEnvelope(
const std::string& envelope)
override;
193 bool isPush()
const override;
293 void prepareDisconnect()
override;
306 virtual void close();
327 virtual std::string getBootstrapCarrierName()
const;
343 virtual int connect(
const Contact& src,
356 bool modifiesIncomingData()
const override;
389 bool modifiesOutgoingData()
const override;
409 bool modifiesReply()
const override;
426 bool acceptOutgoingData(
const PortWriter& writer)
override;
442 void setCarrierParams(
const Property& params)
override;
449 void getCarrierParams(
Property& params)
const override;
A simple abstraction for a block of bytes.
A base class for connection types (tcp, mcast, shmem, ...) which are called carriers in YARP.
bool supportReply() const override=0
This flag is used by YARP to determine whether the connection can carry RPC traffic,...
bool isConnectionless() const override=0
Check if this carrier is connectionless (like udp, mcast) or connection based (like tcp).
virtual bool write(ConnectionState &proto, SizedWriter &writer)=0
Write a message.
virtual std::string toString() const =0
Get name of carrier.
virtual bool respondToHeader(ConnectionState &proto)=0
Respond to the header.
bool canEscape() const override=0
Check if carrier can encode administrative messages, as opposed to just user data.
bool requireAck() const override=0
Check if carrier has flow control, requiring sent messages to be acknowledged by recipient.
bool isTextMode() const override=0
Check if carrier is textual in nature.
virtual ~Carrier()
Destructor.
virtual bool expectSenderSpecifier(ConnectionState &proto)=0
Expect the name of the sending port.
bool isActive() const override=0
Check if carrier is alive and error free.
virtual bool sendHeader(ConnectionState &proto)=0
Write a header appropriate to the carrier to the connection, followed by any carrier-specific data.
virtual void setParameters(const Bytes &header)=0
Configure this carrier based on the first 8 bytes of the connection.
virtual bool expectExtraHeader(ConnectionState &proto)=0
Receive any carrier-specific header.
virtual bool expectIndex(ConnectionState &proto)=0
Expect a message header, if there is one for this carrier.
virtual bool expectAck(ConnectionState &proto)=0
Receive an acknowledgement, if expected for this carrier.
bool isLocal() const override=0
Check if carrier operates within a single process.
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 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 bool canAccept() const =0
Check if reading is implemented for this carrier.
virtual bool canOffer() const =0
Check if writing is implemented for this carrier.
virtual bool expectReplyToHeader(ConnectionState &proto)=0
Process reply to header, if one is expected for this carrier.
virtual Carrier * create() const =0
Factory method.
virtual bool prepareSend(ConnectionState &proto)=0
Perform any initialization needed before writing on a connection.
virtual bool sendAck(ConnectionState &proto)=0
Send an acknowledgement, if needed for this carrier.
An interface for reading from a network connection.
The basic state of a connection - route, streams in use, etc.
A controller for an individual connection.
The initial point-of-contact with a port.
Interface implemented by all objects that can read themselves from the network, such as Bottle object...
Interface implemented by all objects that can write themselves to the network, such as Bottle objects...
A class for storing options and configuration information.
Minimal requirements for an efficient Writer.
An interface to the operating system, including Port based communication.