1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180
|
.TH ACE_Locked_Free_List 3 "1 Dec 2001" "ACE" \" -*- nroff -*-
.ad l
.nh
.SH NAME
ACE_Locked_Free_List \- Implements a free list.
.SH SYNOPSIS
.br
.PP
\fC#include <Free_List.h>\fR
.PP
Inherits \fBACE_Free_List< T >\fR.
.PP
.SS Public Methods
.in +1c
.ti -1c
.RI "\fBACE_Locked_Free_List\fR (int mode = ACE_FREE_LIST_WITH_POOL, size_t prealloc = ACE_DEFAULT_FREE_LIST_PREALLOC, size_t lwm = ACE_DEFAULT_FREE_LIST_LWM, size_t hwm = ACE_DEFAULT_FREE_LIST_HWM, size_t inc = ACE_DEFAULT_FREE_LIST_INC)"
.br
.ti -1c
.RI "virtual \fB~ACE_Locked_Free_List\fR (void)"
.br
.RI "\fIDestructor - removes all the elements from the free_list.\fR"
.ti -1c
.RI "virtual void \fBadd\fR (T *element)"
.br
.RI "\fIInserts an element onto the free list (if it isn't past the high water mark).\fR"
.ti -1c
.RI "virtual T* \fBremove\fR (void)"
.br
.RI "\fITakes a element off the freelist and returns it. It creates <inc> new elements if the size is at or below the low water mark.\fR"
.ti -1c
.RI "virtual size_t \fBsize\fR (void)"
.br
.RI "\fIReturns the current size of the free list.\fR"
.ti -1c
.RI "virtual void \fBresize\fR (size_t newsize)"
.br
.RI "\fIResizes the free list to <newsize>.\fR"
.in -1c
.SS Protected Methods
.in +1c
.ti -1c
.RI "virtual void \fBalloc\fR (size_t n)"
.br
.RI "\fIAllocates <n> extra nodes for the freelist.\fR"
.ti -1c
.RI "virtual void \fBdealloc\fR (size_t n)"
.br
.RI "\fIRemoves and frees <n> nodes from the freelist.\fR"
.in -1c
.SS Protected Attributes
.in +1c
.ti -1c
.RI "int \fBmode_\fR"
.br
.RI "\fIFree list operation mode, either ACE_FREE_LIST_WITH_POOL or ACE_PURE_FREE_LIST.\fR"
.ti -1c
.RI "T* \fBfree_list_\fR"
.br
.RI "\fIPointer to the first node in the freelist.\fR"
.ti -1c
.RI "size_t \fBlwm_\fR"
.br
.RI "\fILow water mark.\fR"
.ti -1c
.RI "size_t \fBhwm_\fR"
.br
.RI "\fIHigh water mark.\fR"
.ti -1c
.RI "size_t \fBinc_\fR"
.br
.RI "\fIIncrement value.\fR"
.ti -1c
.RI "size_t \fBsize_\fR"
.br
.RI "\fIKeeps track of the size of the list.\fR"
.ti -1c
.RI "ACE_LOCK \fBmutex_\fR"
.br
.RI "\fISynchronization variable for .\fR"
.in -1c
.SS Private Methods
.in +1c
.ti -1c
.RI "\fBACE_Locked_Free_List\fR (const ACE_Locked_Free_List<T, ACE_LOCK> &)"
.br
.ti -1c
.RI "void \fBoperator=\fR (const ACE_Locked_Free_List<T, ACE_LOCK> &)"
.br
.in -1c
.SH DETAILED DESCRIPTION
.PP
.SS template<class T, class ACE_LOCK> template class ACE_Locked_Free_List
Implements a free list.
.PP
.PP
This class maintains a free list of nodes of type T. It depends on the type T having a <get_next> and <set_next> method. It maintains a mutex so the freelist can be used in a multithreaded program .
.PP
.SH CONSTRUCTOR & DESTRUCTOR DOCUMENTATION
.PP
.SS template<classT, classACE_LOCK> ACE_Locked_Free_List<T, ACE_LOCK>::ACE_Locked_Free_List<T, ACE_LOCK> (int mode = ACE_FREE_LIST_WITH_POOL, size_t prealloc = ACE_DEFAULT_FREE_LIST_PREALLOC, size_t lwm = ACE_DEFAULT_FREE_LIST_LWM, size_t hwm = ACE_DEFAULT_FREE_LIST_HWM, size_t inc = ACE_DEFAULT_FREE_LIST_INC)
.PP
Constructor takes a <mode> (i.e., ACE_FREE_LIST_WITH_POOL or ACE_PURE_FREE_LIST), a count of the number of nodes to <prealloc>, a low and high water mark (<lwm> and <hwm>) that indicate when to allocate more nodes, an increment value (<inc>) that indicates how many nodes to allocate when the list must grow.
.SS template<classT, classACE_LOCK> ACE_Locked_Free_List<T, ACE_LOCK>::~ACE_Locked_Free_List<T, ACE_LOCK> (void)\fC [virtual]\fR
.PP
Destructor - removes all the elements from the free_list.
.PP
.SS template<classT, classACE_LOCK> ACE_Locked_Free_List<T, ACE_LOCK>::ACE_Locked_Free_List<T, ACE_LOCK> (const ACE_Locked_Free_List< T,ACE_LOCK >&)\fC [private]\fR
.PP
.SH MEMBER FUNCTION DOCUMENTATION
.PP
.SS template<classT, classACE_LOCK> void ACE_Locked_Free_List<T, ACE_LOCK>::add (T * element)\fC [virtual]\fR
.PP
Inserts an element onto the free list (if it isn't past the high water mark).
.PP
Reimplemented from \fBACE_Free_List\fR.
.SS template<classT, classACE_LOCK> void ACE_Locked_Free_List<T, ACE_LOCK>::alloc (size_t n)\fC [protected, virtual]\fR
.PP
Allocates <n> extra nodes for the freelist.
.PP
.SS template<classT, classACE_LOCK> void ACE_Locked_Free_List<T, ACE_LOCK>::dealloc (size_t n)\fC [protected, virtual]\fR
.PP
Removes and frees <n> nodes from the freelist.
.PP
.SS template<classT, classACE_LOCK> void ACE_Locked_Free_List<T, ACE_LOCK>::operator= (const ACE_Locked_Free_List< T,ACE_LOCK >&)\fC [private]\fR
.PP
.SS template<classT, classACE_LOCK> T * ACE_Locked_Free_List<T, ACE_LOCK>::remove (void)\fC [virtual]\fR
.PP
Takes a element off the freelist and returns it. It creates <inc> new elements if the size is at or below the low water mark.
.PP
Reimplemented from \fBACE_Free_List\fR.
.SS template<classT, classACE_LOCK> void ACE_Locked_Free_List<T, ACE_LOCK>::resize (size_t newsize)\fC [virtual]\fR
.PP
Resizes the free list to <newsize>.
.PP
Reimplemented from \fBACE_Free_List\fR.
.SS template<classT, classACE_LOCK> size_t ACE_Locked_Free_List<T, ACE_LOCK>::size (void)\fC [virtual]\fR
.PP
Returns the current size of the free list.
.PP
Reimplemented from \fBACE_Free_List\fR.
.SH MEMBER DATA DOCUMENTATION
.PP
.SS template<classT, classACE_LOCK> T * ACE_Locked_Free_List<T, ACE_LOCK>::free_list_\fC [protected]\fR
.PP
Pointer to the first node in the freelist.
.PP
.SS template<classT, classACE_LOCK> size_t ACE_Locked_Free_List<T, ACE_LOCK>::hwm_\fC [protected]\fR
.PP
High water mark.
.PP
.SS template<classT, classACE_LOCK> size_t ACE_Locked_Free_List<T, ACE_LOCK>::inc_\fC [protected]\fR
.PP
Increment value.
.PP
.SS template<classT, classACE_LOCK> size_t ACE_Locked_Free_List<T, ACE_LOCK>::lwm_\fC [protected]\fR
.PP
Low water mark.
.PP
.SS template<classT, classACE_LOCK> int ACE_Locked_Free_List<T, ACE_LOCK>::mode_\fC [protected]\fR
.PP
Free list operation mode, either ACE_FREE_LIST_WITH_POOL or ACE_PURE_FREE_LIST.
.PP
.SS template<classT, classACE_LOCK> ACE_LOCK ACE_Locked_Free_List<T, ACE_LOCK>::mutex_\fC [protected]\fR
.PP
Synchronization variable for .
.PP
.SS template<classT, classACE_LOCK> size_t ACE_Locked_Free_List<T, ACE_LOCK>::size_\fC [protected]\fR
.PP
Keeps track of the size of the list.
.PP
.SH AUTHOR
.PP
Generated automatically by Doxygen for ACE from the source code.
|