VCF::RunLoop Class Reference
The
RunLoop class is used to create an instance of an OS event queue.
More...
#include <vcf/FoundationKit/RunLoop.h>
List of all members.
|
Public Member Functions |
| | ~RunLoop () |
| void | run (const String &mode=DefaultMode) |
| | starts the run loop running.
|
| void | run (const DateTime &till, const String &mode=DefaultMode) |
| | Run the run loop till the current time hits the passed in date time value.
|
| void | run (const DateTimeSpan &duration, const String &mode=DefaultMode) |
| | Runs the run loop for the specified duration.
|
| void | stop (const String &mode=DefaultMode) |
| | Stops the run loop.
|
| void | addTimer (RunLoopTimerPtr::Shared timer, const String &mode=DefaultMode) |
| void | removeTimer (RunLoopTimerPtr::Shared timer, const String &mode=DefaultMode) |
| void | addSource (RunLoopSourcePtr::Shared source, const String &mode=DefaultMode) |
| void | removeSource (RunLoopSourcePtr::Shared source, const String &mode=DefaultMode) |
| void | postEvent (EventHandler *eventHandler, Event *event, const bool &deleteHandler=true, const String &mode=DefaultMode) |
| void | postEvent (Procedure *callback, const bool &deleteHandler=true, const String &mode=DefaultMode) |
| void | clearAllTimers () |
| void | clearAllSources () |
Public Attributes |
| RunLoopDelegate | LoopEvents |
Static Public Attributes |
| static const String | DefaultMode |
| static const String | SharedMode |
Protected Member Functions |
| | RunLoop (Thread *thread) |
Friends |
| class | Creator |
Detailed Description
The
RunLoop class is used to create an instance of an OS event queue.
This can then be run and you can post events to it, or add a timer, or some other source of notification.
The idea behind this is neither new or original. In our case we have heavily borrowed upon Apple's CFRunLoop, so you may want to check their documentation here: http://developer.apple.com/documentation/CoreFoundation/Reference/CFRunLoopRef/Reference/reference.html
You never create a RunLoop. Instead you get access to it through the ThreadManager's getCurrentRunLoop() function which will return the RunLoop for the thread that's running when the call was made. Also you can get the run loop from a valid, running thread instance.
Constructor & Destructor Documentation
| VCF::RunLoop::~RunLoop |
( |
|
) |
|
|
| VCF::RunLoop::RunLoop |
( |
Thread * |
thread |
) |
[protected] |
|
Member Function Documentation
| void VCF::RunLoop::clearAllSources |
( |
|
) |
|
|
| void VCF::RunLoop::clearAllTimers |
( |
|
) |
|
|
|
|
Runs the run loop for the specified duration.
|
|
|
Run the run loop till the current time hits the passed in date time value.
- Parameters:
-
|
|
|
starts the run loop running.
it will keep running till you call stop(). |
Friends And Related Function Documentation
friend class Creator [friend] |
|
Member Data Documentation
The documentation for this class was generated from the following file: