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

The SFXTask class is used to implement multitask processing.
class MyClass {
private:
SFXTimer _task;
public:
Void Function(Void);
CALLBACK_DECLARE_SFXTASK(OnTask)
};
Void MyClass::Function(Void)
{
...
// set information necessary to register a task
_task.Set(CALLBACK_FUNCTION(OnTask));
/// register a task
_task.Schedule();
}
/// callback function
CALLBACK_IMPLEMENT_SFXTASK(MyClass, OnTask)
{
...
}
| Constructor/Destructor |
|---|
|
SFXTask( Void ) Constructor of SFXTask class.
|
|
~SFXTask( Void ) Destructor of SFXTask class.
|
| Public Functions | |
|---|---|
| Void |
Cancel( Void ) Cancel the registered tasks.
|
| static SFXTaskConstRef |
EmptyInstance( Void ) Get an empty task.
|
| SFXCallback::CallbackSPP |
GetProcedure( Void ) Get the callback function set to the task.
|
| VoidPtr |
GetReference( Void ) Get user's data set to the task.
|
| Bool |
IsValid( Void ) Check whether the task is registered or not.
|
| SFCError |
Schedule( Void ) Schedule a task.
|
| Void |
Set(
SFXCallback::CallbackSPP spp
, VoidPtr reference
) Set information necessary to register a task.
|
[ public, explicit ] SFXTask(Void);
[ public ] ~SFXTask(Void);
In the destructor, cancel the registered tasks by using the SFXTask::Cancel function.
[ public ] Void Cancel(Void);
Cancel the registered tasks. If no task is registered, nothing will happen.
[ public, static ] SFXTaskConstRef EmptyInstance(Void);
Get an instance that represents an empty task.
[ 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 task.
[ public, const ] Bool IsValid(Void);
[ public ] SFCError Schedule(Void);
When the task is registered, the callback function set to the task will be called in the next event loop.
If the task has already been registered, it will be canceled and registered again.
[ public ] Void Set( SFXCallback::CallbackSPP spp // callback function VoidPtr reference // user's data );
|
Copyright (C) 2002 - 2009 Sophia Cradle, Inc. All Rights Reserved. |
![]() ![]() ![]()
|