YARP
Yet Another Robot Platform
yarp::os::impl::PortCoreOutputUnit Class Reference

Manager for a single output from a port. More...

#include <yarp/os/impl/PortCoreOutputUnit.h>

+ Inheritance diagram for yarp::os::impl::PortCoreOutputUnit:

Public Member Functions

 PortCoreOutputUnit (PortCore &owner, int index, OutputProtocol *op)
 Constructor. More...
 
 ~PortCoreOutputUnit () override
 Destructor. More...
 
bool start () override
 Prepare to serve this output. More...
 
void run () override
 The body of a thread managing background sends. More...
 
virtual void runSingleThreaded ()
 Perform send operations without a separate thread. More...
 
bool isOutput () override
 
void close () override
 
bool isFinished () override
 
Route getRoute () override
 
void * send (const yarp::os::PortWriter &writer, yarp::os::PortReader *reader, const yarp::os::PortWriter *callback, void *tracker, const std::string &envelopeString, bool waitAfter, bool waitBefore, bool *gotReply) override
 Send a message on the connection. More...
 
void * takeTracker () override
 Reacquire a tracker previously passed via send(). More...
 
bool isBusy () override
 
void setCarrierParams (const yarp::os::Property &params) override
 Set arbitrary parameters for this connection. More...
 
void getCarrierParams (yarp::os::Property &params) override
 
OutputProtocolgetOutPutProtocol ()
 
- Public Member Functions inherited from yarp::os::impl::PortCoreUnit
 PortCoreUnit (PortCore &owner, int index)
 Constructor. More...
 
virtual ~PortCoreUnit ()
 Destructor. More...
 
virtual bool isInput ()
 
bool isDoomed ()
 
void setDoomed ()
 Request that this connection be shut down as soon as possible. More...
 
virtual bool interrupt ()
 Interrupt the connection. More...
 
void setMode ()
 Check the carrier used for the connection, and see if it has a "log" modifier. More...
 
int getIndex ()
 
std::string getMode (bool *hasMode=nullptr)
 Read the "mode" of the connection - basically, whether it is used for logging or not. More...
 
bool isPupped () const
 
std::string getPupString () const
 
void setPupped (const std::string &pupString)
 Tag this connection as having been created by a publisherUpdate message to the port's administrative interface, and record the name of the target it services exactly as described in that message. More...
 
- Public Member Functions inherited from yarp::os::impl::ThreadImpl
virtual ~ThreadImpl ()
 
int join (double seconds=-1)
 
void askToClose ()
 
bool isClosing ()
 
bool isRunning ()
 
virtual void beforeStart ()
 
virtual void afterStart (bool success)
 
virtual bool threadInit ()
 
virtual void threadRelease ()
 
long int getKey ()
 
void notify (bool s)
 
void notifyOpened (bool s)
 
void synchroWait ()
 
void synchroPost ()
 
int setPriority (int priority=-1, int policy=-1)
 
int getPriority ()
 
int getPolicy ()
 
long getTid ()
 

Additional Inherited Members

- Static Public Member Functions inherited from yarp::os::impl::ThreadImpl
static int getCount ()
 
static long int getKeyOfCaller ()
 
static void yield ()
 
- Public Attributes inherited from yarp::os::impl::ThreadImpl
long tid {-1}
 
std::thread::id id
 
- Protected Member Functions inherited from yarp::os::impl::PortCoreUnit
PortCoregetOwner ()
 

Detailed Description

Manager for a single output from a port.

Associated with a PortCore object.

Definition at line 28 of file PortCoreOutputUnit.h.

Constructor & Destructor Documentation

◆ PortCoreOutputUnit()

PortCoreOutputUnit::PortCoreOutputUnit ( PortCore owner,
int  index,
OutputProtocol op 
)

Constructor.

Parameters
ownerthe port we call home
indexan id for this connection
opthe protocol object used to read/write to connection

Definition at line 28 of file PortCoreOutputUnit.cpp.

◆ ~PortCoreOutputUnit()

PortCoreOutputUnit::~PortCoreOutputUnit ( )
override

Destructor.

Definition at line 47 of file PortCoreOutputUnit.cpp.

Member Function Documentation

◆ close()

void yarp::os::impl::PortCoreOutputUnit::close ( )
inlineoverridevirtual

Reimplemented from yarp::os::impl::ThreadImpl.

Definition at line 70 of file PortCoreOutputUnit.h.

◆ getCarrierParams()

void PortCoreOutputUnit::getCarrierParams ( yarp::os::Property params)
overridevirtual
Parameters
[out]

Reimplemented from yarp::os::impl::PortCoreUnit.

Definition at line 433 of file PortCoreOutputUnit.cpp.

◆ getOutPutProtocol()

OutputProtocol * PortCoreOutputUnit::getOutPutProtocol ( )

Definition at line 440 of file PortCoreOutputUnit.cpp.

◆ getRoute()

Route PortCoreOutputUnit::getRoute ( )
overridevirtual
Returns
the route (sender, receiver, carrier) associated with this connection

Reimplemented from yarp::os::impl::PortCoreUnit.

Definition at line 245 of file PortCoreOutputUnit.cpp.

◆ isBusy()

bool PortCoreOutputUnit::isBusy ( )
overridevirtual
Returns
true if the connection is currently in use.

Reimplemented from yarp::os::impl::PortCoreUnit.

Definition at line 421 of file PortCoreOutputUnit.cpp.

◆ isFinished()

bool yarp::os::impl::PortCoreOutputUnit::isFinished ( )
inlineoverridevirtual
Returns
true if no further communication will occur using this connection

Reimplemented from yarp::os::impl::PortCoreUnit.

Definition at line 76 of file PortCoreOutputUnit.h.

◆ isOutput()

bool yarp::os::impl::PortCoreOutputUnit::isOutput ( )
inlineoverridevirtual
Returns
true if this is an output connection

Reimplemented from yarp::os::impl::PortCoreUnit.

Definition at line 64 of file PortCoreOutputUnit.h.

◆ run()

void PortCoreOutputUnit::run ( )
overridevirtual

The body of a thread managing background sends.

Reimplemented from yarp::os::impl::ThreadImpl.

Definition at line 77 of file PortCoreOutputUnit.cpp.

◆ runSingleThreaded()

void PortCoreOutputUnit::runSingleThreaded ( )
virtual

Perform send operations without a separate thread.

Definition at line 119 of file PortCoreOutputUnit.cpp.

◆ send()

void * PortCoreOutputUnit::send ( const yarp::os::PortWriter writer,
yarp::os::PortReader reader,
const yarp::os::PortWriter callback,
void *  tracker,
const std::string &  envelope,
bool  waitAfter,
bool  waitBefore,
bool *  gotReply 
)
overridevirtual

Send a message on the connection.

Does nothing for an input connection.

Parameters
writerthe message the send
readeran optional receiver for a reply
callbackan optional receiver for PortWriter::onCommencement and PortWriter::onCompletion calls
trackeran opaque pointer to an object doing memory management for the message. Once this pointer is passed to the send() method, it is "owned" until returned by a future call to send(), or by a call to takeTracker().
envelopesome optional text to pass along with the message
waitAftertrue if we should wait for the send to complete before the method returns
waitBeforetrue if we should wait for any in-progress send to complete before stating this one @parm gotReply if non-nullptr, this variable will be set to true if a reply was received
Returns
nullptr, or a tracker for a previous send operation that is no longer in progress. The tracker is an opaque pointer passed in via a previous call to send(). Once it is returned, it is the caller's responsibility to manage any memory associated with the message.

Reimplemented from yarp::os::impl::PortCoreUnit.

Definition at line 346 of file PortCoreOutputUnit.cpp.

◆ setCarrierParams()

void PortCoreOutputUnit::setCarrierParams ( const yarp::os::Property params)
overridevirtual

Set arbitrary parameters for this connection.

Parameters
paramsthe parameters to set

Reimplemented from yarp::os::impl::PortCoreUnit.

Definition at line 426 of file PortCoreOutputUnit.cpp.

◆ start()

bool PortCoreOutputUnit::start ( )
overridevirtual

Prepare to serve this output.

A thread will start if a call to send() has been made with options that require a thread.

Reimplemented from yarp::os::impl::ThreadImpl.

Definition at line 53 of file PortCoreOutputUnit.cpp.

◆ takeTracker()

void * PortCoreOutputUnit::takeTracker ( )
overridevirtual

Reacquire a tracker previously passed via send().

This method may need to wait a send operation to complete before the tracker can be safely accessed.

Returns
the opaque tracker pointer passed to a previous call to send(), or nullptr if there is no such tracker. Once the tracker has been returned, calling this method again will return nullptr.

Reimplemented from yarp::os::impl::PortCoreUnit.

Definition at line 409 of file PortCoreOutputUnit.cpp.


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