CStack Class Reference

#import <cstack.h>

List of all members.

Public Member Functions

(id) - init
 Initialize stack.
(void) - dealloc
 Deallocate stack.
(void) - push:
 Push object to stack.
(id) - pop
 Pop data from stack.
(uint_t) - num
 Get number of objects in the stack.
(id) - objectAtTop
 Get object at the top of stack.
(id) - objectAtIndex:
 Get object by index.

Protected Attributes

CStackElmPtr stack_bottom
uint_t current_num
uint_t max_num


Detailed Description

CStack operates stack of objects.


Member Function Documentation

- (void) dealloc  
 

Deallocate stack.

Description
Deallocate stack.

- (id) init  
 

Initialize stack.

Description
Initialize stack.

- (uint_t) num  
 

Get number of objects in the stack.

Returns:
Number of objects.
Description
Get number of objects in the stack.

- (id) objectAtIndex: (uint_t)  idx  
 

Get object by index.

Return values:
obj Object at index depth of stack.
nil Object is not found there.
Description
Get object by index.

- (id) objectAtTop  
 

Get object at the top of stack.

Return values:
obj Object at top of stack.
nil Stack is empty.
Description
Get object at the top of stack. The object is not poped.

- (id) pop  
 

Pop data from stack.

Return values:
obj Object at top of stack.
nil When the stack is empty.
Description
Pop data from stack.

- (void) push: (id)  obj  
 

Push object to stack.

Parameters:
obj New object to stack.
Description
Deallocate stack.


Member Data Documentation

- (uint_t) current_num [protected]
 

Number of valid objects in the stack

- (uint_t) max_num [protected]
 

Maximum size of stack

- (CStackElmPtr) stack_bottom [protected]
 

Pointer of the stack. The lower address contains deeper data in the stack.


The documentation for this class was generated from the following file:
Generated on Mon Mar 20 18:45:20 2006 for Coconut by  doxygen 1.4.6