The world's most popular open source database
#include <Pool.hpp>
Inheritance diagram for Pool< T >:


Public Types | |
| defInitSize = 256 | |
| defIncSize = 64 | |
| enum | { defInitSize = 256, defIncSize = 64 } |
Public Member Functions | |
| Pool (int anInitSize=defInitSize, int anIncSize=defIncSize) | |
| virtual | ~Pool (void) |
| T * | get () |
| void | put (T *aT) |
| unsigned | size () |
Protected Member Functions | |
| void | allocate (int aSize) |
Private Member Functions | |
| Pool< T > & | operator= (const Pool< T > &cp) |
| Pool (const Pool< T > &cp) | |
Private Attributes | |
| int | theIncSize |
| int | theTop |
| int | theCurrentSize |
| T ** | theList |
Definition at line 185 of file Pool.hpp.
| anonymous enum |
| Pool< T >::Pool | ( | int | anInitSize = defInitSize, |
|
| int | anIncSize = defIncSize | |||
| ) | [inline] |
Definition at line 190 of file Pool.hpp.
00190 : 00191 theIncSize(anIncSize), 00192 theTop(0), 00193 theCurrentSize(0), 00194 theList(0) 00195 { 00196 allocate(anInitSize); 00197 }
| void Pool< T >::allocate | ( | int | aSize | ) | [inline, protected] |
Definition at line 213 of file Pool.hpp.
Referenced by Pool< T >::get(), and Pool< Request >::Pool().
00214 { 00215 T** tList = theList; 00216 int i; 00217 theList = new T*[aSize+theCurrentSize]; 00218 // allocate full list 00219 for (i = 0; i < theTop; i++) { 00220 theList[i] = tList[i]; 00221 } 00222 delete []tList; 00223 for (; (theTop < aSize); theTop++){ 00224 theList[theTop] = (T*)new T; 00225 } 00226 theCurrentSize += aSize; 00227 }
Here is the caller graph for this function:

| T * Pool< T >::get | ( | ) | [inline] |
Definition at line 241 of file Pool.hpp.
References Pool< T >::allocate(), Pool< T >::theIncSize, Pool< T >::theList, and Pool< T >::theTop.
Referenced by closeFile(), Ndbfs::execFSAPPENDREQ(), Ndbfs::execFSCLOSEREQ(), Ndbfs::execFSOPENREQ(), Ndbfs::execFSREMOVEREQ(), Ndbfs::execFSSYNCREQ(), openFile(), readFile(), Ndbfs::readWriteRequest(), writeFile(), and writeSyncFile().
00242 { 00243 T* tmp; 00244 if( theTop == 0 ) 00245 { 00246 allocate(theIncSize); 00247 } 00248 --theTop; 00249 tmp = theList[theTop]; 00250 return tmp; 00251 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Pool< T >::put | ( | T * | aT | ) | [inline] |
Definition at line 255 of file Pool.hpp.
References Pool< T >::theList, and Pool< T >::theTop.
Referenced by closeFile(), closeFileWait(), Ndbfs::execFSAPPENDREQ(), openFile(), openFileWait(), readFile(), readFileWait(), Ndbfs::scanIPC(), writeFile(), writeFileWait(), writeSyncFile(), and writeSyncFileWait().
Here is the caller graph for this function:

| unsigned Pool< T >::size | ( | void | ) | [inline] |
Definition at line 210 of file Pool.hpp.
Referenced by Ndbfs::execDUMP_STATE_ORD().
00210 { return theTop; };
Here is the caller graph for this function:

int Pool< T >::theCurrentSize [private] |
int Pool< T >::theIncSize [private] |
Definition at line 237 of file Pool.hpp.
Referenced by Pool< Request >::allocate(), Pool< T >::get(), Pool< T >::put(), and Pool< Request >::~Pool().
Definition at line 234 of file Pool.hpp.
Referenced by Pool< Request >::allocate(), Pool< T >::get(), Pool< T >::put(), Pool< Request >::size(), and Pool< Request >::~Pool().
1.4.7

