CConsumer Class Reference

List of all members.

Public Member Functions

void ConstructL (CConsoleBase *aConsole, CQueue *aTokens)
void ResumeCons ()
void Consume ()
 ~CConsumer ()

Static Public Member Functions

static CConsumerNewL (CConsoleBase *aConsole, CQueue *aTokens)
static TInt ConsThreadFunc (TAny *aPtr)
static TInt RemoveFunction (TAny *aPtr)

Detailed Description

This class owns the consumer thread. It provides an interface to remove tokens from the CQueue::iArray queue.

See also:
CQueue.
CPeriodic.

Definition at line 46 of file consumer.h.


Constructor & Destructor Documentation

CConsumer::~CConsumer (  ) 

Destructor.

Definition at line 124 of file consumer.cpp.


Member Function Documentation

CConsumer * CConsumer::NewL ( CConsoleBase *  aConsole,
CQueue aTokens 
) [static]

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

Parameters:
aConsole The console object.
aTokens A pointer to the CQueue object containing the tokens' queue.
Returns:
A CConsumer object.

Definition at line 44 of file consumer.cpp.

void CConsumer::ConstructL ( CConsoleBase *  aConsole,
CQueue aTokens 
)

The second phase constructor of the CConsumer class. It creates the following member objects of the class:

  • iPeriodicCons
  • iConsThread The call back function of the iPeriodicCons object - RemoveFunction() invokes the iConsThread every second.
    Parameters:
    aConsole The console object.
    aTokens A pointer to the CQueue object containing the tokens' queue.
    See also:
    CPeriodic::Start().
    RThread::Create().

Definition at line 64 of file consumer.cpp.

TInt CConsumer::ConsThreadFunc ( TAny *  aPtr  )  [static]

The consumer thread function. It removes a token from the queue.

Parameters:
aPtr A pointer to the arguments passed to the thread function.

Definition at line 95 of file consumer.cpp.

void CConsumer::ResumeCons (  ) 

Resumes the execution of the consumer thread.

Definition at line 114 of file consumer.cpp.

TInt CConsumer::RemoveFunction ( TAny *  aPtr  )  [static]

The call back function associated with the CPeriodic object of the CConsumer class.

See also:
CConsumer::ConstructL().
CPeriodic.

Definition at line 136 of file consumer.cpp.


Generated by  doxygen 1.6.2