#include <uan-tools.h>
Inheritance diagram for UanTimer:

Public Member Functions | |
| UanTimer (void *obj) | |
| Constructor. Associates this timer with object obj. | |
| virtual void | start (double time) |
| Start timer. Precondition that timer is not currently running. | |
| virtual void | restart (double time) |
| Stops timer if running then calls start. | |
| virtual void | stop (void) |
| Stops timer. Precodition, timer is running. | |
| virtual void | handle (Event *e)=0 |
| Function called when timer expires. | |
| bool | isBusy (void) |
| Returns true if busy. | |
| double | expire (void) |
| Returns seconds until timer expires. | |
Protected Attributes | |
| void * | object |
| Object which should contain the handler function for derived classes. | |
| bool | busy |
| Flag indicating whether timer is currently running. | |
| double | stime |
| Global time in seconds at which timer started. | |
| double | rtime |
| Timer run time in seconds. | |
| Event | intr |
| Event that is referenced by scheduler. | |
This is a generic timer class that uses the NS 2 scheduler to schedule itself. The constructor requires object which will contain the handler function in derived classes.
1.5.1