71 return mPriv->port !=
nullptr || mPriv->reader !=
nullptr;
76 mPriv->owner = &owner;
83 mPriv->attach(port, style);
84 mPriv->can_write =
true;
85 mPriv->can_read =
false;
92 mPriv->reader = &reader;
93 mPriv->can_write =
true;
94 mPriv->can_read =
false;
101 mPriv->attach(port, style);
103 mPriv->can_write =
false;
104 mPriv->can_read =
true;
116 if (mPriv->reader !=
nullptr) {
124 return mPriv->port->write(writer);
129 if (mPriv->reader !=
nullptr) {
139 if (!mPriv->replies) {
140 mPriv->port->
write(writer);
143 return mPriv->port->
write(writer, reader);
148 mPriv->stack.attach(reader);
149 mPriv->stack.stack(writer, tag);
155 return mPriv->can_write;
160 return mPriv->can_read;
yarp::os::MessageStack stack
yarp::os::UnbufferedContactable * port
yarp::os::PortReader * reader
bool attach(yarp::os::UnbufferedContactable &port, const yarp::os::ContactStyle &style)
yarp::os::PortReader * owner
A mini-server for performing network communication in the background.
T * read(bool shouldWait=true) override
Read an available object from the port.
A dummy connection to test yarp::os::Portable implementations.
ConnectionWriter & getWriter()
Get the dummy ConnectionWriter loaded with whatever was written the ConnectionWriter since it was las...
ConnectionReader & getReader(ConnectionWriter *replyWriter=nullptr)
Get the dummy ConnectionReader loaded with whatever was written the ConnectionWriter since it was las...
Maintain a stack of messages to send asynchronously.
Interface implemented by all objects that can read themselves from the network, such as Bottle object...
virtual bool read(ConnectionReader &reader)=0
Read this object from a network connection.
Interface implemented by all objects that can write themselves to the network, such as Bottle objects...
virtual bool write(ConnectionWriter &writer) const =0
Write this object to a network connection.
bool write(const PortWriter &writer, const PortWriter *callback=nullptr) const override
Write an object to the port.
IDL-friendly object state, used in YARP to set up a port association.
bool write(PortWriter &writer)
Write a message to the associated port or reader.
bool callback(PortWriter &writer, PortReader &reader, const std::string &tag="")
Put a message in a stack to call later, asynchronously.
bool attachAsServer(yarp::os::UnbufferedContactable &port)
Tag this WireLink as a server, receiving commands via the specified port.
bool setOwner(yarp::os::PortReader &owner)
Set the owner of this WireLink.
bool attachAsClient(yarp::os::UnbufferedContactable &port)
Tag this WireLink as a client, sending data via the specified port.
bool isValid() const
Check if there is an association of some kind set up for this WireLink.
bool setStreamingMode(bool streaming)
For a client WireLink, control whether replies to commands are expected.