UCommon
Public Member Functions | Protected Member Functions
ucommon::bufpager Class Reference

Buffered pager for storing paged strings for character protocol. More...

#include <memory.h>

Inheritance diagram for ucommon::bufpager:
Inheritance graph
[legend]
Collaboration diagram for ucommon::bufpager:
Collaboration graph
[legend]

Public Member Functions

 bufpager (size_t page=0)
unsigned long getUsed (void)
 Get total size.
void reset (void)
 Reset pager text buffer protocol.
void rewind (void)
 Rewind to start of text buffer protocol.
- Public Member Functions inherited from ucommon::memalloc
unsigned getAlloc (void)
 Get the size of a memory page.
unsigned getLimit (void)
 Get the maximum number of pages that are permitted.
unsigned getPages (void)
 Get the number of pages that have been allocated from the real heap.
 memalloc (size_t page=0)
 Construct a memory pager.
void purge (void)
 Purge all allocated memory and heap pages immediately.
unsigned utilization (void)
 Determine fragmentation level of acquired heap pages.
virtual ~memalloc ()
 Destroy a memory pager.
- Public Member Functions inherited from ucommon::MemoryProtocol
void * alloc (size_t size)
 Convenience function.
char * dup (const char *string)
 Duplicate NULL terminated string into allocated memory.
void * dup (void *memory, size_t size)
 Duplicate existing memory block into allocated memory.
void * zalloc (size_t size)
 Allocate memory from the pager heap.
- Public Member Functions inherited from ucommon::CharacterProtocol
int get (void)
 Get the next character.
int put (int code)
 Put the next character.

Protected Member Functions

virtual void * _alloc (size_t size)
 Allocate memory from the pager heap.
- Protected Member Functions inherited from ucommon::memalloc
page_t * pager (void)
 Acquire a new page from the heap.
- Protected Member Functions inherited from ucommon::MemoryProtocol
virtual void * _alloc (size_t size)=0
 Protocol to allocate memory from the pager heap.
virtual void _lock (void)
virtual void _unlock (void)

Additional Inherited Members

- Protected Attributes inherited from ucommon::memalloc
unsigned limit

Detailed Description

Buffered pager for storing paged strings for character protocol.

Author:
David Sugar dyfet.nosp@m.@gnu.nosp@m.telep.nosp@m.hony.nosp@m..org

Definition at line 413 of file memory.h.


Member Function Documentation

virtual void* ucommon::bufpager::_alloc ( size_t  size)
protectedvirtual

Allocate memory from the pager heap.

The size of the request must be less than the size of the memory page used. This implements the memory protocol allocation method.

Parameters:
sizeof memory request.
Returns:
allocated memory or NULL if not possible.

Reimplemented from ucommon::memalloc.

unsigned long ucommon::bufpager::getUsed ( void  )
inline

Get total size.

Returns:
number of characters in buffer.

Definition at line 447 of file memory.h.


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