Sourceforge.net - The VCF's Project Host
   The VCF Website Home   |   Online Discussion Forums   |   Sourceforge.net Project Page   

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::addSource RunLoopSourcePtr::Shared  source,
const String mode = DefaultMode
 

void VCF::RunLoop::addTimer RunLoopTimerPtr::Shared  timer,
const String mode = DefaultMode
 

void VCF::RunLoop::clearAllSources  ) 
 

void VCF::RunLoop::clearAllTimers  ) 
 

void VCF::RunLoop::postEvent Procedure callback,
const bool &  deleteHandler = true,
const String mode = DefaultMode
 

void VCF::RunLoop::postEvent EventHandler eventHandler,
Event event,
const bool &  deleteHandler = true,
const String mode = DefaultMode
 

void VCF::RunLoop::removeSource RunLoopSourcePtr::Shared  source,
const String mode = DefaultMode
 

void VCF::RunLoop::removeTimer RunLoopTimerPtr::Shared  timer,
const String mode = DefaultMode
 

void VCF::RunLoop::run const DateTimeSpan duration,
const String mode = DefaultMode
 

Runs the run loop for the specified duration.

void VCF::RunLoop::run const DateTime till,
const String mode = DefaultMode
 

Run the run loop till the current time hits the passed in date time value.

Parameters:
DateTime the time to run the loop till.

void VCF::RunLoop::run const String mode = DefaultMode  ) 
 

starts the run loop running.

it will keep running till you call stop().

void VCF::RunLoop::stop const String mode = DefaultMode  ) 
 

Stops the run loop.


Friends And Related Function Documentation

friend class Creator [friend]
 


Member Data Documentation

const String VCF::RunLoop::DefaultMode [static]
 

RunLoopDelegate VCF::RunLoop::LoopEvents
 

const String VCF::RunLoop::SharedMode [static]
 


The documentation for this class was generated from the following file:
   Comments or Suggestions?    License Information