YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
yarp::os::WireLink Class Reference

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

#include <yarp/os/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.
 
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 attachAsClient (yarp::os::PortReader &reader)
 Tag this WireLink as a client, sending data via the specified reader.
 
bool attachAsServer (yarp::os::UnbufferedContactable &port)
 Tag this WireLink as a server, receiving commands via the specified port.
 
bool setStreamingMode (bool streaming)
 For a client WireLink, control whether replies to commands are expected.
 
bool write (PortWriter &writer)
 Write a message to the associated port or reader.
 
bool write (const PortWriter &writer, PortReader &reader) const
 Write a message to the associated port or reader, and read a reply.
 
bool callback (PortWriter &writer, PortReader &reader, const std::string &tag="")
 Put a message in a stack to call later, asynchronously.
 
bool canWrite () const
 
bool canRead () const
 

Detailed Description

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

Definition at line 22 of file WireLink.h.

Constructor & Destructor Documentation

◆ WireLink()

WireLink::WireLink ( )

Definition at line 59 of file WireLink.cpp.

◆ ~WireLink()

WireLink::~WireLink ( )

Definition at line 64 of file WireLink.cpp.

Member Function Documentation

◆ attachAsClient() [1/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 89 of file WireLink.cpp.

◆ attachAsClient() [2/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 80 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 98 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 146 of file WireLink.cpp.

◆ canRead()

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

Definition at line 158 of file WireLink.cpp.

◆ canWrite()

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

Definition at line 153 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 69 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 74 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 108 of file WireLink.cpp.

◆ write() [1/2]

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

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 127 of file WireLink.cpp.

◆ write() [2/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 114 of file WireLink.cpp.


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