glib.TrashStack.TrashStack Class Reference

List of all members.

Detailed Description

Description A GTrashStack is an efficient way to keep a stack of unused allocated memory chunks.

Each memory chunk is required to be large enough to hold a gpointer. This allows the stack to be maintained without any space overhead, since the stack pointers can be stored inside the memory chunks. There is no function to create a GTrashStack. A NULL GTrashStack* is a perfectly valid empty stack.


Public Member Functions

GTrashStackgetTrashStackStruct ()
 this (GTrashStack *gTrashStack)
 Sets our main struct and passes it to the parent class.

Static Public Member Functions

static void push (GTrashStack **stackP, void *dataP)
 Pushes a piece of memory onto a GTrashStack.
static void * pop (GTrashStack **stackP)
 Pops a piece of memory off a GTrashStack.
static void * peek (GTrashStack **stackP)
 Returns the element at the top of a GTrashStack which may be NULL.
static uint height (GTrashStack **stackP)
 Returns the height of a GTrashStack.

Protected Member Functions

void * getStruct ()
 the main Gtk struct as a void*

Protected Attributes

GTrashStackgTrashStack
 the main Gtk struct


Constructor & Destructor Documentation

glib.TrashStack.TrashStack.this ( GTrashStack gTrashStack  ) 

Sets our main struct and passes it to the parent class.


Member Function Documentation

void* glib.TrashStack.TrashStack.getStruct (  )  [protected]

the main Gtk struct as a void*

GTrashStack* glib.TrashStack.TrashStack.getTrashStackStruct (  ) 

static uint glib.TrashStack.TrashStack.height ( GTrashStack **  stackP  )  [static]

Returns the height of a GTrashStack.

Note that execution of this function is of O(N) complexity where N denotes the number of items on the stack. stack_p: a pointer to a GTrashStack. Returns: the height of the stack.

static void* glib.TrashStack.TrashStack.peek ( GTrashStack **  stackP  )  [static]

Returns the element at the top of a GTrashStack which may be NULL.

stack_p: a pointer to a GTrashStack. Returns: the element at the top of the stack.

static void* glib.TrashStack.TrashStack.pop ( GTrashStack **  stackP  )  [static]

Pops a piece of memory off a GTrashStack.

stack_p: a pointer to a GTrashStack. Returns: the element at the top of the stack.

static void glib.TrashStack.TrashStack.push ( GTrashStack **  stackP,
void *  dataP 
) [static]

Pushes a piece of memory onto a GTrashStack.

stack_p: a pointer to a GTrashStack. data_p: the piece of memory to push on the stack.


Member Data Documentation

GTrashStack* glib.TrashStack.TrashStack.gTrashStack [protected]

the main Gtk struct


SourceForge.net Logo DSource.org Logo digitalmars.com Logo