Buffered pager for storing paged strings for character protocol.
More...
#include <memory.h>
Public Member Functions |
| void | add (const char *text) |
| | Add text to string buffer.
|
|
| bufpager (size_t page=0) |
|
void | commit (size_t size) |
|
char * | copy (size_t *iosize) |
| char * | dup (void) |
| | Create an output string from buffer.
|
| size_t | get (char *text, size_t size) |
| | Get string from buffer.
|
| unsigned long | getUsed (void) |
| | Get total size.
|
| char * | operator* () |
| | Convenience operator to get text.
|
| bufpager & | operator<< (const char *text) |
| | Convenience operator to add to pager.
|
| void | put (const char *text, size_t size) |
| | Put memory string into buffer including NULL byte.
|
|
void | release (void) |
|
char * | request (size_t *iosize) |
|
void | reset (void) |
| | Reset pager text buffer protocol.
|
|
void | rewind (void) |
| | Rewind to start of text buffer protocol.
|
| void | set (const char *text) |
| | Set text of string buffer.
|
| 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.
|
| 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.
|
| 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.
|
| page_t * | pager (void) |
| | Acquire a new page from the heap.
|
| virtual void * | _alloc (size_t size)=0 |
| | Protocol to allocate memory from the pager heap.
|
|
virtual void | _lock (void) |
|
virtual void | _unlock (void) |
| virtual int | _getch (void)=0 |
| | Get the next character.
|
| virtual int | _putch (int code)=0 |
| | Put the next character.
|
Additional Inherited Members |
|
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 597 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
-
- Returns
- allocated memory or NULL if not possible.
Reimplemented from ucommon::memalloc.
| void ucommon::bufpager::add |
( |
const char * |
text | ) |
|
Add text to string buffer.
- Parameters
-
| char* ucommon::bufpager::dup |
( |
void |
| ) |
|
Create an output string from buffer.
- Returns
- output string allocated.
| size_t ucommon::bufpager::get |
( |
char * |
text, |
|
|
size_t |
size |
|
) |
| |
Get string from buffer.
- Parameters
-
| text | to save into. |
| size | of buffer. |
- Returns
- count of characters copied.
| unsigned long ucommon::bufpager::getUsed |
( |
void |
| ) |
|
|
inline |
Get total size.
- Returns
- number of characters in buffer.
Definition at line 664 of file memory.h.
| char* ucommon::bufpager::operator* |
( |
| ) |
|
|
inline |
Convenience operator to get text.
- Returns
- text string of buffer.
Definition at line 671 of file memory.h.
| bufpager& ucommon::bufpager::operator<< |
( |
const char * |
text | ) |
|
|
inline |
Convenience operator to add to pager.
- Parameters
-
Definition at line 678 of file memory.h.
| void ucommon::bufpager::put |
( |
const char * |
text, |
|
|
size_t |
size |
|
) |
| |
Put memory string into buffer including NULL byte.
- Parameters
-
| text | to add. |
| size | of text to add. |
| void ucommon::bufpager::set |
( |
const char * |
text | ) |
|
Set text of string buffer.
- Parameters
-
The documentation for this class was generated from the following file: