The ITimerFn class is an abstract timer function class that you use with the class ITimer. To use ITimerFn, create a class derived from ITimerFn that implements the timerExpired function. ITimerMemberFn and ITimerMemberFn0 are template classes that derive from ITimerFn.
The ITimerFn class represents functions that an active timer (represented by ITimer) calls when it expires. ITimer reference-counts ITimerFn objects to manage their destruction when you stop the timer. To assign an ITimerFn object to an ITimer, create the ITimerFn object using operator new and pass its address to the ITimer object either when you construct it when you call ITimer::start.
Constructors & DestructorYou can destruct objects of this class, although ITimer generally manages the destruction of these objects for you. You cannot construct objects of this class because ITimerFn is an abstract class. You cannot copy or assign ITimerFn objects because both the copy constructor and the assignment operator are private members.
![]() |
public:
virtual ~ITimerFn()
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
![]() |
public:
ITimerFn()
ITimerFn provides only a default constructor, which does not require any arguments.
If you are using this class with the ITimer class, use operator new to create objects of classes derived from ITimerFn, because ITimer reference counts these objects.
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
Timer ExpirationAfter you start a timer, it expires each time a specified time interval passes. Use these members to perform actions each time the timer expires.
![]() |
public:
virtual void timerExpired(unsigned long timerId) = 0
Function to be called by an ITimer object each time the timer expires.
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
void addRef()
unsigned long count() const
void removeRef()
virtual ~IMRefCounted()
IMRefCounted()
IMRefCounted(const IMRefCounted&)
IMRefCounted& operator =(const IMRefCounted&)