fw4spl
fwThread::TimerAsio Class Reference

Private Timer implementation using boost::asio. More...

+ Inheritance diagram for fwThread::TimerAsio:
+ Collaboration diagram for fwThread::TimerAsio:

Public Member Functions

 TimerAsio (::boost::asio::io_service &ioSrv)
 Constructs a TimerAsio from given io_service.
 
void start ()
 Starts or restarts the timer.
 
void stop ()
 Stops the timer and cancel all pending operations.
 
void setDuration (TimeDurationType duration)
 Sets time duration.
 
bool isOneShot () const
 Returns if the timer mode is 'one shot'.
 
void setOneShot (bool oneShot)
 Sets timer mode.
 
bool isRunning () const
 Returns true if the timer is currently running.
 
- Public Member Functions inherited from fwThread::Timer
template<typename F >
void setFunction (F f)
 Sets the function to be triggered when time duration expires.
 
- Public Member Functions inherited from fwCore::BaseObject
virtual bool isA (const std::string &type) const
 
virtual const std::string & getLeafClassname () const
 return object's classname without its namespace, i.e. BaseObject
 
virtual const std::string & getClassname () const
 return full object's classname with its namespace, i.e. fwCore::BaseObject
 

Protected Member Functions

void cancelNoLock ()
 
void rearmNoLock (TimeDurationType duration)
 
void call (const ::boost::system::error_code &code)
 
 TimerAsio (const TimerAsio &)
 Copy constructor forbidden.
 
TimerAsiooperator= (const TimerAsio &)
 Copy operator forbidden.
 
- Protected Member Functions inherited from fwThread::Timer
FWTHREAD_API Timer ()
 Constructs a Timer. By default, a the Timer mode is repetitive.
 
 Timer (const Timer &)
 Copy constructor forbidden.
 
Timeroperator= (const Timer &)
 Copy operator forbidden.
 
virtual FWTHREAD_API void updatedFunction ()
 This method is triggered when Timer's function is changed.
 

Protected Attributes

::boost::asio::deadline_timer m_timer
 Timer object.
 
TimeDurationType m_duration
 Time to wait until timer's expiration.
 
bool m_oneShot
 Timer's mode.
 
bool m_running
 Timer's state.
 
- Protected Attributes inherited from fwThread::Timer
FunctionType m_function
 Function object to execute each time the timer expires.
 
mutable::fwCore::mt::Mutex m_mutex
 

Additional Inherited Members

- Public Types inherited from fwThread::Timer
typedef std::shared_ptr< Timersptr
 
typedef std::function< void() > FunctionType
 
typedef std::chrono::duration< double > TimeDurationType
 
- Static Public Member Functions inherited from fwCore::BaseObject
static bool isTypeOf (const std::string &type)
 
static const std::string & leafClassname ()
 return object's classname without its namespace, i.e. BaseObject
 
static const std::string & classname ()
 return object's classname without its namespace, i.e. BaseObject
 

Detailed Description

Private Timer implementation using boost::asio.

Definition at line 78 of file WorkerAsio.cpp.


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