Yet Another Robot Platform
yarp::os::impl::PortCoreAdapter Class Reference

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

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

Public Member Functions

 PortCoreAdapter (Port &owner)
void openable ()
void alertOnRead ()
void alertOnWrite ()
void alertOnRpc ()
void setReadOnly ()
void setWriteOnly ()
void setRpc ()
void finishReading ()
void finishWriting ()
void resumeFull ()
bool read (ConnectionReader &reader) override
 Callback for data. More...
bool read (PortReader &reader, bool willReply=false)
bool reply (PortWriter &writer, bool drop, bool interrupted)
void configReader (PortReader &reader)
void configAdminReader (PortReader &reader)
void configReadCreator (PortReaderCreator &creator)
void configWaitAfterSend (bool waitAfterSend)
bool configCallbackLock (std::mutex *lock)
bool unconfigCallbackLock ()
PortReadercheckPortReader ()
PortReadercheckAdminPortReader ()
PortReaderCreatorcheckReadCreator ()
int checkWaitAfterSend ()
bool isOpened ()
void setOpen (bool opened)
void includeNodeInName (bool flag)
- Public Member Functions inherited from yarp::os::impl::PortCore
 PortCore ()
 Constructor. More...
 ~PortCore ()
 Destructor. More...
bool addOutput (const std::string &dest, void *id, yarp::os::OutputStream *os, bool onlyIfNeeded=false)
 Add an output connection to this port. More...
void addOutput (OutputProtocol *op)
 Add another output to the port. More...
void removeInput (const std::string &src, void *id, yarp::os::OutputStream *os)
 Remove an input connection. More...
void removeOutput (const std::string &dest, void *id, yarp::os::OutputStream *os)
 Remove an output connection. More...
bool removeIO (const Route &route, bool synch=false)
 Remove any connection matching the supplied route. More...
void describe (void *id, yarp::os::OutputStream *os)
 Produce a text description of the port and its connections. More...
void describe (yarp::os::PortReport &reporter)
 Generate a description of the connections associated with the port. More...
bool readBlock (ConnectionReader &reader, void *id, yarp::os::OutputStream *os)
 Read a block of regular payload data. More...
bool adminBlock (ConnectionReader &reader, void *id)
 Read a block of administrative data. More...
void setName (const std::string &name)
 Set the name of this port. More...
std::string getName ()
void setEnvelope (const std::string &envelope)
 Set some envelope information to pass along with a message without actually being part of the message. More...
bool setEnvelope (yarp::os::PortWriter &envelope)
 Set some extra meta data to pass along with the message. More...
std::string getEnvelope ()
bool getEnvelope (yarp::os::PortReader &envelope)
 Get any meta data associated with the last message received. More...
void report (const yarp::os::PortInfo &info)
 Handle a port event (connection, disconnection, etc) Generate a description of the connections associated with the port. More...
void reportUnit (PortCoreUnit *unit, bool active)
 Called by a connection handler with active=true just after it is fully configured, and with active=false just before it shuts itself down. More...
void setFlags (unsigned int flags)
 Configure the port to meet certain restrictions in behavior. More...
void setContactable (Contactable *contactable)
unsigned int getFlags ()
 Check current configuration of port. More...
bool listen (const Contact &address, bool shouldAnnounce=true)
 Begin service at a given address. More...
bool isWriting ()
 Check if a message is currently being sent. More...
int getInputCount ()
 Check how many input connections there are. More...
int getOutputCount ()
 Check how many output connections there are. More...
void setReadHandler (yarp::os::PortReader &reader)
 Set a callback for incoming data. More...
void setAdminReadHandler (yarp::os::PortReader &reader)
 Set a callback for incoming administrative messages. More...
void setReadCreator (yarp::os::PortReaderCreator &creator)
 Set a callback for creating callbacks for incoming data. More...
void setWaitBeforeSend (bool waitBeforeSend)
 Upon being asked to send a message, should we wait for any existing message to be sent to all destinations? More...
void setWaitAfterSend (bool waitAfterSend)
 After sending a message, should we wait for it to be sent to all destinations before returning? More...
bool read (yarp::os::ConnectionReader &reader) override
 Callback for data. More...
bool start () override
 Begin main thread. More...
bool manualStart (const char *sourceName)
 Start up the port, but without a main thread. More...
bool send (const yarp::os::PortWriter &writer, yarp::os::PortReader *reader=nullptr, const yarp::os::PortWriter *callback=nullptr)
 Send a normal message. More...
bool sendHelper (const yarp::os::PortWriter &writer, int mode, yarp::os::PortReader *reader=nullptr, const yarp::os::PortWriter *callback=nullptr)
 Send a message with a specific mode (normal or log). More...
void close () override
 Shut down port. More...
void run () override
 The body of the main thread. More...
int getEventCount ()
 A diagnostic for testing purposes. More...
const ContactgetAddress () const
 Get the address associated with the port. More...
void resetPortName (const std::string &str)
yarp::os::PortReaderCreatorgetReadCreator ()
 Get the creator of callbacks. More...
void notifyCompletion (void *tracker)
 Call the right onCompletion() after sending message. More...
void setControlRegistration (bool flag)
 Normally the port will unregister its name with the name server when shutting down. More...
void interrupt ()
 Prepare the port to be shut down. More...
void resume ()
 Undo an interrupt() More...
void setReportCallback (yarp::os::PortReport *reporter)
 Set a callback to be notified of changes in port status. More...
void resetReportCallback ()
 Reset the callback to be notified of changes in port status. More...
bool isListening () const
bool isManual () const
bool isInterrupted () const
void setTimeout (float timeout)
PropertyacquireProperties (bool readOnly)
void releaseProperties (Property *prop)
bool setCallbackLock (std::mutex *mutex=nullptr)
bool removeCallbackLock ()
bool lockCallback ()
bool tryLockCallback ()
void unlockCallback ()
yarp::os::impl::PortDataModifiergetPortModifier ()
void checkType (PortReader &reader)
yarp::os::Type getType ()
void promiseType (const Type &typ)
- 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 ()
- Public Member Functions inherited from yarp::os::PortReader
virtual ~PortReader ()
 Destructor. More...
virtual bool read (ConnectionReader &reader)=0
 Read this object from a network connection. More...
virtual Type getReadType () const

Public Attributes

bool includeNode { false }
bool commitToRead { false }
bool commitToWrite { false }
bool commitToRpc { false }
bool active { false }
std::mutex * recCallbackLock { nullptr }
bool haveCallbackLock { false }
- Public Attributes inherited from yarp::os::impl::ThreadImpl
long tid {-1}
std::thread::id id

Additional Inherited Members

- Static Public Member Functions inherited from yarp::os::impl::ThreadImpl
static int getCount ()
static long int getKeyOfCaller ()
static void yield ()

Detailed Description

Definition at line 17 of file PortCoreAdapter.h.

Constructor & Destructor Documentation

◆ PortCoreAdapter()

yarp::os::impl::PortCoreAdapter::PortCoreAdapter ( Port owner)

Definition at line 17 of file PortCoreAdapter.cpp.

Member Function Documentation

◆ alertOnRead()

void yarp::os::impl::PortCoreAdapter::alertOnRead ( )

Definition at line 30 of file PortCoreAdapter.cpp.

◆ alertOnRpc()

void yarp::os::impl::PortCoreAdapter::alertOnRpc ( )

Definition at line 40 of file PortCoreAdapter.cpp.

◆ alertOnWrite()

void yarp::os::impl::PortCoreAdapter::alertOnWrite ( )

Definition at line 35 of file PortCoreAdapter.cpp.

◆ checkAdminPortReader()

yarp::os::PortReader * yarp::os::impl::PortCoreAdapter::checkAdminPortReader ( )

Definition at line 286 of file PortCoreAdapter.cpp.

◆ checkPortReader()

yarp::os::PortReader * yarp::os::impl::PortCoreAdapter::checkPortReader ( )

Definition at line 281 of file PortCoreAdapter.cpp.

◆ checkReadCreator()

yarp::os::PortReaderCreator * yarp::os::impl::PortCoreAdapter::checkReadCreator ( )

Definition at line 291 of file PortCoreAdapter.cpp.

◆ checkWaitAfterSend()

int yarp::os::impl::PortCoreAdapter::checkWaitAfterSend ( )

Definition at line 296 of file PortCoreAdapter.cpp.

◆ configAdminReader()

void yarp::os::impl::PortCoreAdapter::configAdminReader ( PortReader reader)

Definition at line 244 of file PortCoreAdapter.cpp.

◆ configCallbackLock()

bool yarp::os::impl::PortCoreAdapter::configCallbackLock ( std::mutex *  lock)

Definition at line 267 of file PortCoreAdapter.cpp.

◆ configReadCreator()

void yarp::os::impl::PortCoreAdapter::configReadCreator ( PortReaderCreator creator)

Definition at line 252 of file PortCoreAdapter.cpp.

◆ configReader()

void yarp::os::impl::PortCoreAdapter::configReader ( PortReader reader)

Definition at line 232 of file PortCoreAdapter.cpp.

◆ configWaitAfterSend()

void yarp::os::impl::PortCoreAdapter::configWaitAfterSend ( bool  waitAfterSend)

Definition at line 258 of file PortCoreAdapter.cpp.

◆ finishReading()

void yarp::os::impl::PortCoreAdapter::finishReading ( )

Definition at line 60 of file PortCoreAdapter.cpp.

◆ finishWriting()

void yarp::os::impl::PortCoreAdapter::finishWriting ( )

Definition at line 71 of file PortCoreAdapter.cpp.

◆ includeNodeInName()

void yarp::os::impl::PortCoreAdapter::includeNodeInName ( bool  flag)

Definition at line 312 of file PortCoreAdapter.cpp.

◆ isOpened()

bool yarp::os::impl::PortCoreAdapter::isOpened ( )

Definition at line 302 of file PortCoreAdapter.cpp.

◆ openable()

void yarp::os::impl::PortCoreAdapter::openable ( )

Definition at line 22 of file PortCoreAdapter.cpp.

◆ read() [1/2]

bool yarp::os::impl::PortCoreAdapter::read ( ConnectionReader reader)

Callback for data.

Reimplemented from yarp::os::impl::PortCore.

Definition at line 97 of file PortCoreAdapter.cpp.

◆ read() [2/2]

bool yarp::os::impl::PortCoreAdapter::read ( PortReader reader,
bool  willReply = false 

Definition at line 173 of file PortCoreAdapter.cpp.

◆ reply()

bool yarp::os::impl::PortCoreAdapter::reply ( PortWriter writer,
bool  drop,
bool  interrupted 

Definition at line 211 of file PortCoreAdapter.cpp.

◆ resumeFull()

void yarp::os::impl::PortCoreAdapter::resumeFull ( )

Definition at line 87 of file PortCoreAdapter.cpp.

◆ setOpen()

void yarp::os::impl::PortCoreAdapter::setOpen ( bool  opened)

Definition at line 307 of file PortCoreAdapter.cpp.

◆ setReadOnly()

void yarp::os::impl::PortCoreAdapter::setReadOnly ( )

Definition at line 45 of file PortCoreAdapter.cpp.

◆ setRpc()

void yarp::os::impl::PortCoreAdapter::setRpc ( )

Definition at line 55 of file PortCoreAdapter.cpp.

◆ setWriteOnly()

void yarp::os::impl::PortCoreAdapter::setWriteOnly ( )

Definition at line 50 of file PortCoreAdapter.cpp.

◆ unconfigCallbackLock()

bool yarp::os::impl::PortCoreAdapter::unconfigCallbackLock ( )

Definition at line 274 of file PortCoreAdapter.cpp.

Member Data Documentation

◆ active

bool yarp::os::impl::PortCoreAdapter::active { false }

Definition at line 49 of file PortCoreAdapter.h.

◆ commitToRead

bool yarp::os::impl::PortCoreAdapter::commitToRead { false }

Definition at line 46 of file PortCoreAdapter.h.

◆ commitToRpc

bool yarp::os::impl::PortCoreAdapter::commitToRpc { false }

Definition at line 48 of file PortCoreAdapter.h.

◆ commitToWrite

bool yarp::os::impl::PortCoreAdapter::commitToWrite { false }

Definition at line 47 of file PortCoreAdapter.h.

◆ haveCallbackLock

bool yarp::os::impl::PortCoreAdapter::haveCallbackLock { false }

Definition at line 51 of file PortCoreAdapter.h.

◆ includeNode

bool yarp::os::impl::PortCoreAdapter::includeNode { false }

Definition at line 45 of file PortCoreAdapter.h.

◆ recCallbackLock

std::mutex* yarp::os::impl::PortCoreAdapter::recCallbackLock { nullptr }

Definition at line 50 of file PortCoreAdapter.h.

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