10 #define YARP_INCLUDING_DEPRECATED_HEADER_ON_PURPOSE 12 #undef YARP_INCLUDING_DEPRECATED_HEADER_ON_PURPOSE 18 #ifndef YARP_NO_DEPRECATED // Since YARP 3.0.0 175 this->helper = helper;
182 this->helper = &helper;
203 this->helper = &helper;
211 this->helper = helper;
245 if (helper !=
nullptr) {
252 if (helper !=
nullptr) {
260 if (helper !=
nullptr) {
267 if (helper !=
nullptr) {
274 if (helper !=
nullptr) {
RateThread(int period)
Constructor.
void askToStop()
Stop the thread.
void step()
Call this to "step" the thread rather than starting it.
A class that can be managed by another thread.
virtual bool attach(Runnable &helper)
bool step()
Call this to "step" the thread rather than starting it.
double getEstPeriod()
Return estimated period since last reset.
double getEstUsed()
Return the estimated duration of the run() function since last reset.
virtual void beforeStart()
Should be called from the creator before the thread exists and before a call that requested the threa...
void resume()
Resume the thread if previously suspended.
double getRate()
Return the current rate of the thread.
unsigned int getIterations()
Return the number of iterations performed since last reset.
bool threadInit() override
Initialization method.
void beforeStart() override
Called just before a new thread starts.
void threadRelease() override
Release method.
virtual void run()
Body to run - could be periodic or continuous.
void resetStat()
Reset thread statistics.
void suspend()
Suspend the thread, the thread keeps running by doLoop is never executed.
bool open(double framerate=-1, bool polling=false)
void afterStart(bool success) override
Called just after a new thread starts (or fails to start), this is executed by the same thread that c...
SystemRateThread(int period)
void threadRelease() override
Release method.
void run() override
Loop function.
virtual void afterStart(bool success)
Should be called from the creator after the thread exists and before a call that requested the thread...
An abstraction for a periodic thread.
bool isSuspended() const
Returns true when the thread is suspended, false otherwise.
int setPriority(int priority, int policy=-1)
Set the priority and scheduling policy of the thread, if the OS supports that.
bool isRunning() const
Returns true when the thread is started, false otherwise.
bool start()
Call this to start the thread.
void resetStat()
Reset thread statistics.
int getPolicy()
Query the current scheduling policy of the thread, if the OS supports that.
bool start()
Call this to start the thread.
double getEstimatedUsed() const
Return the estimated duration of the run() function since last reset.
virtual ~SystemRateThread()
bool threadInit() override
Initialization method.
bool isSuspended()
Returns true when the thread is suspended, false otherwise.
bool setPeriod(double period)
Set the (new) period of the thread.
unsigned int getIterations() const
Return the number of iterations performed since last reset.
bool isRunning()
Returns true when the thread is started, false otherwise.
bool setRate(int period)
Set the (new) rate of the thread.
virtual ~RateThreadWrapper()
void resume()
Resume the thread if previously suspended.
void suspend()
Suspend the thread, the thread keeps running by doLoop is never executed.
int getPriority() const
Query the current priority of the thread, if the OS supports that.
RateThreadWrapper()
Default constructor.
virtual bool threadInit()
Initialization method.
virtual void threadRelease()
Release method.
double getPeriod() const
Return the current period of the thread.
void stop()
Call this to stop the thread, this call blocks until the thread is terminated (and releaseThread() ca...
void stop()
Call this to stop the thread, this call blocks until the thread is terminated (and releaseThread() ca...
void afterStart(bool success) override
Called just after a new thread starts (or fails to start), this is executed by the same thread that c...
Runnable * getAttachment() const
void beforeStart() override
Called just before a new thread starts.
int setPriority(int priority, int policy=-1)
Set the priority and scheduling policy of the thread, if the OS supports that.
An interface to the operating system, including Port based communication.
double getEstimatedPeriod() const
Return estimated period since last reset.
constexpr char framerate[]
int getPolicy() const
Query the current scheduling policy of the thread, if the OS supports that.
int getPriority()
Query the current priority of the thread, if the OS supports that.
void askToStop()
Stop the thread.
#define YARP_SPRINTF0(log, mode, msg)
#define YARP_SPRINTF2(log, mode, msg, a, b)