#include <mySharedAllocator.h>
Public Types | |
| typedef size_t | size_type |
| typedef ptrdiff_t | difference_type |
| typedef T * | pointer |
| typedef const T * | const_pointer |
| typedef T & | reference |
| typedef const T & | const_reference |
| typedef T | value_type |
Public Methods | |
| pointer | address (reference x) const |
| adress | |
| const_pointer | address (const_reference x) const |
| adress | |
| pointer | allocate (size_type n, mySharedAllocatorT< void >::const_pointer hint=0) |
| allocate memory | |
| void | deallocate (pointer p, size_type n) |
| free memory | |
| size_type | max_size () const throw () |
| maximum allocation size | |
| void | construct (pointer p, const T &val) |
| construct an object in allocated memory | |
| void | destroy (pointer p) |
| destroy an object in shared memory | |
: incorect usage of the class mySharedMemoryAllocator | |
| mySharedAllocatorT () throw () | |
| construtor | |
| mySharedAllocatorT (const mySharedAllocatorT &) throw () | |
| copy constructor | |
| template<typename U> | mySharedAllocatorT (const mySharedAllocatorT< U > &) throw () |
| copy from an other allocator | |
| ~mySharedAllocatorT () throw () | |
| destructor | |
Definition at line 81 of file mySharedAllocator.h.
|
|||||
|
Definition at line 86 of file mySharedAllocator.h. Referenced by mySharedAllocatorT< T >::address(), and mySharedAllocatorT< T >::allocate(). |
|
|||||
|
Definition at line 88 of file mySharedAllocator.h. Referenced by mySharedAllocatorT< T >::address(). |
|
|||||
|
Definition at line 84 of file mySharedAllocator.h. |
|
|||||
|
Definition at line 85 of file mySharedAllocator.h. Referenced by mySharedAllocatorT< T >::address(), mySharedAllocatorT< T >::allocate(), mySharedAllocatorT< T >::construct(), mySharedAllocatorT< T >::deallocate(), and mySharedAllocatorT< T >::destroy(). |
|
|||||
|
Definition at line 87 of file mySharedAllocator.h. Referenced by mySharedAllocatorT< T >::address(). |
|
|||||
|
Definition at line 83 of file mySharedAllocator.h. Referenced by mySharedAllocatorT< T >::allocate(), mySharedAllocatorT< T >::deallocate(), and mySharedAllocatorT< T >::max_size(). |
|
|||||
|
Definition at line 89 of file mySharedAllocator.h. |
|
|||||||||
|
construtor
Definition at line 98 of file mySharedAllocator.h.
00098 {
00099 //cerr<<"mySharedAllocatorT"<<endl;
00100 };
|
|
||||||||||
|
copy constructor
Definition at line 102 of file mySharedAllocator.h.
00102 {
00103 //cerr<<"mySharedAllocatorT(const mySharedAllocatorT &)"<<endl;
00104 };
|
|
||||||||||||||
|
copy from an other allocator
Definition at line 106 of file mySharedAllocator.h.
00106 {
00107 //cerr<<"mySharedAllocatorT(const mySharedAllocatorT<U> &)"<<endl;
00108 }
|
|
|||||||||
|
destructor
Definition at line 110 of file mySharedAllocator.h.
00110 {
00111 //cerr<<"~mySharedAllocatorT()"<<endl;
00112 };
|
|
||||||||||
|
adress
Definition at line 121 of file mySharedAllocator.h. References mySharedAllocatorT< T >::const_pointer, and mySharedAllocatorT< T >::const_reference.
00121 {
00122 return &x;
00123 }
|
|
||||||||||
|
adress
Definition at line 116 of file mySharedAllocator.h. References mySharedAllocatorT< T >::pointer, and mySharedAllocatorT< T >::reference.
00116 {
00117 return &x;
00118 }
|
|
||||||||||||||||
|
allocate memory
Definition at line 126 of file mySharedAllocator.h. References mySharedAllocatorT< T >::const_pointer, PsnSharedMemoryManager::lockIfNeeded(), PsnSharedMemoryManager::mmalloc(), mySharedAllocatorT< T >::pointer, mySharedAllocatorT< T >::size_type, PsMomeController::STLSharedMemoryManager, and PsnSharedMemoryManager::unlockIfNeeded().
00126 {
00127 if(n<0) {
00128 n=0;
00129 }
00130 PsnSharedMemoryManager * STLManager = PsMomeController::STLSharedMemoryManager;
00131 //cerr<<"mySharedAllocator::allocate avant lock()"<<endl;
00132 STLManager->lockIfNeeded();
00133 //cerr<<"mySharedAllocator::allocate après lock()"<<endl;
00134 pointer resul=(pointer)PsMomeController::STLSharedMemoryManager->mmalloc(n*sizeof(T));
00135 STLManager->unlockIfNeeded();
00136 return resul;
00137 }
|
|
||||||||||||||||
|
construct an object in allocated memory
Definition at line 154 of file mySharedAllocator.h. References mySharedAllocatorT< T >::pointer.
00154 {
00155 cerr<<"mySharedAllocatorT::construct"<<endl;
00156 return new((void *)p) T(val);
00157 };
|
|
||||||||||||||||
|
free memory
Definition at line 140 of file mySharedAllocator.h. References PsnSharedMemoryManager::lockIfNeeded(), PsnSharedMemoryManager::mfree(), mySharedAllocatorT< T >::pointer, mySharedAllocatorT< T >::size_type, PsMomeController::STLSharedMemoryManager, and PsnSharedMemoryManager::unlockIfNeeded().
00140 {
00141 PsnSharedMemoryManager * STLManager = PsMomeController::STLSharedMemoryManager;
00142 STLManager->lockIfNeeded();
00143 PsMomeController::STLSharedMemoryManager->mfree((void *)p,n*sizeof(T));
00144 STLManager->unlockIfNeeded();
00145 }
|
|
||||||||||
|
destroy an object in shared memory
Definition at line 160 of file mySharedAllocator.h. References mySharedAllocatorT< T >::pointer.
00160 {
00161 cerr<<"mySharedAllocatorT::destroy"<<endl;
00162 ((T*)p)->~T() ;
00163 }
|
|
|||||||||
|
maximum allocation size
Definition at line 148 of file mySharedAllocator.h. References mySharedAllocatorT< T >::size_type.
00148 {
00149 cerr<<"mySharedAllocatorT::max_size"<<endl;
00150 return 16374;
00151 }
|
| Documentation generated on Mon Nov 25 15:26:14 2002 |
Generated with doxygen 1.2.12 by Dimitri van Heesch , 1997-2001 |