Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

Timer_callback Class Reference

A timer callback is basically a periodic event. More...

#include <timer.h>

Inherits List_node.

Inheritance diagram for Timer_callback:

Inheritance graph
[legend]
Collaboration diagram for Timer_callback:

Collaboration graph
[legend]
List of all members.

Public Member Functions

void init (Timer_callback_func callback_function)
void print ()

Public Attributes

Timer_callback_func function
unsigned period
unsigned call_time
unsigned cycles
void * argument
bool scheduled

Detailed Description

A timer callback is basically a periodic event.

Every certain number of milliseconds, the timer invokes the callback.

This is useful for scheduling some sort of event that needs to happen a short time from now, without having to stop and wait until then. If the event only needs to happen once, then part of the event's callback function can involve unscheduling any further invocations of that event.


Member Function Documentation

void Timer_callback::init Timer_callback_func  callback_function  ) 
 

void Timer_callback::print  ) 
 

Print basic information about this timer callback.


Member Data Documentation

void* Timer_callback::argument
 

argument supplied to the function

unsigned Timer_callback::call_time
 

time callback will be invoked

unsigned Timer_callback::cycles
 

number of periods completed

Timer_callback_func Timer_callback::function
 

the actual callback function

unsigned Timer_callback::period
 

milliseconds between invocations

bool Timer_callback::scheduled
 

whether this callback is scheduled


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

Torsion Operating System, Copyright (C) 2000-2004 Dan Helfman