#include <MmapAllocator.h>
Classes | |
struct | rebind |
Public Types | |
typedef T | value_type |
typedef T * | pointer |
typedef const T * | const_pointer |
typedef T & | reference |
typedef const T & | const_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 () |
Definition at line 42 of file MmapAllocator.h.
typedef const T* Moses::MmapAllocator< T >::const_pointer |
Definition at line 59 of file MmapAllocator.h.
typedef const T& Moses::MmapAllocator< T >::const_reference |
Definition at line 61 of file MmapAllocator.h.
typedef std::ptrdiff_t Moses::MmapAllocator< T >::difference_type |
Definition at line 63 of file MmapAllocator.h.
typedef T* Moses::MmapAllocator< T >::pointer |
Definition at line 58 of file MmapAllocator.h.
typedef T& Moses::MmapAllocator< T >::reference |
Definition at line 60 of file MmapAllocator.h.
typedef std::size_t Moses::MmapAllocator< T >::size_type |
Definition at line 62 of file MmapAllocator.h.
typedef T Moses::MmapAllocator< T >::value_type |
Definition at line 57 of file MmapAllocator.h.
Moses::MmapAllocator< T >::MmapAllocator | ( | ) | throw () [inline] |
Definition at line 65 of file MmapAllocator.h.
Moses::MmapAllocator< T >::MmapAllocator | ( | std::FILE * | f_ptr | ) | throw () [inline] |
Definition at line 71 of file MmapAllocator.h.
Moses::MmapAllocator< T >::MmapAllocator | ( | std::FILE * | f_ptr, | |
size_t | data_offset | |||
) | throw () [inline] |
Definition at line 77 of file MmapAllocator.h.
Moses::MmapAllocator< T >::MmapAllocator | ( | std::string | fileName | ) | throw () [inline] |
Definition at line 83 of file MmapAllocator.h.
Moses::MmapAllocator< T >::MmapAllocator | ( | const MmapAllocator< T > & | c | ) | throw () [inline] |
Definition at line 89 of file MmapAllocator.h.
Moses::MmapAllocator< T >::~MmapAllocator | ( | ) | throw () [inline] |
Definition at line 97 of file MmapAllocator.h.
References ftell(), Moses::MmapAllocator< T >::m_count, Moses::MmapAllocator< T >::m_data_ptr, Moses::MmapAllocator< T >::m_file_ptr, Moses::MmapAllocator< T >::m_fixed, Moses::MmapAllocator< T >::m_map_size, and util::UnmapOrThrow().
const_pointer Moses::MmapAllocator< T >::address | ( | const_reference | value | ) | const [inline] |
Definition at line 115 of file MmapAllocator.h.
pointer Moses::MmapAllocator< T >::address | ( | reference | value | ) | const [inline] |
Definition at line 111 of file MmapAllocator.h.
pointer Moses::MmapAllocator< T >::allocate | ( | size_type | num, | |
const void * | = 0 | |||
) | [inline] |
Definition at line 123 of file MmapAllocator.h.
References Moses::MmapAllocator< T >::m_data_offset, Moses::MmapAllocator< T >::m_data_ptr, Moses::MmapAllocator< T >::m_file_desc, Moses::MmapAllocator< T >::m_fixed, Moses::MmapAllocator< T >::m_map_size, Moses::MmapAllocator< T >::m_page_size, util::MapOrThrow(), read(), and T.
void Moses::MmapAllocator< T >::construct | ( | pointer | p, | |
const T & | value | |||
) | [inline] |
void Moses::MmapAllocator< T >::deallocate | ( | pointer | p, | |
size_type | num | |||
) | [inline] |
Definition at line 150 of file MmapAllocator.h.
References Moses::MmapAllocator< T >::m_data_offset, Moses::MmapAllocator< T >::m_fixed, Moses::MmapAllocator< T >::m_map_size, Moses::MmapAllocator< T >::m_page_size, T, and util::UnmapOrThrow().
void Moses::MmapAllocator< T >::destroy | ( | pointer | p | ) | [inline] |
size_type Moses::MmapAllocator< T >::max_size | ( | ) | const throw () [inline] |
Definition at line 119 of file MmapAllocator.h.
bool operator!= | ( | const MmapAllocator< T1 > & | a1, | |
const MmapAllocator< T2 > & | a2 | |||
) | throw () [friend] |
Definition at line 194 of file MmapAllocator.h.
bool operator== | ( | const MmapAllocator< T1 > & | a1, | |
const MmapAllocator< T2 > & | a2 | |||
) | throw () [friend] |
Definition at line 179 of file MmapAllocator.h.
size_t* Moses::MmapAllocator< T >::m_count [protected] |
Definition at line 54 of file MmapAllocator.h.
Referenced by Moses::MmapAllocator< T >::~MmapAllocator().
size_t Moses::MmapAllocator< T >::m_data_offset [protected] |
Definition at line 52 of file MmapAllocator.h.
Referenced by Moses::MmapAllocator< T >::allocate(), and Moses::MmapAllocator< T >::deallocate().
char* Moses::MmapAllocator< T >::m_data_ptr [protected] |
Definition at line 51 of file MmapAllocator.h.
Referenced by Moses::MmapAllocator< T >::allocate(), and Moses::MmapAllocator< T >::~MmapAllocator().
size_t Moses::MmapAllocator< T >::m_file_desc [protected] |
std::FILE* Moses::MmapAllocator< T >::m_file_ptr [protected] |
Definition at line 45 of file MmapAllocator.h.
Referenced by Moses::MmapAllocator< T >::~MmapAllocator().
bool Moses::MmapAllocator< T >::m_fixed [protected] |
Definition at line 53 of file MmapAllocator.h.
Referenced by Moses::MmapAllocator< T >::allocate(), Moses::MmapAllocator< T >::construct(), Moses::MmapAllocator< T >::deallocate(), Moses::MmapAllocator< T >::destroy(), and Moses::MmapAllocator< T >::~MmapAllocator().
size_t Moses::MmapAllocator< T >::m_map_size [protected] |
Definition at line 49 of file MmapAllocator.h.
Referenced by Moses::MmapAllocator< T >::allocate(), Moses::MmapAllocator< T >::deallocate(), and Moses::MmapAllocator< T >::~MmapAllocator().
size_t Moses::MmapAllocator< T >::m_page_size [protected] |
Definition at line 48 of file MmapAllocator.h.
Referenced by Moses::MmapAllocator< T >::allocate(), and Moses::MmapAllocator< T >::deallocate().