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

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

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

Detailed Description

Definition at line 29 of file PortCoreAdapter.h.

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 (Mutex *lock)
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 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 (yarp::os::Mutex *mutex)
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)
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 ()
- Public Member Functions inherited from yarp::os::PortReader
virtual ~PortReader ()
 Destructor. 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 }
yarp::os::Mutexold_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 ()

Constructor & Destructor Documentation

◆ PortCoreAdapter()

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

Definition at line 20 of file PortCoreAdapter.cpp.

Member Function Documentation

◆ alertOnRead()

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

Definition at line 33 of file PortCoreAdapter.cpp.

◆ alertOnRpc()

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

Definition at line 43 of file PortCoreAdapter.cpp.

◆ alertOnWrite()

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

Definition at line 38 of file PortCoreAdapter.cpp.

◆ checkAdminPortReader()

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

Definition at line 308 of file PortCoreAdapter.cpp.

◆ checkPortReader()

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

Definition at line 303 of file PortCoreAdapter.cpp.

◆ checkReadCreator()

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

Definition at line 313 of file PortCoreAdapter.cpp.

◆ checkWaitAfterSend()

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

Definition at line 318 of file PortCoreAdapter.cpp.

◆ configAdminReader()

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

Definition at line 247 of file PortCoreAdapter.cpp.

◆ configCallbackLock() [1/2]

bool yarp::os::impl::PortCoreAdapter::configCallbackLock ( Mutex lock)

Definition at line 273 of file PortCoreAdapter.cpp.

◆ configCallbackLock() [2/2]

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

Definition at line 283 of file PortCoreAdapter.cpp.

◆ configReadCreator()

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

Definition at line 255 of file PortCoreAdapter.cpp.

◆ configReader()

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

Definition at line 235 of file PortCoreAdapter.cpp.

◆ configWaitAfterSend()

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

Definition at line 261 of file PortCoreAdapter.cpp.

◆ finishReading()

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

Definition at line 63 of file PortCoreAdapter.cpp.

◆ finishWriting()

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

Definition at line 74 of file PortCoreAdapter.cpp.

◆ includeNodeInName()

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

Definition at line 334 of file PortCoreAdapter.cpp.

◆ isOpened()

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

Definition at line 324 of file PortCoreAdapter.cpp.

◆ openable()

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

Definition at line 25 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 100 of file PortCoreAdapter.cpp.

◆ read() [2/2]

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

Definition at line 176 of file PortCoreAdapter.cpp.

◆ reply()

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

Definition at line 214 of file PortCoreAdapter.cpp.

◆ resumeFull()

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

Definition at line 90 of file PortCoreAdapter.cpp.

◆ setOpen()

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

Definition at line 329 of file PortCoreAdapter.cpp.

◆ setReadOnly()

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

Definition at line 48 of file PortCoreAdapter.cpp.

◆ setRpc()

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

Definition at line 58 of file PortCoreAdapter.cpp.

◆ setWriteOnly()

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

Definition at line 53 of file PortCoreAdapter.cpp.

◆ unconfigCallbackLock()

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

Definition at line 293 of file PortCoreAdapter.cpp.

Member Data Documentation

◆ active

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

Definition at line 61 of file PortCoreAdapter.h.

◆ commitToRead

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

Definition at line 58 of file PortCoreAdapter.h.

◆ commitToRpc

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

Definition at line 60 of file PortCoreAdapter.h.

◆ commitToWrite

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

Definition at line 59 of file PortCoreAdapter.h.

◆ haveCallbackLock

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

Definition at line 69 of file PortCoreAdapter.h.

◆ includeNode

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

Definition at line 57 of file PortCoreAdapter.h.

◆ old_recCallbackLock

yarp::os::Mutex* yarp::os::impl::PortCoreAdapter::old_recCallbackLock { nullptr }

Definition at line 66 of file PortCoreAdapter.h.

◆ recCallbackLock

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

Definition at line 62 of file PortCoreAdapter.h.

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