Back to index

lightning-sunbird  0.9+nobinonly
Public Types | Public Member Functions
nsCppSharedAllocator< T > Class Template Reference

#include <nsCppSharedAllocator.h>

List of all members.

Public Types

typedef T value_type
typedef size_t size_type
typedef ptrdiff_t difference_type
typedef Tpointer
typedef const Tconst_pointer
typedef Treference
typedef const Tconst_reference

Public Member Functions

 nsCppSharedAllocator ()
 ~nsCppSharedAllocator ()
pointer address (reference r) const
const_pointer address (const_reference r) const
pointer allocate (size_type n, const void *=0)
void deallocate (pointer p, size_type)
void construct (pointer p, const T &val)
void destroy (pointer p)
size_type max_size () const

Detailed Description

template<class T>
class nsCppSharedAllocator< T >

Definition at line 28 of file nsCppSharedAllocator.h.


Member Typedef Documentation

template<class T>
typedef const T* nsCppSharedAllocator< T >::const_pointer

Definition at line 40 of file nsCppSharedAllocator.h.

template<class T>
typedef const T& nsCppSharedAllocator< T >::const_reference

Definition at line 43 of file nsCppSharedAllocator.h.

template<class T>
typedef ptrdiff_t nsCppSharedAllocator< T >::difference_type

Definition at line 37 of file nsCppSharedAllocator.h.

template<class T>
typedef T* nsCppSharedAllocator< T >::pointer

Definition at line 39 of file nsCppSharedAllocator.h.

template<class T>
typedef T& nsCppSharedAllocator< T >::reference

Definition at line 42 of file nsCppSharedAllocator.h.

template<class T>
typedef size_t nsCppSharedAllocator< T >::size_type

Definition at line 36 of file nsCppSharedAllocator.h.

template<class T>
typedef T nsCppSharedAllocator< T >::value_type

Definition at line 35 of file nsCppSharedAllocator.h.


Constructor & Destructor Documentation

template<class T>
nsCppSharedAllocator< T >::nsCppSharedAllocator ( ) [inline]

Definition at line 47 of file nsCppSharedAllocator.h.

{ }
template<class T>
nsCppSharedAllocator< T >::~nsCppSharedAllocator ( ) [inline]

Definition at line 54 of file nsCppSharedAllocator.h.

{ }

Member Function Documentation

template<class T>
pointer nsCppSharedAllocator< T >::address ( reference  r) const [inline]

Definition at line 58 of file nsCppSharedAllocator.h.

        {
          return &r;
        }
template<class T>
const_pointer nsCppSharedAllocator< T >::address ( const_reference  r) const [inline]

Definition at line 64 of file nsCppSharedAllocator.h.

        {
          return &r;
        }
template<class T>
pointer nsCppSharedAllocator< T >::allocate ( size_type  n,
const void = 0 
) [inline]

Definition at line 70 of file nsCppSharedAllocator.h.

Here is the call graph for this function:

template<class T>
void nsCppSharedAllocator< T >::construct ( pointer  p,
const T val 
) [inline]

Definition at line 82 of file nsCppSharedAllocator.h.

        {
          new (p) T(val);
        }
template<class T>
void nsCppSharedAllocator< T >::deallocate ( pointer  p,
size_type   
) [inline]

Definition at line 76 of file nsCppSharedAllocator.h.

        {
          nsMemory::Free(p);
        }

Here is the caller graph for this function:

template<class T>
void nsCppSharedAllocator< T >::destroy ( pointer  p) [inline]

Definition at line 88 of file nsCppSharedAllocator.h.

        {
          p->~T();
        }
template<class T>
size_type nsCppSharedAllocator< T >::max_size ( ) const [inline]

Definition at line 94 of file nsCppSharedAllocator.h.

        {
#ifdef HAVE_CPP_NUMERIC_LIMITS
          return numeric_limits<size_type>::max() / sizeof(T);
#else
          return ULONG_MAX / sizeof(T);
#endif
        }

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