YARP
Yet Another Robot Platform
yarp::os::Timer Class Reference

#include <yarp/os/Timer.h>

Classes

class  PrivateImpl
 

Public Types

typedef std::function< bool(const yarp::os::YarpTimerEvent &)> TimerCallback
 

Public Member Functions

 Timer (const Timer &)=delete
 
Timer operator= (const Timer &)=delete
 
 Timer (const yarp::os::TimerSettings &settings, const TimerCallback &callback, bool newThread, yarp::os::Mutex *mutex)
 Timer constructor. More...
 
template<class T >
 Timer (const yarp::os::TimerSettings &settings, bool(T::*callback)(const yarp::os::YarpTimerEvent &), T *object, bool newThread, yarp::os::Mutex *mutex)
 Timer constructor. More...
 
template<class T >
 Timer (const yarp::os::TimerSettings &settings, bool(T::*callback)(const yarp::os::YarpTimerEvent &) const, const T *object, bool newThread, yarp::os::Mutex *mutex)
 const version. More...
 
 Timer (const yarp::os::TimerSettings &settings, const TimerCallback &callback, bool newThread, std::mutex *mutex=nullptr)
 Timer constructor. More...
 
template<class T >
 Timer (const yarp::os::TimerSettings &settings, bool(T::*callback)(const yarp::os::YarpTimerEvent &), T *object, bool newThread, std::mutex *mutex=nullptr)
 Timer constructor. More...
 
template<class T >
 Timer (const yarp::os::TimerSettings &settings, bool(T::*callback)(const yarp::os::YarpTimerEvent &) const, const T *object, bool newThread, std::mutex *mutex=nullptr)
 const version. More...
 
virtual ~Timer ()
 
void setSettings (const yarp::os::TimerSettings &settings)
 setSettings More...
 
const yarp::os::TimerSettings getSettings ()
 getSettings More...
 
virtual bool start ()
 
virtual bool step ()
 
virtual void stop ()
 
virtual bool isRunning ()
 

Detailed Description

Definition at line 103 of file Timer.h.

Member Typedef Documentation

◆ TimerCallback

typedef std::function<bool(const yarp::os::YarpTimerEvent&)> yarp::os::Timer::TimerCallback

Definition at line 106 of file Timer.h.

Constructor & Destructor Documentation

◆ Timer() [1/7]

yarp::os::Timer::Timer ( const Timer )
delete

◆ Timer() [2/7]

Timer::Timer ( const yarp::os::TimerSettings settings,
const TimerCallback callback,
bool  newThread,
yarp::os::Mutex mutex 
)

Timer constructor.

Parameters
settingsthe timer settings. see TimerSettings documentation
callbackthe pointer to the function to call. the signature should be "bool foo(const yarp::os::YarpTimerEvent&)" and if it return false the timer will stop
mutexif not nullptr will be locked before calling callback and released just after
newThreadwhether the timer should be executed in a dedicated thread or with all the timers with newThread == false (in any case they will not run in the main thread)
Deprecated:
since YARP 3.3

Definition at line 334 of file Timer.cpp.

◆ Timer() [3/7]

template<class T >
yarp::os::Timer::Timer ( const yarp::os::TimerSettings settings,
bool(T::*)(const yarp::os::YarpTimerEvent &)  callback,
T *  object,
bool  newThread,
yarp::os::Mutex mutex 
)
inline

Timer constructor.

Parameters
settingsthe timer settings. see TimerSettings documentation
callbackthe pointer to the member method to call
objectthe pointer to the object
mutexif not nullptr will be locked before calling callback and released just after
newThreadwhether the timer should be executed in a his own thread or with all the timers with newThread == false (in any case they will not run in the main thread)
Deprecated:
since YARP 3.3

Definition at line 144 of file Timer.h.

◆ Timer() [4/7]

template<class T >
yarp::os::Timer::Timer ( const yarp::os::TimerSettings settings,
bool(T::*)(const yarp::os::YarpTimerEvent &) const  callback,
const T *  object,
bool  newThread,
yarp::os::Mutex mutex 
)
inline

const version.

Deprecated:
since YARP 3.3

Definition at line 159 of file Timer.h.

◆ Timer() [5/7]

Timer::Timer ( const yarp::os::TimerSettings settings,
const TimerCallback callback,
bool  newThread,
std::mutex *  mutex = nullptr 
)

Timer constructor.

Parameters
settingsthe timer settings. see TimerSettings documentation
callbackthe pointer to the function to call. the signature should be "bool foo(const yarp::os::YarpTimerEvent&)" and if it return false the timer will stop
mutexif not nullptr will be locked before calling callback and released just after
newThreadwhether the timer should be executed in a dedicated thread or with all the timers with newThread == false (in any case they will not run in the main thread)

Definition at line 344 of file Timer.cpp.

◆ Timer() [6/7]

template<class T >
yarp::os::Timer::Timer ( const yarp::os::TimerSettings settings,
bool(T::*)(const yarp::os::YarpTimerEvent &)  callback,
T *  object,
bool  newThread,
std::mutex *  mutex = nullptr 
)
inline

Timer constructor.

Parameters
settingsthe timer settings. see TimerSettings documentation
callbackthe pointer to the member method to call
objectthe pointer to the object
mutexif not nullptr will be locked before calling callback and released just after
newThreadwhether the timer should be executed in a his own thread or with all the timers with newThread == false (in any case they will not run in the main thread)

Definition at line 200 of file Timer.h.

◆ Timer() [7/7]

template<class T >
yarp::os::Timer::Timer ( const yarp::os::TimerSettings settings,
bool(T::*)(const yarp::os::YarpTimerEvent &) const  callback,
const T *  object,
bool  newThread,
std::mutex *  mutex = nullptr 
)
inline

const version.

Definition at line 214 of file Timer.h.

◆ ~Timer()

Timer::~Timer ( )
virtual

Definition at line 448 of file Timer.cpp.

Member Function Documentation

◆ getSettings()

const TimerSettings Timer::getSettings ( )

getSettings

Returns
the current settings

Definition at line 438 of file Timer.cpp.

◆ isRunning()

bool Timer::isRunning ( )
virtual

Definition at line 443 of file Timer.cpp.

◆ operator=()

Timer yarp::os::Timer::operator= ( const Timer )
delete

◆ setSettings()

void Timer::setSettings ( const yarp::os::TimerSettings settings)

setSettings

Parameters
settingsthe new settings

Definition at line 433 of file Timer.cpp.

◆ start()

bool Timer::start ( )
virtual

Definition at line 351 of file Timer.cpp.

◆ step()

bool Timer::step ( )
virtual

Definition at line 357 of file Timer.cpp.

◆ stop()

void Timer::stop ( )
virtual

Definition at line 362 of file Timer.cpp.


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