Nokia N97 SDK
Example Applications Guide

COpenCHelloGlibEventExHandler Class Reference

#include <openchelloglibeventexhandler.h>

Inheritance diagram for COpenCHelloGlibEventExHandler:

List of all members.

Detailed Description

COpenCHelloGlibEventExHandler. Timer-based active object for running the iterations of the Glib Main Context. In each iteration, glib runs the callback functions of the event sources that are ready.

Definition at line 30 of file openchelloglibeventexhandler.h.


Public Member Functions

  ~COpenCHelloGlibEventExHandler ()
void  RunL ()
void  DoCancel ()
void  Start ()
void  Stop ()

Static Public Member Functions

static COpenCHelloGlibEventExHandler *  NewL (GMainContext *aMainContext)

Private Member Functions

  COpenCHelloGlibEventExHandler (GMainContext *aMainContext)
void  ConstructL ()

Private Attributes

RTimer  iTimer
GMainContext *  iMainContext


Constructor & Destructor Documentation

COpenCHelloGlibEventExHandler::~COpenCHelloGlibEventExHandler (   ) 
 

~COpenCHelloGlibEventExHandler Destructor.

Definition at line 68 of file openchelloglibeventexhandler.cpp.

References iTimer.

00069         {
00070         // Cancel any outstanding requests
00071         Cancel();
00072         
00073         // Close the timer
00074         iTimer.Close();         
00075         }

COpenCHelloGlibEventExHandler::COpenCHelloGlibEventExHandler (  GMainContext *  aMainContext  )  [private]
 

COpenCHelloGlibEventExHandler Constructor

Parameters:
aMainContext  The Glib Main Context to be used (NULL for default)

Definition at line 42 of file openchelloglibeventexhandler.cpp.

References iMainContext.

Referenced by NewL().

00042                                                                                       :CActive(EPriorityStandard)
00043         {
00044         iMainContext = aMainContext;
00045         }


Member Function Documentation

COpenCHelloGlibEventExHandler * COpenCHelloGlibEventExHandler::NewL (  GMainContext *  aMainContext  )  [static]
 

NewL Two-phased constructor. Construct a COpenCHelloGlibEventExHandler using two phase construction, and return a pointer to the created object.

Parameters:
aMainContext  The Glib Main Context to be used (NULL for default)
Returns:
A pointer to the created instance of COpenCHelloGlibEventExHandler.

Definition at line 27 of file openchelloglibeventexhandler.cpp.

References COpenCHelloGlibEventExHandler().

Referenced by COpenCHelloGlibEventExUi::ConstructL().

00028         {
00029         COpenCHelloGlibEventExHandler* self = new(ELeave) COpenCHelloGlibEventExHandler(aMainContext);
00030         CleanupStack::PushL(self);
00031         self->ConstructL();
00032         CleanupStack::Pop();
00033         return self;
00034         }

void COpenCHelloGlibEventExHandler::RunL (   ) 
 

RunL Called by the Active Scheduler when the asynchronous request is complete

Definition at line 110 of file openchelloglibeventexhandler.cpp.

References iMainContext, and iTimer.

00111         {
00112         // run one iteration of the event loop for the given context
00113         // (without blocking)
00114         g_main_context_iteration(iMainContext, FALSE);
00115         
00116         // schedule the next asynchronous request
00117         iTimer.After(iStatus, TTimeIntervalMicroSeconds32(1000));
00118         
00119         // mark the active object as "active"
00120         SetActive();    
00121         }

void COpenCHelloGlibEventExHandler::DoCancel (   ) 
 

DoCancel Called by the Active Scheduler when a pending asynchronous request has been cancelled

Definition at line 129 of file openchelloglibeventexhandler.cpp.

References iTimer.

00130         {
00131         // Cancel the asynchronous request to the timer
00132         iTimer.Cancel();        
00133         }

void COpenCHelloGlibEventExHandler::Start (   ) 
 

Start API to start the Timer-based handling of glib event sources

Definition at line 83 of file openchelloglibeventexhandler.cpp.

References iTimer.

Referenced by COpenCHelloGlibEventExUi::ConstructL().

00084         {
00085         // start an asynchronous request
00086         iTimer.After(iStatus, TTimeIntervalMicroSeconds32(1000));
00087         
00088         // mark the active object as "active"
00089         SetActive();    
00090         }

void COpenCHelloGlibEventExHandler::Stop (   ) 
 

Stop API to stop the event handling

Definition at line 98 of file openchelloglibeventexhandler.cpp.

Referenced by COpenCHelloGlibEventExUi::~COpenCHelloGlibEventExUi().

00099         {
00100         // cancel any outstanding requests
00101         Cancel();
00102         }

void COpenCHelloGlibEventExHandler::ConstructL (   )  [private]
 

ConstructL Second-phase constructor

Definition at line 53 of file openchelloglibeventexhandler.cpp.

References iTimer.

00054         {
00055         // Create a timer
00056         User::LeaveIfError(iTimer.CreateLocal());
00057         
00058         // Add the active object to the active scheduler
00059         CActiveScheduler::Add(this);    
00060         }


Member Data Documentation

RTimer COpenCHelloGlibEventExHandler::iTimer [private]
 

Handle to the timer, used for scheduling

Definition at line 92 of file openchelloglibeventexhandler.h.

Referenced by ConstructL(), DoCancel(), RunL(), Start(), and ~COpenCHelloGlibEventExHandler().

GMainContext* COpenCHelloGlibEventExHandler::iMainContext [private]
 

The Glib main context to be used

Definition at line 97 of file openchelloglibeventexhandler.h.

Referenced by COpenCHelloGlibEventExHandler(), and RunL().


The documentation for this class was generated from the following files:

© Nokia 2009

Back to top