Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages

ExternalAllocator Class Template Reference
[System]

#include <OpenMS/SYSTEM/ExternalAllocator.h>

List of all members.


Detailed Description

template<class T>
class OpenMS::ExternalAllocator< T >

External allocator used in MSExperiment's std::vector to handle virtual memory, mapped to a swap file.

Note:
(Linux) Very slow performance has been observed on Reiser filesystems, when dealing with sparse files.

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

pointer address (reference value) const
 return address of value
const_pointer address (const_reference value) const
 return address of value as const pointer
 ExternalAllocator (const String &filename=File::getUniqueName(), const Offset64Int &filesize=1)
 C'tor where filename specifies the swap file of size filesize bytes.
 ExternalAllocator (const ExternalAllocator &rhs) throw ()
 copy C'tor
template<class U>
 ExternalAllocator (const ExternalAllocator< U > &rhs) throw ()
 copy C'tor with other template parameter
 ~ExternalAllocator () throw ()
 D'tor.
size_type max_size () const throw ()
 return maximum number of elements that can be allocated
pointer allocate (size_type num, const void *=0)
 allocate but don't initialize num elements of type T
void construct (pointer p, const T &value)
 initialize elements of allocated storage p with value value
void destroy (pointer)
 destroy elements of initialized storage p
void deallocate (pointer p, size_type num)
 deallocate storage p of deleted elements
Offset64Int getMappingSize ()
 number of bytes currently mapped from file into virtual memory

Protected Attributes

boost::shared_ptr
< ExternalAllocatorUnique
shared_extalloc_
 stores the allocator's data and prevent data corruption when copying this allocator

Friends

class ExternalAllocator
 allow other template instances to access private members

Classes

struct  rebind
 rebind allocator to type U More...

Member Typedef Documentation

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


Constructor & Destructor Documentation

ExternalAllocator ( const String filename = File::getUniqueName(),
const Offset64Int filesize = 1 
) [inline]

C'tor where filename specifies the swap file of size filesize bytes.

ExternalAllocator ( const ExternalAllocator< T > &  rhs  )  throw () [inline]

copy C'tor

ExternalAllocator ( const ExternalAllocator< U > &  rhs  )  throw () [inline]

copy C'tor with other template parameter

~ExternalAllocator (  )  throw () [inline]

D'tor.


Member Function Documentation

pointer address ( reference  value  )  const [inline]

return address of value

const_pointer address ( const_reference  value  )  const [inline]

return address of value as const pointer

size_type max_size (  )  const throw () [inline]

return maximum number of elements that can be allocated

pointer allocate ( size_type  num,
const void *  = 0 
) [inline]

allocate but don't initialize num elements of type T

void construct ( pointer  p,
const T &  value 
) [inline]

initialize elements of allocated storage p with value value

void destroy ( pointer   )  [inline]

destroy elements of initialized storage p

void deallocate ( pointer  p,
size_type  num 
) [inline]

deallocate storage p of deleted elements

Offset64Int getMappingSize (  )  [inline]

number of bytes currently mapped from file into virtual memory


Friends And Related Function Documentation

friend class ExternalAllocator [friend]

allow other template instances to access private members


Member Data Documentation

boost::shared_ptr<ExternalAllocatorUnique> shared_extalloc_ [protected]

stores the allocator's data and prevent data corruption when copying this allocator


The documentation for this class was generated from the following file:
Generated Tue Apr 1 15:36:47 2008 -- using doxygen 1.5.4 OpenMS / TOPP 1.1