7 #ifndef YARP_OS_RATETHREAD_H
8 #define YARP_OS_RATETHREAD_H
12 #if !defined(YARP_INCLUDING_DEPRECATED_HEADER_ON_PURPOSE)
16 #ifndef YARP_NO_DEPRECATED
92 bool setRate(
int period);
118 double getEstPeriod();
125 void getEstPeriod(
double& av,
double& std);
130 unsigned int getIterations();
143 void getEstUsed(
double& av,
double& std);
158 int setPriority(
int priority,
int policy = -1);
184 bool threadInit()
override;
192 void threadRelease()
override;
211 void beforeStart()
override;
218 void afterStart(
bool success)
override;
227 SystemRateThread(int period);
229 virtual ~SystemRateThread();
240 class YARP_os_DEPRECATED_API RateThreadWrapper : public PeriodicThread
243 yarp::os::Runnable* helper;
251 RateThreadWrapper(Runnable* helper);
252 RateThreadWrapper(Runnable& helper);
254 virtual ~RateThreadWrapper();
257 virtual bool attach(Runnable& helper);
258 virtual bool attach(Runnable* helper);
260 bool open(double framerate = -1, bool polling = false);
265 bool threadInit() override;
266 void threadRelease() override;
267 void afterStart(bool success) override;
268 void beforeStart() override;
270 Runnable* getAttachment() const;
277 #endif // YARP_NO_DEPRECATED
279 #endif // YARP_OS_RATETHREAD_H
An abstraction for a periodic thread.
An abstraction for a periodic thread.
void run() override=0
Loop function.
The main, catch-all namespace for YARP.
#define YARP_COMPILER_WARNING(x)
Generate a warning at build time on supported compilers.
#define YARP_WARNING_PUSH
Starts a temporary alteration of the enabled warnings.
#define YARP_DISABLE_DEPRECATED_WARNING
Disable deprecated warnings in the following code.
#define YARP_os_DEPRECATED_API_MSG(X)