Moses::MmapAllocator< T > Class Template Reference

#include <MmapAllocator.h>

List of all members.

Classes

struct  rebind

Public Types

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

Public Member Functions

 MmapAllocator () throw ()
 MmapAllocator (std::FILE *f_ptr) throw ()
 MmapAllocator (std::FILE *f_ptr, size_t data_offset) throw ()
 MmapAllocator (std::string fileName) throw ()
 MmapAllocator (const MmapAllocator &c) throw ()
 ~MmapAllocator () throw ()
pointer address (reference value) const
const_pointer address (const_reference value) const
size_type max_size () const throw ()
pointer allocate (size_type num, const void *=0)
void deallocate (pointer p, size_type num)
void construct (pointer p, const T &value)
void destroy (pointer p)

Protected Attributes

std::FILE * m_file_ptr
size_t m_file_desc
size_t m_page_size
size_t m_map_size
char * m_data_ptr
size_t m_data_offset
bool m_fixed
size_t * m_count

Friends

template<class T1 , class T2 >
bool operator== (const MmapAllocator< T1 > &, const MmapAllocator< T2 > &) throw ()
template<class T1 , class T2 >
bool operator!= (const MmapAllocator< T1 > &, const MmapAllocator< T2 > &) throw ()


Detailed Description

template<class T>
class Moses::MmapAllocator< T >

Definition at line 42 of file MmapAllocator.h.


Member Typedef Documentation

template<class T>
typedef const T* Moses::MmapAllocator< T >::const_pointer

Definition at line 59 of file MmapAllocator.h.

template<class T>
typedef const T& Moses::MmapAllocator< T >::const_reference

Definition at line 61 of file MmapAllocator.h.

template<class T>
typedef std::ptrdiff_t Moses::MmapAllocator< T >::difference_type

Definition at line 63 of file MmapAllocator.h.

template<class T>
typedef T* Moses::MmapAllocator< T >::pointer

Definition at line 58 of file MmapAllocator.h.

template<class T>
typedef T& Moses::MmapAllocator< T >::reference

Definition at line 60 of file MmapAllocator.h.

template<class T>
typedef std::size_t Moses::MmapAllocator< T >::size_type

Definition at line 62 of file MmapAllocator.h.

template<class T>
typedef T Moses::MmapAllocator< T >::value_type

Definition at line 57 of file MmapAllocator.h.


Constructor & Destructor Documentation

template<class T>
Moses::MmapAllocator< T >::MmapAllocator (  )  throw () [inline]

Definition at line 65 of file MmapAllocator.h.

template<class T>
Moses::MmapAllocator< T >::MmapAllocator ( std::FILE *  f_ptr  )  throw () [inline]

Definition at line 71 of file MmapAllocator.h.

template<class T>
Moses::MmapAllocator< T >::MmapAllocator ( std::FILE *  f_ptr,
size_t  data_offset 
) throw () [inline]

Definition at line 77 of file MmapAllocator.h.

template<class T>
Moses::MmapAllocator< T >::MmapAllocator ( std::string  fileName  )  throw () [inline]

Definition at line 83 of file MmapAllocator.h.

template<class T>
Moses::MmapAllocator< T >::MmapAllocator ( const MmapAllocator< T > &  c  )  throw () [inline]

Definition at line 89 of file MmapAllocator.h.

template<class T>
Moses::MmapAllocator< T >::~MmapAllocator (  )  throw () [inline]


Member Function Documentation

template<class T>
const_pointer Moses::MmapAllocator< T >::address ( const_reference  value  )  const [inline]

Definition at line 115 of file MmapAllocator.h.

template<class T>
pointer Moses::MmapAllocator< T >::address ( reference  value  )  const [inline]

Definition at line 111 of file MmapAllocator.h.

template<class T>
pointer Moses::MmapAllocator< T >::allocate ( size_type  num,
const void *  = 0 
) [inline]

template<class T>
void Moses::MmapAllocator< T >::construct ( pointer  p,
const T value 
) [inline]

Definition at line 162 of file MmapAllocator.h.

References Moses::MmapAllocator< T >::m_fixed.

template<class T>
void Moses::MmapAllocator< T >::deallocate ( pointer  p,
size_type  num 
) [inline]

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

Definition at line 166 of file MmapAllocator.h.

References Moses::MmapAllocator< T >::m_fixed.

template<class T>
size_type Moses::MmapAllocator< T >::max_size (  )  const throw () [inline]

Definition at line 119 of file MmapAllocator.h.


Friends And Related Function Documentation

template<class T>
template<class T1 , class T2 >
bool operator!= ( const MmapAllocator< T1 > &  a1,
const MmapAllocator< T2 > &  a2 
) throw () [friend]

Definition at line 194 of file MmapAllocator.h.

template<class T>
template<class T1 , class T2 >
bool operator== ( const MmapAllocator< T1 > &  a1,
const MmapAllocator< T2 > &  a2 
) throw () [friend]

Definition at line 179 of file MmapAllocator.h.


Member Data Documentation

template<class T>
size_t* Moses::MmapAllocator< T >::m_count [protected]

Definition at line 54 of file MmapAllocator.h.

Referenced by Moses::MmapAllocator< T >::~MmapAllocator().

template<class T>
size_t Moses::MmapAllocator< T >::m_data_offset [protected]

template<class T>
char* Moses::MmapAllocator< T >::m_data_ptr [protected]

template<class T>
size_t Moses::MmapAllocator< T >::m_file_desc [protected]

Definition at line 46 of file MmapAllocator.h.

Referenced by Moses::MmapAllocator< T >::allocate().

template<class T>
std::FILE* Moses::MmapAllocator< T >::m_file_ptr [protected]

Definition at line 45 of file MmapAllocator.h.

Referenced by Moses::MmapAllocator< T >::~MmapAllocator().

template<class T>
bool Moses::MmapAllocator< T >::m_fixed [protected]

template<class T>
size_t Moses::MmapAllocator< T >::m_map_size [protected]

template<class T>
size_t Moses::MmapAllocator< T >::m_page_size [protected]


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

Generated on Thu Jul 6 00:33:38 2017 for Moses by  doxygen 1.5.9