Argon RTOS  1.3.0
Tiny embedded real-time kernel
Ar::TimerWithMemberCallback< T > Class Template Reference

#include <ar_classes.h>

+ Inheritance diagram for Ar::TimerWithMemberCallback< T >:

Description

template<class T>
class Ar::TimerWithMemberCallback< T >

Timer object taking a member function callback.

+ Collaboration diagram for Ar::TimerWithMemberCallback< T >:

Public Types

typedef void(T::* callback_t) (Timer *timer)
 Timer callback function that takes an instance of this class.
 
- Public Types inherited from Ar::Timer
typedef void(* callback_t) (Timer *timer, void *param)
 Timer callback function that takes an instance of this class.
 

Public Member Functions

 TimerWithMemberCallback ()
 Default constructor.
 
 TimerWithMemberCallback (const char *name, T *object, callback_t callback, ar_timer_mode_t timerMode, uint32_t delay)
 Constructor taking a member function callback.
 
 ~TimerWithMemberCallback ()
 Destructor.
 
ar_status_t init (const char *name, T *object, callback_t callback, ar_timer_mode_t timerMode, uint32_t delay)
 Initialize the timer with a member function callback.
 
- Public Member Functions inherited from Ar::Timer
 Timer ()
 Default constructor.
 
 Timer (const char *name, callback_t callback, void *param, ar_timer_mode_t timerMode, uint32_t delay)
 Constructor.
 
 ~Timer ()
 Destructor.
 
uint32_t getDelay () const
 Get the current delay for the timer.
 
const char * getName () const
 Get the timer's name.
 
ar_status_t init (const char *name, callback_t callback, void *param, ar_timer_mode_t timerMode, uint32_t delay)
 Initialize the timer.
 
bool isActive () const
 Returns whether the timer is currently running.
 
void setDelay (uint32_t delay)
 Adjust the timer's delay.
 
void start ()
 Start the timer running.
 
void stop ()
 Stop the timer.
 

Protected Member Functions

void invoke (T *obj)
 Call the member function.
 

Static Protected Member Functions

static void member_callback (Timer *timer, void *param)
 Template function to invoke a callback that is a member function.
 
- Static Protected Member Functions inherited from Ar::Timer
static void timer_wrapper (ar_timer_t *timer, void *arg)
 Converts the timer struct to an instance of this class.
 

Protected Attributes

callback_t m_memberCallback
 The user timer callback.
 
- Protected Attributes inherited from Ar::Timer
callback_t m_userCallback
 The user timer callback.
 

Additional Inherited Members

- Public Attributes inherited from ar_timer_t
ar_list_node_t m_activeNode
 Node for the list of active timers.
 
ar_timer_entry_t m_callback
 Timer expiration callback.
 
uint32_t m_delay
 Delay in ticks.
 
bool m_isActive
 Whether the timer is running and on the active timers list.
 
bool m_isRunning
 Whether the timer callback is executing.
 
ar_timer_mode_t m_mode
 One-shot or periodic mode.
 
const char * m_name
 Name of the timer.
 
void * m_param
 Arbitrary parameter for the callback.
 
ar_runloop_t * m_runLoop
 Runloop to which the timer is bound.
 
uint32_t m_wakeupTime
 Expiration time in ticks.