GNU CommonC++
Classes | Public Member Functions

ost::StackPager Class Reference

The StackPager provides a repository to stash and retrieve working data in last-in-first-out order. More...

#include <misc.h>

Inheritance diagram for ost::StackPager:
ost::MemPager

List of all members.

Classes

struct  frame

Public Member Functions

 StackPager (size_t pagesize)
 Create a lifo pager as a mempager.
void * push (const void *object, size_t size)
 Push an arbitrary object onto the stack.
void * push (const char *string)
 Push a string onto the stack.
void * pull (void)
 Retrieve next object from stack.
void purge (void)
 Purge the stack of all objects and memory allocations.

Detailed Description

The StackPager provides a repository to stash and retrieve working data in last-in-first-out order.

The use of a mempager to support it's operation allows storage of arbitrary sized objects with no fixed limit.

Author:
David Sugar <dyfet@ostel.com> last in first out object pager.

Constructor & Destructor Documentation

ost::StackPager::StackPager ( size_t  pagesize)

Create a lifo pager as a mempager.

Parameters:
pagesizefor memory allocation

Member Function Documentation

void* ost::StackPager::pull ( void  )

Retrieve next object from stack.

Returns:
object.
void ost::StackPager::purge ( void  )

Purge the stack of all objects and memory allocations.

Reimplemented from ost::MemPager.

void* ost::StackPager::push ( const void *  object,
size_t  size 
)

Push an arbitrary object onto the stack.

Returns:
stack memory location.
Parameters:
objectpointer to data
sizeof data.
void* ost::StackPager::push ( const char *  string)

Push a string onto the stack.

Returns:
stack memory location.
Parameters:
stringpointer.

The documentation for this class was generated from the following file: