UCommon
Protected Member Functions
ucommon::PagerReuse Class Reference

A mempager source of reusable objects. More...

#include <vector.h>

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

Protected Member Functions

bool avail (void)
 
ReusableObjectget (void)
 
ReusableObjectget (timeout_t timeout)
 
 PagerReuse (mempager *pager, size_t objsize, unsigned count)
 
ReusableObjectrequest (void)
 
- Protected Member Functions inherited from ucommon::MemoryRedirect
virtual void * _alloc (size_t size)
 
 MemoryRedirect (MemoryProtocol *protocol)
 
- Protected Member Functions inherited from ucommon::MemoryProtocol
virtual void * _alloc (size_t size)=0
 Protocol to allocate memory from the pager heap. More...
 
virtual void fault (void) const
 Allocation failure handler.
 
void * alloc (size_t size)
 Convenience function. More...
 
char * dup (const char *string)
 Duplicate NULL terminated string into allocated memory. More...
 
void * dup (void *memory, size_t size)
 Duplicate existing memory block into allocated memory. More...
 
void * zalloc (size_t size)
 Allocate memory from the pager heap. More...
 
- Protected Member Functions inherited from ucommon::ReusableAllocator
ReusableObjectnext (ReusableObject *object)
 Get next reusable object in the pool. More...
 
void release (ReusableObject *object)
 Release resuable object. More...
 
 ReusableAllocator ()
 Initialize reusable allocator through a conditional. More...
 
- Protected Member Functions inherited from ucommon::Conditional
void broadcast (void)
 Signal the conditional to release all waiting threads.
 
 Conditional ()
 Initialize and construct conditional.
 
void lock (void)
 Lock the conditional's supporting mutex.
 
void signal (void)
 Signal the conditional to release one waiting thread.
 
void unlock (void)
 Unlock the conditional's supporting mutex.
 
bool wait (timeout_t timeout)
 Conditional wait for signal on millisecond timeout. More...
 
bool wait (struct timespec *timeout)
 Conditional wait for signal on timespec timeout. More...
 
void wait (void)
 Wait (block) until signalled.
 
 ~Conditional ()
 Destroy conditional, release any blocked threads.
 

Additional Inherited Members

- Static Protected Member Functions inherited from ucommon::Conditional
static pthread_condattr_t * initializer (void)
 Support function for getting conditional attributes for realtime scheduling. More...
 
static void set (struct timespec *hires, timeout_t timeout)
 Convert a millisecond timeout into use for high resolution conditional timers. More...
 
- Protected Attributes inherited from ucommon::ReusableAllocator
ReusableObjectfreelist
 
unsigned waiting
 

Detailed Description

A mempager source of reusable objects.

This is used by the reuse_pager template to allocate new objects either from a memory pager used as a private heap, or from previously allocated objects that have been returned for reuse.

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

Definition at line 77 of file vector.h.


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