This manages a single threaded resource related to a single input or output connection.
More...
#include <yarp/os/impl/PortCoreUnit.h>
|
| PortCoreUnit (PortCore &owner, int index) |
| Constructor. More...
|
|
virtual | ~PortCoreUnit () |
| Destructor. More...
|
|
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. More...
|
|
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. More...
|
|
virtual void * | takeTracker () |
| Reacquire a tracker previously passed via send(). More...
|
|
virtual bool | isBusy () |
|
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...
|
|
virtual void | setCarrierParams (const yarp::os::Property ¶ms) |
| Set arbitrary parameters for this connection. More...
|
|
virtual void | getCarrierParams (yarp::os::Property ¶ms) |
|
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 () |
|
This manages a single threaded resource related to a single input or output connection.
Definition at line 28 of file PortCoreUnit.h.
◆ PortCoreUnit()
yarp::os::impl::PortCoreUnit::PortCoreUnit |
( |
PortCore & |
owner, |
|
|
int |
index |
|
) |
| |
|
inline |
Constructor.
- Parameters
-
owner | the port we call home |
index | an id for this connection |
Definition at line 38 of file PortCoreUnit.h.
◆ ~PortCoreUnit()
virtual yarp::os::impl::PortCoreUnit::~PortCoreUnit |
( |
| ) |
|
|
inlinevirtual |
◆ getCarrierParams()
virtual void yarp::os::impl::PortCoreUnit::getCarrierParams |
( |
yarp::os::Property & |
params | ) |
|
|
inlinevirtual |
◆ getIndex()
int yarp::os::impl::PortCoreUnit::getIndex |
( |
| ) |
|
|
inline |
- Returns
- the index identifier supplied to the constructor.
Definition at line 198 of file PortCoreUnit.h.
◆ getMode()
std::string yarp::os::impl::PortCoreUnit::getMode |
( |
bool * |
hasMode = nullptr | ) |
|
|
inline |
Read the "mode" of the connection - basically, whether it is used for logging or not.
- Parameters
-
hasMode | optional variable to store whether a mode has been set |
- Returns
- the connection mode, or the empty string if there is none
Definition at line 211 of file PortCoreUnit.h.
◆ getOwner()
PortCore& yarp::os::impl::PortCoreUnit::getOwner |
( |
| ) |
|
|
inlineprotected |
- Returns
- the port to which this connection belongs
Definition at line 279 of file PortCoreUnit.h.
◆ getPupString()
std::string yarp::os::impl::PortCoreUnit::getPupString |
( |
| ) |
const |
|
inline |
- Returns
- the target this connection is serving, if created via a
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 237 of file PortCoreUnit.h.
◆ getRoute()
virtual Route yarp::os::impl::PortCoreUnit::getRoute |
( |
| ) |
|
|
inlinevirtual |
◆ interrupt()
virtual bool yarp::os::impl::PortCoreUnit::interrupt |
( |
| ) |
|
|
inlinevirtual |
◆ isBusy()
virtual bool yarp::os::impl::PortCoreUnit::isBusy |
( |
| ) |
|
|
inlinevirtual |
◆ isDoomed()
bool yarp::os::impl::PortCoreUnit::isDoomed |
( |
| ) |
|
|
inline |
◆ isFinished()
virtual bool yarp::os::impl::PortCoreUnit::isFinished |
( |
| ) |
|
|
inlinevirtual |
◆ isInput()
virtual bool yarp::os::impl::PortCoreUnit::isInput |
( |
| ) |
|
|
inlinevirtual |
◆ isOutput()
virtual bool yarp::os::impl::PortCoreUnit::isOutput |
( |
| ) |
|
|
inlinevirtual |
◆ isPupped()
bool yarp::os::impl::PortCoreUnit::isPupped |
( |
| ) |
const |
|
inline |
- Returns
- true if this connection was created by a
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 225 of file PortCoreUnit.h.
◆ send()
Send a message on the connection.
Does nothing for an input connection.
- Parameters
-
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 |
- 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 in yarp::os::impl::PortCoreOutputUnit.
Definition at line 130 of file PortCoreUnit.h.
◆ setCarrierParams()
virtual void yarp::os::impl::PortCoreUnit::setCarrierParams |
( |
const yarp::os::Property & |
params | ) |
|
|
inlinevirtual |
◆ setDoomed()
void yarp::os::impl::PortCoreUnit::setDoomed |
( |
| ) |
|
|
inline |
Request that this connection be shut down as soon as possible.
Definition at line 100 of file PortCoreUnit.h.
◆ setMode()
void yarp::os::impl::PortCoreUnit::setMode |
( |
| ) |
|
|
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 189 of file PortCoreUnit.h.
◆ setPupped()
void yarp::os::impl::PortCoreUnit::setPupped |
( |
const std::string & |
pupString | ) |
|
|
inline |
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 251 of file PortCoreUnit.h.
◆ takeTracker()
virtual void* yarp::os::impl::PortCoreUnit::takeTracker |
( |
| ) |
|
|
inlinevirtual |
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 in yarp::os::impl::PortCoreOutputUnit.
Definition at line 159 of file PortCoreUnit.h.
The documentation for this class was generated from the following file: