Wiselib
Public Member Functions | Public Attributes
concepts::Timer_concept Class Reference

Basic Concept for Timer. More...

List of all members.

Public Member Functions

template<typename T , void(T::*)(void *) TMethod>
int set_timer (millis_t millis, T *obj_pnt, void *userdata)
 Register timer event in millis ms.

Public Attributes

typedef OsModel
 Type of Os Concept which has been set for the timer.
typedef millis_t
 Internally used type for millisecond representation.

Detailed Description

Basic Concept for Timer.

Another important feature when generalizing OS functionality is the registration of timer events, which is covered with the timer concept. It provides the basic type OsModel?, and it defines of which type the amount of milliseconds is given. Note that using a uint16_t would only result in approximately 60 seconds.

The important method is set_timer, which awaits among other parameters the amount of milliseconds after which the given callback function is called, and a void pointer to arbitrary data that is passed to the callback function when the timer expires.


Member Function Documentation

template<typename T , void(T::*)(void *) TMethod>
int concepts::Timer_concept::set_timer ( millis_t  millis,
T *  obj_pnt,
void *  userdata 
)

Register timer event in millis ms.

When timer event fires, userdata is passed as parameter. TMethod shall only be called repeadetly if set_timer is called from TMethod, i.e. no automatic repetition.


Member Data Documentation

Internally used type for millisecond representation.

Type of Os Concept which has been set for the timer.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines