This manages a single threaded resource related to a single input or output connection. More...
#include <yarp/os/impl/PortCoreUnit.h>
Public Member Functions | |
PortCoreUnit (PortCore &owner, int index) | |
Constructor. | |
virtual | ~PortCoreUnit () |
Destructor. | |
virtual bool | isInput () |
virtual bool | isOutput () |
virtual bool | isFinished () |
virtual Route | getRoute () |
bool | isDoomed () |
void | setDoomed () |
Request that this connection be shut down as soon as possible. | |
virtual void * | send (const yarp::os::PortWriter &writer, yarp::os::PortReader *reader, const yarp::os::PortWriter *callback, void *tracker, const std::string &envelope, bool waitAfter=true, bool waitBefore=true, bool *gotReply=nullptr) |
Send a message on the connection. | |
virtual void * | takeTracker () |
Reacquire a tracker previously passed via send(). | |
virtual bool | isBusy () |
virtual bool | interrupt () |
Interrupt the connection. | |
void | setMode () |
Check the carrier used for the connection, and see if it has a "log" modifier. | |
int | getIndex () |
std::string | getMode (bool *hasMode=nullptr) |
Read the "mode" of the connection - basically, whether it is used for logging or not. | |
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. | |
virtual void | setCarrierParams (const yarp::os::Property ¶ms) |
Set arbitrary parameters for this connection. | |
virtual void | getCarrierParams (yarp::os::Property ¶ms) |
Public Member Functions inherited from yarp::os::impl::ThreadImpl | |
virtual | ~ThreadImpl () |
int | join (double seconds=-1) |
virtual void | run () |
virtual void | close () |
void | askToClose () |
virtual bool | start () |
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 () |
Protected Member Functions | |
PortCore & | getOwner () |
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 |
This manages a single threaded resource related to a single input or output connection.
Definition at line 23 of file PortCoreUnit.h.
Constructor.
owner | the port we call home |
index | an id for this connection |
Definition at line 33 of file PortCoreUnit.h.
|
inlinevirtual |
Destructor.
Definition at line 45 of file PortCoreUnit.h.
|
inlinevirtual |
[out] |
parameters set by setCarrierParams()
Reimplemented in yarp::os::impl::PortCoreInputUnit, and yarp::os::impl::PortCoreOutputUnit.
Definition at line 264 of file PortCoreUnit.h.
|
inline |
Definition at line 193 of file PortCoreUnit.h.
|
inline |
Read the "mode" of the connection - basically, whether it is used for logging or not.
hasMode | optional variable to store whether a mode has been set |
Definition at line 206 of file PortCoreUnit.h.
|
inlineprotected |
Definition at line 274 of file PortCoreUnit.h.
|
inline |
publisherUpdate
message to the port's administrative interface. We need to know this so we can remove it if a succeeding call to publisherUpdate
does not mention the target this connection is serving. Definition at line 232 of file PortCoreUnit.h.
Reimplemented in yarp::os::impl::PortCoreInputUnit, and yarp::os::impl::PortCoreOutputUnit.
Definition at line 78 of file PortCoreUnit.h.
Interrupt the connection.
Reimplemented in yarp::os::impl::PortCoreInputUnit.
Definition at line 172 of file PortCoreUnit.h.
Reimplemented in yarp::os::impl::PortCoreInputUnit, and yarp::os::impl::PortCoreOutputUnit.
Definition at line 162 of file PortCoreUnit.h.
|
inline |
Definition at line 87 of file PortCoreUnit.h.
Reimplemented in yarp::os::impl::PortCoreInputUnit, and yarp::os::impl::PortCoreOutputUnit.
Definition at line 69 of file PortCoreUnit.h.
Reimplemented in yarp::os::impl::PortCoreInputUnit.
Definition at line 52 of file PortCoreUnit.h.
Reimplemented in yarp::os::impl::PortCoreOutputUnit.
Definition at line 60 of file PortCoreUnit.h.
|
inline |
publisherUpdate
message to the port's administrative interface. We need to know this so we can remove it if a succeeding call to publisherUpdate
does not mention the target this connection is serving. Definition at line 220 of file PortCoreUnit.h.
|
inlinevirtual |
Send a message on the connection.
Does nothing for an input connection.
writer | the message the send |
reader | an optional receiver for a reply |
callback | an optional receiver for PortWriter::onCommencement and PortWriter::onCompletion calls |
tracker | an 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(). |
envelope | some optional text to pass along with the message |
waitAfter | true if we should wait for the send to complete before the method returns |
waitBefore | true 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 |
Reimplemented in yarp::os::impl::PortCoreOutputUnit.
Definition at line 125 of file PortCoreUnit.h.
|
inlinevirtual |
Set arbitrary parameters for this connection.
params | the parameters to set |
Reimplemented in yarp::os::impl::PortCoreInputUnit, and yarp::os::impl::PortCoreOutputUnit.
Definition at line 256 of file PortCoreUnit.h.
|
inline |
Request that this connection be shut down as soon as possible.
Definition at line 95 of file PortCoreUnit.h.
|
inline |
Check the carrier used for the connection, and see if it has a "log" modifier.
If so, set the connection "mode" from that modifier. A connection for which a mode is set will behave differently, sending log information on port activity rather than regular payload data.
Definition at line 184 of file PortCoreUnit.h.
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.
We need to know this so we can remove the connection if a succeeding call to publisherUpdate
does not mention the target this connection is serving.
Definition at line 246 of file PortCoreUnit.h.
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.
Reimplemented in yarp::os::impl::PortCoreOutputUnit.
Definition at line 154 of file PortCoreUnit.h.