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

PLearn::ArrayAllocatorTrivial< T, SizeBits > Class Template Reference

This allocator solely performs allocation. More...

#include <ArrayAllocatorTrivial.h>

Collaboration diagram for PLearn::ArrayAllocatorTrivial< T, SizeBits >:

Collaboration graph
[legend]
List of all members.

Public Types

typedef ArrayAllocatorTrivial<
T, SizeBits > 
self
typedef T value_type
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 unsigned index_base
typedef ArrayAllocatorIndex<
index_base, SizeBits > 
index_type

Public Member Functions

 ArrayAllocatorTrivial (unsigned numberObjects)
pointer allocate (size_t n)
 Default copy ctor, dtor, op= Allocate N objects of type T and return a (memory) pointer to it.

void deallocate (pointer p, size_type n)
 "Deallocate" pointer (no-op)

void deallocate (index_type)
void resize (size_type newMaxObjs)
 Change the maximum number of objects.

size_type max_size () const
void swap (self &)
 Interchange two allocators.

index_type toIndex (pointer p, size_type n)
 Index/pointer conversion.

pointer toPointer (index_type)

Private Attributes

vector< T > arr
index_base free_point

Detailed Description

template<class T, unsigned SizeBits>
class PLearn::ArrayAllocatorTrivial< T, SizeBits >

This allocator solely performs allocation.

Definition at line 60 of file ArrayAllocatorTrivial.h.


Member Typedef Documentation

template<class T, unsigned SizeBits>
typedef const T* PLearn::ArrayAllocatorTrivial< T, SizeBits >::const_pointer
 

Definition at line 69 of file ArrayAllocatorTrivial.h.

template<class T, unsigned SizeBits>
typedef const T& PLearn::ArrayAllocatorTrivial< T, SizeBits >::const_reference
 

Definition at line 71 of file ArrayAllocatorTrivial.h.

template<class T, unsigned SizeBits>
typedef ptrdiff_t PLearn::ArrayAllocatorTrivial< T, SizeBits >::difference_type
 

Definition at line 66 of file ArrayAllocatorTrivial.h.

template<class T, unsigned SizeBits>
typedef unsigned PLearn::ArrayAllocatorTrivial< T, SizeBits >::index_base
 

Definition at line 73 of file ArrayAllocatorTrivial.h.

template<class T, unsigned SizeBits>
typedef ArrayAllocatorIndex<index_base, SizeBits> PLearn::ArrayAllocatorTrivial< T, SizeBits >::index_type
 

Definition at line 74 of file ArrayAllocatorTrivial.h.

template<class T, unsigned SizeBits>
typedef T* PLearn::ArrayAllocatorTrivial< T, SizeBits >::pointer
 

Definition at line 68 of file ArrayAllocatorTrivial.h.

template<class T, unsigned SizeBits>
typedef T& PLearn::ArrayAllocatorTrivial< T, SizeBits >::reference
 

Definition at line 70 of file ArrayAllocatorTrivial.h.

template<class T, unsigned SizeBits>
typedef ArrayAllocatorTrivial<T,SizeBits> PLearn::ArrayAllocatorTrivial< T, SizeBits >::self
 

Definition at line 63 of file ArrayAllocatorTrivial.h.

template<class T, unsigned SizeBits>
typedef size_t PLearn::ArrayAllocatorTrivial< T, SizeBits >::size_type
 

Definition at line 65 of file ArrayAllocatorTrivial.h.

Referenced by PLearn::ArrayAllocatorTrivial< T, SizeBits >::max_size().

template<class T, unsigned SizeBits>
typedef T PLearn::ArrayAllocatorTrivial< T, SizeBits >::value_type
 

Definition at line 64 of file ArrayAllocatorTrivial.h.


Constructor & Destructor Documentation

template<class T, unsigned SizeBits>
PLearn::ArrayAllocatorTrivial< T, SizeBits >::ArrayAllocatorTrivial unsigned  numberObjects  ) 
 

Definition at line 111 of file ArrayAllocatorTrivial.h.


Member Function Documentation

template<class T, unsigned SizeBits>
T * PLearn::ArrayAllocatorTrivial< T, SizeBits >::allocate size_t  n  ) 
 

Default copy ctor, dtor, op= Allocate N objects of type T and return a (memory) pointer to it.

Definition at line 125 of file ArrayAllocatorTrivial.h.

References PLearn::ArrayAllocatorTrivial< T, SizeBits >::arr, PLearn::ArrayAllocatorTrivial< T, SizeBits >::free_point, and PLERROR.

template<class T, unsigned SizeBits>
void PLearn::ArrayAllocatorTrivial< T, SizeBits >::deallocate index_type   )  [inline]
 

Definition at line 85 of file ArrayAllocatorTrivial.h.

template<class T, unsigned SizeBits>
void PLearn::ArrayAllocatorTrivial< T, SizeBits >::deallocate pointer  p,
size_type  n
[inline]
 

"Deallocate" pointer (no-op)

Definition at line 84 of file ArrayAllocatorTrivial.h.

References PLearn::ArrayAllocatorTrivial< T, SizeBits >::deallocate().

Referenced by PLearn::ArrayAllocatorTrivial< T, SizeBits >::deallocate().

template<class T, unsigned SizeBits>
size_type PLearn::ArrayAllocatorTrivial< T, SizeBits >::max_size  )  const [inline]
 

Definition at line 89 of file ArrayAllocatorTrivial.h.

References PLearn::ArrayAllocatorTrivial< T, SizeBits >::arr, and PLearn::ArrayAllocatorTrivial< T, SizeBits >::size_type.

template<class T, unsigned SizeBits>
void PLearn::ArrayAllocatorTrivial< T, SizeBits >::resize size_type  newMaxObjs  ) 
 

Change the maximum number of objects.

Definition at line 117 of file ArrayAllocatorTrivial.h.

References PLearn::ArrayAllocatorTrivial< T, SizeBits >::arr, PLearn::ArrayAllocatorTrivial< T, SizeBits >::free_point, PLearn::max(), and PLearn::min().

template<class T, unsigned SizeBits>
void PLearn::ArrayAllocatorTrivial< T, SizeBits >::swap self  ) 
 

Interchange two allocators.

Definition at line 138 of file ArrayAllocatorTrivial.h.

References PLearn::ArrayAllocatorTrivial< T, SizeBits >::arr, PLearn::ArrayAllocatorTrivial< T, SizeBits >::free_point, and PLearn::swap().

template<class T, unsigned SizeBits>
ArrayAllocatorTrivial< T, SizeBits >::index_type PLearn::ArrayAllocatorTrivial< T, SizeBits >::toIndex pointer  p,
size_type  n
[inline]
 

Index/pointer conversion.

Definition at line 148 of file ArrayAllocatorTrivial.h.

References PLearn::ArrayAllocatorTrivial< T, SizeBits >::arr.

template<class T, unsigned SizeBits>
ArrayAllocatorTrivial< T, SizeBits >::pointer PLearn::ArrayAllocatorTrivial< T, SizeBits >::toPointer index_type   )  [inline]
 

Definition at line 160 of file ArrayAllocatorTrivial.h.

References PLearn::ArrayAllocatorTrivial< T, SizeBits >::arr, PLearn::ArrayAllocatorIndex< index_base, SizeBits >::index, and PLearn::ArrayAllocatorIndex< index_base, SizeBits >::isNull().


Member Data Documentation

template<class T, unsigned SizeBits>
vector<T> PLearn::ArrayAllocatorTrivial< T, SizeBits >::arr [private]
 

Definition at line 102 of file ArrayAllocatorTrivial.h.

Referenced by PLearn::ArrayAllocatorTrivial< T, SizeBits >::allocate(), PLearn::ArrayAllocatorTrivial< T, SizeBits >::max_size(), PLearn::ArrayAllocatorTrivial< T, SizeBits >::resize(), PLearn::ArrayAllocatorTrivial< T, SizeBits >::swap(), PLearn::ArrayAllocatorTrivial< T, SizeBits >::toIndex(), and PLearn::ArrayAllocatorTrivial< T, SizeBits >::toPointer().

template<class T, unsigned SizeBits>
index_base PLearn::ArrayAllocatorTrivial< T, SizeBits >::free_point [private]
 

Definition at line 103 of file ArrayAllocatorTrivial.h.

Referenced by PLearn::ArrayAllocatorTrivial< T, SizeBits >::allocate(), PLearn::ArrayAllocatorTrivial< T, SizeBits >::resize(), and PLearn::ArrayAllocatorTrivial< T, SizeBits >::swap().


The documentation for this class was generated from the following file:
Generated on Tue Aug 17 16:22:33 2004 for PLearn by doxygen 1.3.7