YARP
Yet Another Robot Platform
RunReadWrite Class Reference

#include <yarp/run/impl/RunReadWrite.h>

+ Inheritance diagram for RunReadWrite:

Public Member Functions

 RunReadWrite (std::string &portsName, std::string &fpName, std::string &lpName)
 
 ~RunReadWrite ()
 
void run () override
 Main body of the new thread. More...
 
int loop ()
 
void exit () override
 
- Public Member Functions inherited from RunStdio
virtual ~RunStdio ()
 
- 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...
 

Protected Attributes

bool mRunning
 
bool mForwarded
 
std::string UUID
 
std::string wPortName
 
std::string rPortName
 
std::string fPortName
 
yarp::os::Port wPort
 
yarp::os::Port rPort
 
yarp::os::Port fPort
 

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 242 of file RunReadWrite.h.

Constructor & Destructor Documentation

◆ RunReadWrite()

RunReadWrite::RunReadWrite ( std::string &  portsName,
std::string &  fpName,
std::string &  lpName 
)
inline

Definition at line 245 of file RunReadWrite.h.

◆ ~RunReadWrite()

RunReadWrite::~RunReadWrite ( )
inline

Definition at line 269 of file RunReadWrite.h.

Member Function Documentation

◆ exit()

void RunReadWrite::exit ( )
inlineoverridevirtual

Implements RunStdio.

Definition at line 274 of file RunReadWrite.h.

◆ loop()

int RunReadWrite::loop ( )

Definition at line 103 of file RunReadWrite.cpp.

◆ run()

void RunReadWrite::run ( )
overridevirtual

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 217 of file RunReadWrite.cpp.

Member Data Documentation

◆ fPort

yarp::os::Port RunReadWrite::fPort
protected

Definition at line 298 of file RunReadWrite.h.

◆ fPortName

std::string RunReadWrite::fPortName
protected

Definition at line 295 of file RunReadWrite.h.

◆ mForwarded

bool RunReadWrite::mForwarded
protected

Definition at line 290 of file RunReadWrite.h.

◆ mRunning

bool RunReadWrite::mRunning
protected

Definition at line 289 of file RunReadWrite.h.

◆ rPort

yarp::os::Port RunReadWrite::rPort
protected

Definition at line 297 of file RunReadWrite.h.

◆ rPortName

std::string RunReadWrite::rPortName
protected

Definition at line 294 of file RunReadWrite.h.

◆ UUID

std::string RunReadWrite::UUID
protected

Definition at line 292 of file RunReadWrite.h.

◆ wPort

yarp::os::Port RunReadWrite::wPort
protected

Definition at line 296 of file RunReadWrite.h.

◆ wPortName

std::string RunReadWrite::wPortName
protected

Definition at line 293 of file RunReadWrite.h.


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