[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]

 

LQueue



Overview:

LQueue is a PowerPlant class that is used for implementing full linked list behavior for a list of LLink objects.

Methods :

The methods in this class are:

 

LQueue()  
~LQueue()  
DoForEach()  
GetSize()  
IsEmpty()  
NextGet()  
NextPut()  
Remove()  
operator =()  
 

Data Members:

The data members in this class are:

 

mFirst  
mLast  
mSize  
 

Operation:

Every element in LQueue is an LLink object. The methods also work on LLink objects. LQueue implements a first-in, first-out (FIFO) queue. You add elements to the end of the list, and you may only get items from the head of the list.

Source files:

(Threads Classes)

LQueue.h

LQueue.cp

See also:

LSharedQueue

LLink

LQueue()

Purpose:

The constructor creates the object.

Access :

Public

Prototype:

LQueue();
Parameters:

None

~LQueue()

Purpose:

The destructor destroys the LQueue object.

Access :

Virtual

Prototype:

virtual ~LQueue();

DoForEach()

Purpose:

Execute a user-supplied function for each element in the queue.

Access :

Virtual, Public

Prototype:

virtual void DoForEach(LQueueIterator proc, 
   void* arg);
Parameters:

The parameters for this method are:

 

LQueueIterator  
proc  
The queue iterator.  
void*  
arg  
The function to perform.  

Return:

None

GetSize()

Purpose:

Returns the number of elements in the queue.

Access :

Virtual, Public

Prototype:

virtual UInt32 GetSize() const;
Parameters:

None

Return:

The number of items in the queue.

IsEmpty()

Purpose:

Indicates if the queue not contain any elements.

Access :

Virtual, Public

Prototype:

virtual Boolean IsEmpty() const;
Parameters:

None

Return:

Return true if the queue is empty.

NextGet()

Purpose:

Removes and returns the first element in the queue.

Access :

Virtual, Public

Prototype:

virtual LLink* NextGet();
Parameters:

None

Return:

A LLink pointer to the element in the queue.

NextPut()

Purpose:

Adds the given element to the end of the queue.

Access :

Virtual, Public

Prototype:

virtual void NextPut(LLink* inLinkP);
Parameters:

A pointer to an LLink

Return:

None

Remove()

Purpose:

Remove an arbitrary element from the queue. This function traverses the entire queue, looking for the given queue element. If the element is found, it is removed from the queue.

Access :

Virtual, Public

Prototype:

virtual Boolean Remove(LLink *inLinkP);
Parameters:

A pointer to an LLink

Return:

Returns a Boolean indicating if the element was found.

operator =()

Purpose:

The assignment operator

Access :

Private

Prototype:

LQueue&			operator = (const LQueue&);
Parameters:

An LQueue object to assign

Return:

Assigned object

mFirst

Purpose:

The head of the queue.

Access :

Protected

Prototype:

LLink*		mFirst;

mLast

Purpose:

The tail of the queue.

Access :

Protected

Prototype:

LLink*		mLast;

mSize

Purpose:

The size of the queue in elements.

Access :

Protected

Prototype:

UInt32		mSize;

 


[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]

Visit the Metrowerks website at: http://www.metrowerks.com
For assistance contact Metrowerks Technical Support at: cw_support@metrowerks.com
Copyright © 2000, Metrowerks Corp. All rights reserved.

Last updated: July 21, 2000