YARP
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 24 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 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, yarp::os::OutputStream *os)
 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 (int flags)
 Configure the port to meet certain restrictions in behavior. More...
 
void setContactable (Contactable *contactable)
 
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)
 
void setVerbosity (int level)
 
int getVerbosity ()
 
PropertyacquireProperties (bool readOnly)
 
void releaseProperties (Property *prop)
 
bool setCallbackLock (yarp::os::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
 ThreadImpl ()
 
 ThreadImpl (Runnable *target)
 
virtual ~ThreadImpl ()
 
int join (double seconds=-1)
 
void run () override
 Body to run - could be periodic or continuous. More...
 
void close () override
 User-defined procedure for stopping execution. More...
 
void askToClose ()
 
bool isClosing ()
 
bool isRunning ()
 
void beforeStart () override
 Should be called from the creator before the thread exists and before a call that requested the thread returns. More...
 
void afterStart (bool success) override
 Should be called from the creator after the thread exists and before a call that requested the thread returns. More...
 
bool threadInit () override
 Initialization method. More...
 
void threadRelease () override
 Release method. More...
 
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::Runnable
virtual ~Runnable ()
 Destructor. More...
 
- Public Member Functions inherited from yarp::os::PortReader
virtual ~PortReader ()
 Destructor. More...
 
virtual Type getReadType () const
 

Public Attributes

bool includeNode
 
bool commitToRead
 
bool commitToWrite
 
bool commitToRpc
 
bool active
 
MutexrecCallbackLock
 
bool haveCallbackLock
 
- Public Attributes inherited from yarp::os::impl::ThreadImpl
long tid
 
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 15 of file PortCoreAdapter.cpp.

Member Function Documentation

◆ alertOnRead()

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

Definition at line 54 of file PortCoreAdapter.cpp.

◆ alertOnRpc()

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

Definition at line 64 of file PortCoreAdapter.cpp.

◆ alertOnWrite()

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

Definition at line 59 of file PortCoreAdapter.cpp.

◆ checkAdminPortReader()

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

Definition at line 310 of file PortCoreAdapter.cpp.

◆ checkPortReader()

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

Definition at line 305 of file PortCoreAdapter.cpp.

◆ checkReadCreator()

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

Definition at line 315 of file PortCoreAdapter.cpp.

◆ checkWaitAfterSend()

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

Definition at line 320 of file PortCoreAdapter.cpp.

◆ configAdminReader()

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

Definition at line 268 of file PortCoreAdapter.cpp.

◆ configCallbackLock()

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

Definition at line 291 of file PortCoreAdapter.cpp.

◆ configReadCreator()

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

Definition at line 276 of file PortCoreAdapter.cpp.

◆ configReader()

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

Definition at line 256 of file PortCoreAdapter.cpp.

◆ configWaitAfterSend()

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

Definition at line 282 of file PortCoreAdapter.cpp.

◆ finishReading()

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

Definition at line 84 of file PortCoreAdapter.cpp.

◆ finishWriting()

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

Definition at line 95 of file PortCoreAdapter.cpp.

◆ includeNodeInName()

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

Definition at line 336 of file PortCoreAdapter.cpp.

◆ isOpened()

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

Definition at line 326 of file PortCoreAdapter.cpp.

◆ openable()

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

Definition at line 46 of file PortCoreAdapter.cpp.

◆ read() [1/2]

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

Callback for data.

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

Definition at line 121 of file PortCoreAdapter.cpp.

◆ read() [2/2]

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

Definition at line 197 of file PortCoreAdapter.cpp.

◆ reply()

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

Definition at line 235 of file PortCoreAdapter.cpp.

◆ resumeFull()

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

Definition at line 111 of file PortCoreAdapter.cpp.

◆ setOpen()

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

Definition at line 331 of file PortCoreAdapter.cpp.

◆ setReadOnly()

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

Definition at line 69 of file PortCoreAdapter.cpp.

◆ setRpc()

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

Definition at line 79 of file PortCoreAdapter.cpp.

◆ setWriteOnly()

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

Definition at line 74 of file PortCoreAdapter.cpp.

◆ unconfigCallbackLock()

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

Definition at line 298 of file PortCoreAdapter.cpp.

Member Data Documentation

◆ active

bool yarp::os::impl::PortCoreAdapter::active

Definition at line 56 of file PortCoreAdapter.h.

◆ commitToRead

bool yarp::os::impl::PortCoreAdapter::commitToRead

Definition at line 53 of file PortCoreAdapter.h.

◆ commitToRpc

bool yarp::os::impl::PortCoreAdapter::commitToRpc

Definition at line 55 of file PortCoreAdapter.h.

◆ commitToWrite

bool yarp::os::impl::PortCoreAdapter::commitToWrite

Definition at line 54 of file PortCoreAdapter.h.

◆ haveCallbackLock

bool yarp::os::impl::PortCoreAdapter::haveCallbackLock

Definition at line 58 of file PortCoreAdapter.h.

◆ includeNode

bool yarp::os::impl::PortCoreAdapter::includeNode

Definition at line 52 of file PortCoreAdapter.h.

◆ recCallbackLock

Mutex* yarp::os::impl::PortCoreAdapter::recCallbackLock

Definition at line 57 of file PortCoreAdapter.h.


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