Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

PsAllocatorT Class Template Reference

general code. More...

#include <PsAllocator.h>

List of all members.

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
const_pointer address (const_reference x) const
pointer allocate (size_type n, PsAllocatorT< void >::const_pointer hint=0)
void deallocate (pointer p, size_type n)
size_type max_size () const throw ()
void construct (pointer p, const T &val)
void destroy (pointer p)
: incorect usage of the class PsMemoryAllocator
 PsAllocatorT () throw ()
 construtor. More...

 PsAllocatorT (const PsAllocatorT &) throw ()
 copy constructor. More...

template<typename U>  PsAllocatorT (const PsAllocatorT< U > &) throw ()
 copy from an other allocator. More...

 ~PsAllocatorT () throw ()
 destructor. More...


Detailed Description

template<typename T>
class PsAllocatorT< T >

general code.

Definition at line 45 of file PsAllocator.h.


Member Typedef Documentation

template<typename T>
typedef const T* PsAllocatorT::const_pointer
 

Definition at line 50 of file PsAllocator.h.

Referenced by address, and allocate.

template<typename T>
typedef const T& PsAllocatorT::const_reference
 

Definition at line 52 of file PsAllocator.h.

Referenced by address.

template<typename T>
typedef ptrdiff_t PsAllocatorT::difference_type
 

Definition at line 48 of file PsAllocator.h.

template<typename T>
typedef T* PsAllocatorT::pointer
 

Definition at line 49 of file PsAllocator.h.

Referenced by address, allocate, construct, deallocate, and destroy.

template<typename T>
typedef T& PsAllocatorT::reference
 

Definition at line 51 of file PsAllocator.h.

Referenced by address.

template<typename T>
typedef size_t PsAllocatorT::size_type
 

Definition at line 47 of file PsAllocator.h.

Referenced by allocate, deallocate, and max_size.

template<typename T>
typedef T PsAllocatorT::value_type
 

Definition at line 53 of file PsAllocator.h.


Constructor & Destructor Documentation

template<typename T>
PsAllocatorT< T >::PsAllocatorT   throw () [inline]
 

construtor.

Definition at line 62 of file PsAllocator.h.

00062                            {
00063       //cerr<<"PsAllocatorT"<<endl;
00064    }

template<typename T>
PsAllocatorT< T >::PsAllocatorT const PsAllocatorT< T > &    throw () [inline]
 

copy constructor.

Definition at line 68 of file PsAllocator.h.

00068                                               {
00069       //cerr<<"PsAllocatorT(const PsAllocatorT &)"<<endl;
00070    }

template<typename T>
template<typename U>
PsAllocatorT< T >::PsAllocatorT const PsAllocatorT< U > &    throw () [inline]
 

copy from an other allocator.

Definition at line 74 of file PsAllocator.h.

00074                                                                        {
00075       //cerr<<"PsAllocatorT(const PsAllocatorT<U> &)"<<endl;   
00076    }

template<typename T>
PsAllocatorT< T >::~PsAllocatorT   throw () [inline]
 

destructor.

Definition at line 80 of file PsAllocator.h.

00080                            {
00081       //cerr<<"~PsAllocatorT()"<<endl;
00082    }


Member Function Documentation

template<typename T>
const_pointer PsAllocatorT< T >::address const_reference    x const [inline]
 

Definition at line 89 of file PsAllocator.h.

References const_pointer, and const_reference.

00089                                                   {
00090       return &x;
00091    }

template<typename T>
pointer PsAllocatorT< T >::address reference    x const [inline]
 

Definition at line 85 of file PsAllocator.h.

References pointer, and reference.

00085                                       {
00086       return &x;
00087    }

template<typename T>
pointer PsAllocatorT< T >::allocate size_type    n,
PsAllocatorT< void >::const_pointer    hint = 0
[inline]
 

Definition at line 93 of file PsAllocator.h.

References const_pointer, pointer, and size_type.

00093                                                                             {
00094 #ifdef _DEBUGALLOCATIONMOME
00095       cerr<<"PsAllocatorT::allocate"<<endl;
00096 #endif
00097       if(n<=0) {
00098          n=1;
00099       }
00100       pointer resul=(pointer)operator new(n*sizeof(T));
00101 #ifdef _DEBUGALLOCATIONMOME
00102       cerr<<"PsAllocatorT::allocate returns "<<resul<<" of size "<<n*sizeof(T)<<endl;
00103 #endif
00104       return resul;
00105    }

template<typename T>
void PsAllocatorT< T >::construct pointer    p,
const T &    val
[inline]
 

Definition at line 121 of file PsAllocator.h.

References pointer.

00121                                            {
00122 #ifdef _DEBUGALLOCATIONMOME
00123       cerr<<"PsAllocatorT::construct"<<endl;
00124 #endif
00125       return new((void *)p) T(val);
00126    };

template<typename T>
void PsAllocatorT< T >::deallocate pointer    p,
size_type    n
[inline]
 

Definition at line 107 of file PsAllocator.h.

References pointer, and size_type.

00107                                            {
00108 #ifdef _DEBUGALLOCATIONMOME
00109       cerr<<"PsAllocatorT::deallocate"<<endl;
00110 #endif
00111       operator delete ((void *)p);
00112    }

template<typename T>
void PsAllocatorT< T >::destroy pointer    p [inline]
 

Definition at line 128 of file PsAllocator.h.

References pointer.

00128                            {
00129 #ifdef _DEBUGALLOCATIONMOME
00130       cerr<<"PsAllocatorT::destroy"<<endl;
00131 #endif
00132       ((T*)p)->~T() ;
00133    }

template<typename T>
size_type PsAllocatorT< T >::max_size   const throw () [inline]
 

Definition at line 114 of file PsAllocator.h.

References size_type.

00114                                       {
00115 #ifdef _DEBUGALLOCATIONMOME
00116       cerr<<"PsAllocatorT::max_size"<<endl;
00117 #endif
00118       return 16374;
00119    }


logo OpenMask

Documentation generated on Wed Jun 2 18:49:04 2004

Generated with doxygen 1.2.12 by Dimitri van Heesch ,   1997-2001