YARP
Yet Another Robot Platform
RFModuleRespondHandler Class Reference
+ Inheritance diagram for RFModuleRespondHandler:

Public Member Functions

bool read (yarp::os::ConnectionReader &connection) override
 Handler for reading messages from the network, and passing them on to the respond() method. More...
 
 RFModuleRespondHandler (RFModule &owner)
 
void run () override
 Main body of the new thread. More...
 
bool attach (yarp::os::Port &source)
 
bool attach (yarp::os::RpcServer &source)
 
bool attachTerminal ()
 
bool isTerminalAttached ()
 
bool detachTerminal ()
 
- Public Member Functions inherited from yarp::os::PortReader
virtual ~PortReader ()
 Destructor. More...
 
virtual Type getReadType () const
 
- Public Member Functions inherited from yarp::os::Thread
 Thread ()
 Constructor. More...
 
virtual ~Thread ()
 Destructor. More...
 
virtual void onStop ()
 Call-back, called while halting the thread (before join). More...
 
bool start ()
 Start the new thread running. More...
 
bool stop ()
 Stop the thread. More...
 
virtual void beforeStart ()
 Called just before a new thread starts. More...
 
virtual void afterStart (bool success)
 Called just after a new thread starts (or fails to start), this is executed by the same thread that calls start(). More...
 
virtual bool threadInit ()
 Initialization method. More...
 
virtual void threadRelease ()
 Release method. More...
 
bool isStopping ()
 Returns true if the thread is stopping (Thread::stop has been called). More...
 
bool isRunning ()
 Returns true if the thread is running (Thread::start has been called successfully and the thread has not stopped). More...
 
long int getKey ()
 Get a unique identifier for the thread. More...
 
int setPriority (int priority, int policy=-1)
 Set the priority and scheduling policy of the thread, if the OS supports that. More...
 
int getPriority ()
 Query the current priority of the thread, if the OS supports that. More...
 
int getPolicy ()
 Query the current scheduling policy of the thread, if the OS supports that. More...
 
bool join (double seconds=-1)
 The function returns when the thread execution has completed. More...
 
void setOptions (int stackSize=0)
 Set the stack size for the new thread. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from yarp::os::Thread
static int getCount ()
 Check how many threads are running. More...
 
static long int getKeyOfCaller ()
 Get a unique identifier for the calling thread. More...
 
static void yield ()
 Reschedule the execution of current thread, allowing other threads to run. More...
 
static void setDefaultStackSize (int stackSize)
 Set the default stack size for all threads created after this point. More...
 

Detailed Description

Definition at line 35 of file RFModule.cpp.

Constructor & Destructor Documentation

◆ RFModuleRespondHandler()

RFModuleRespondHandler::RFModuleRespondHandler ( RFModule owner)
inline

Definition at line 54 of file RFModule.cpp.

Member Function Documentation

◆ attach() [1/2]

bool RFModuleRespondHandler::attach ( yarp::os::Port source)
inline

Definition at line 92 of file RFModule.cpp.

◆ attach() [2/2]

bool RFModuleRespondHandler::attach ( yarp::os::RpcServer source)
inline

Definition at line 100 of file RFModule.cpp.

◆ attachTerminal()

bool RFModuleRespondHandler::attachTerminal ( )
inline

Definition at line 108 of file RFModule.cpp.

◆ detachTerminal()

bool RFModuleRespondHandler::detachTerminal ( )
inline

Definition at line 123 of file RFModule.cpp.

◆ isTerminalAttached()

bool RFModuleRespondHandler::isTerminalAttached ( )
inline

Definition at line 117 of file RFModule.cpp.

◆ read()

bool RFModuleRespondHandler::read ( yarp::os::ConnectionReader connection)
overridevirtual

Handler for reading messages from the network, and passing them on to the respond() method.

Parameters
connectiona network connection to a port
Returns
true if the message was read successfully

Implements yarp::os::PortReader.

Definition at line 132 of file RFModule.cpp.

◆ run()

void RFModuleRespondHandler::run ( )
inlineoverridevirtual

Main body of the new thread.

Override this method to do what you want. After Thread::start is called, this method will start running in a separate thread. It is important that this method either keeps checking Thread::isStopping to see if it should stop, or you override the Thread::onStop method to interact with it in some way to shut the new thread down. There is no really reliable, portable way to stop a thread cleanly unless that thread cooperates.

Implements yarp::os::Thread.

Definition at line 62 of file RFModule.cpp.


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