![]() ![]() ![]()
|
BREW C++ Class Library & GUI Framework & XML Middleware : SophiaFramework 4.1 |

TheSFXTimer class is used to execute a callback function after the specified time elapses.
class MyClass {
private:
SFXTimer _timer;
public:
Void Function(Void);
CALLBACK_DECLARE_SFXTIMER(TimerCallback)
};
Void MyClass::Function(Void)
{
...
// TimerCallback is called after 4000 milli-seconds
_timer.Set(CALLBACK_FUNCTION(TimerCallback));
_timer.Schedule(4000);
}
/// callback function
CALLBACK_IMPLEMENT_SFXTIMER(MyClass, TimerCallback) {
...
}
| Constructor/Destructor |
|---|
|
SFXTimer( Void ) Constructor of SFXTimer class.
|
|
~SFXTimer( Void ) Destructor of SFXTimer class.
|
| Public Functions | |
|---|---|
| Void |
Cancel( Void ) Cancel the registered timers.
|
| static SFXTimerConstRef |
EmptyInstance( Void ) Get an empty timer.
|
| SFXCallback::CallbackSPP |
GetProcedure( Void ) Get the callback function set to the timer.
|
| VoidPtr |
GetReference( Void ) Get user's data set to the timer.
|
| Bool |
IsValid( Void ) Check whether the timer is registered or not.
|
| SFCError |
Schedule(
UInt32 msec
) Register a timer.
|
| Void |
Set(
SFXCallback::CallbackSPP spp
, VoidPtr reference
) Set information necessary to register a timer.
|
[ public, explicit ] SFXTimer(Void);
[ public ] ~SFXTimer(Void);
In the destructor, cancel the registered tasks by using the SFXTimer::Cancel function.
[ public ] Void Cancel(Void);
Cancel the registered timers. If no timer is registered, nothing will happen.
[ public, static ] SFXTimerConstRef EmptyInstance(Void);
Get an instance that represents an empty timer.
[ public, const ] SFXCallback::CallbackSPP GetProcedure(Void);
Return the callback function set to the task.
[ public, const ] VoidPtr GetReference(Void);
Return user's data set to the timer.
[ public, const ] Bool IsValid(Void);
[ public ] SFCError Schedule( UInt32 msec // time until the callback function is called ( milli-second ) );
If the timer has already been registered, it will be canceled and registered again.
[ public ] Void Set( SFXCallback::CallbackSPP spp // callback function called by the timer VoidPtr reference // user's data passed to the callback function );
SFXTimer::GetProcedure | SFXTimer::GetReference | SFXTimer::Schedule
|
Copyright (C) 2002 - 2009 Sophia Cradle, Inc. All Rights Reserved. |
![]() ![]() ![]()
|