YARP
Yet Another Robot Platform
yarp::os::WireLink Class Reference

IDL-friendly object state, used in YARP to set up a port association. More...

#include <yarp/os/WireLink.h>

Detailed Description

IDL-friendly object state, used in YARP to set up a port association.

Definition at line 32 of file WireLink.h.

Classes

class  Private
 

Public Member Functions

 WireLink ()
 
 ~WireLink ()
 
bool isValid () const
 Check if there is an association of some kind set up for this WireLink. More...
 
bool setOwner (yarp::os::PortReader &owner)
 Set the owner of this WireLink. More...
 
bool attachAsClient (yarp::os::UnbufferedContactable &port)
 Tag this WireLink as a client, sending data via the specified port. More...
 
bool attachAsClient (yarp::os::PortReader &reader)
 Tag this WireLink as a client, sending data via the specified reader. More...
 
bool attachAsServer (yarp::os::UnbufferedContactable &port)
 Tag this WireLink as a server, receiving commands via the specified port. More...
 
bool setStreamingMode (bool streaming)
 For a client WireLink, control whether replies to commands are expected. More...
 
bool write (PortWriter &writer)
 Write a message to the associated port or reader. More...
 
bool write (PortWriter &writer, PortReader &reader)
 Write a message to the associated port or reader, and read a reply. More...
 
bool callback (PortWriter &writer, PortReader &reader, const std::string &tag="")
 Put a message in a stack to call later, asynchronously. More...
 
bool canWrite () const
 
bool canRead () const
 

Constructor & Destructor Documentation

◆ WireLink()

WireLink::WireLink ( )

Definition at line 63 of file WireLink.cpp.

◆ ~WireLink()

WireLink::~WireLink ( )

Definition at line 68 of file WireLink.cpp.

Member Function Documentation

◆ attachAsClient() [1/2]

bool WireLink::attachAsClient ( yarp::os::UnbufferedContactable port)

Tag this WireLink as a client, sending data via the specified port.

Parameters
portthe port to use when sending data.
Returns
true on success

Definition at line 84 of file WireLink.cpp.

◆ attachAsClient() [2/2]

bool WireLink::attachAsClient ( yarp::os::PortReader reader)

Tag this WireLink as a client, sending data via the specified reader.

Parameters
readerthe reader to use when sending data.
Returns
true on success

Definition at line 93 of file WireLink.cpp.

◆ attachAsServer()

bool WireLink::attachAsServer ( yarp::os::UnbufferedContactable port)

Tag this WireLink as a server, receiving commands via the specified port.

Parameters
portthe port to monitor for commands.
Returns
true on success

Definition at line 102 of file WireLink.cpp.

◆ callback()

bool WireLink::callback ( PortWriter writer,
PortReader reader,
const std::string &  tag = "" 
)

Put a message in a stack to call later, asynchronously.

Used in implementation of thrift "oneway" messages.

Parameters
writermessage to send
readerwhere to send the message
tagstring to prefix the message with
Returns
true on success

Definition at line 148 of file WireLink.cpp.

◆ canRead()

bool WireLink::canRead ( ) const
Returns
true if reading from the link is allowed.

Definition at line 160 of file WireLink.cpp.

◆ canWrite()

bool WireLink::canWrite ( ) const
Returns
true if writing is allowed over link.

Definition at line 155 of file WireLink.cpp.

◆ isValid()

bool WireLink::isValid ( ) const

Check if there is an association of some kind set up for this WireLink.

If not, data has nowhere to go.

Returns
True iff there is an association.

Definition at line 73 of file WireLink.cpp.

◆ setOwner()

bool WireLink::setOwner ( yarp::os::PortReader owner)

Set the owner of this WireLink.

Data sent to this link will be passed on to the owner.

Parameters
ownerowner of this WireLink
Returns
true on success

Definition at line 78 of file WireLink.cpp.

◆ setStreamingMode()

bool WireLink::setStreamingMode ( bool  streaming)

For a client WireLink, control whether replies to commands are expected.

Parameters
streamingtrue if replies are unnecessary.
Returns
true on success

Definition at line 112 of file WireLink.cpp.

◆ write() [1/2]

bool WireLink::write ( PortWriter writer)

Write a message to the associated port or reader.

Parameters
writerthe message to send.
Returns
true on success

Definition at line 118 of file WireLink.cpp.

◆ write() [2/2]

bool WireLink::write ( PortWriter writer,
PortReader reader 
)

Write a message to the associated port or reader, and read a reply.

Parameters
writerthe message to send.
readera recipient for the reply.
Returns
true on success

Definition at line 130 of file WireLink.cpp.


The documentation for this class was generated from the following files: