CAdder Class Reference

List of all members.

Public Member Functions

 ~CAdder ()
TInt Add ()
void RunL ()
void DoCancel ()
void StartTimer ()
void StopTimer ()
void ReadFunction ()
void Add ()

Static Public Member Functions

static CAdderNewL (CLongNumber *aNum1)
static CAdderNewL (CConsoleBase *aConsole)
static TInt AddFunction (TAny *aPtr)

Detailed Description

This class stores an object of the CLongNumber class. It has methods to calculate the sum of all digits of the number represented by the iLongNumber object.

The adder class. This class creates the global chunk and periodically adds random values to it. It also creates:

  • the global condition variable
  • the global mutex variable
  • the timer object The condition variable ensures that the value of the chunk is always less than 100.

Definition at line 31 of file adder.h.


Constructor & Destructor Documentation

CAdder::~CAdder (  ) 

Destructor.

Definition at line 73 of file adder.cpp.


Member Function Documentation

CAdder * CAdder::NewL ( CLongNumber aLongNumber  )  [static]

Creates an object of the CAdder class.

Parameters:
aLongNumber A pointer to the object of the CLongNumber class.
Returns:
A pointer to the object of the CAdder class.

Definition at line 30 of file adder.cpp.

void CAdder::Add (  ) 

Performs the addition of all digits of the iLongNumber object.

Returns:
The sum of all digits of the iLongNumber object.

Adds a random integer value to the global chunk.

Definition at line 47 of file adder.cpp.

CAdder * CAdder::NewL ( CConsoleBase *  aConsole  )  [static]

Performs the two-phase construction of an object of the CAdder class.

Parameters:
aConsole The console object.
Returns:
A CAdder object.

Definition at line 30 of file adder.cpp.

void CAdder::RunL (  ) 

Handles the key press events from the console. It stops the active scheduler for any key press event.

Definition at line 43 of file adder.cpp.

void CAdder::DoCancel (  ) 

Cancel any outstanding request.

Definition at line 58 of file adder.cpp.

void CAdder::StartTimer (  ) 

Starts the timer object.

See also:
CPeriodic::Start().

Definition at line 139 of file adder.cpp.

void CAdder::StopTimer (  ) 

Stops the timer object.

Definition at line 148 of file adder.cpp.

void CAdder::ReadFunction (  ) 

Issues an outstanding request to get a keystroke from the console.

Definition at line 126 of file adder.cpp.

TInt CAdder::AddFunction ( TAny *  aPtr  )  [static]

The call back function for the CAdder::iPeriodic object.

Parameters:
aPtr Contains the address of the object passed as an argument to the AddFunction().
Returns:
KErrNone.

Definition at line 159 of file adder.cpp.


Generated by  doxygen 1.6.2