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

ExternalAllocatorUnique Class Reference
[System]

#include <OpenMS/SYSTEM/ExternalAllocatorUnique.h>

List of all members.


Detailed Description

Unique settings for an ExternalAllocator.

When an ExternalAllocator is copied it is necessary to ensure data consistency between the copied instances. This class is held by a boost sharedPtr within the ExternalAllocator.

It contains the size, name and handle of the swap file.

Public Member Functions

 ExternalAllocatorUnique (const String &filename, const Offset64Int &filesize)
 C'tor.
 ExternalAllocatorUnique (const ExternalAllocatorUnique &rhs) throw ()
 copy C'tor
 ~ExternalAllocatorUnique () throw ()
 D'tor.
bool hasFreeSwap (const Offset64Int &bytes_needed)
 determine if a new mapping at the current file position would go beyond EOF
read-only accessors


const StringgetFilename () const
 get the name of the swap file
const int & getMmapHandle () const
 get handle to the swap file
read & write accessors


void advanceFilesize (const Offset64Int &x)
 increase the filesize by x bytes
const Offset64IntgetFilesize () const
 get the size of the swap file
const Offset64IntgetNextfree () const
 get next free byte position of swap file
void advanceNextfree (const Offset64Int &x)
 advance the next free byte position by x bytes
const Offset64IntgetTotalmappingsize () const
 get current number of bytes mapped from swap file into virtual memory
void setTotalmappingsize (const Offset64Int &x)
 set new mapping size x

Protected Attributes

String filename_
 name of temporary file
Offset64Int filesize_
 size of temporary file
Offset64Int nextfree_
 next byte position in file where the next mapping is scheduled
int mmap_handle_
 filehandle to swap file
Offset64Int totalmappingsize_
 just for informational purposes: how many bytes are mapped

Private Member Functions

 ExternalAllocatorUnique ()
 do not allow default C'tor


Constructor & Destructor Documentation

ExternalAllocatorUnique (  )  [inline, private]

do not allow default C'tor

ExternalAllocatorUnique ( const String filename,
const Offset64Int filesize 
) [inline]

C'tor.

ExternalAllocatorUnique ( const ExternalAllocatorUnique rhs  )  throw () [inline]

copy C'tor

~ExternalAllocatorUnique (  )  throw () [inline]

D'tor.


Member Function Documentation

const String& getFilename (  )  const [inline]

get the name of the swap file

const int& getMmapHandle (  )  const [inline]

get handle to the swap file

void advanceFilesize ( const Offset64Int x  )  [inline]

increase the filesize by x bytes

const Offset64Int& getFilesize (  )  const [inline]

get the size of the swap file

const Offset64Int& getNextfree (  )  const [inline]

get next free byte position of swap file

void advanceNextfree ( const Offset64Int x  )  [inline]

advance the next free byte position by x bytes

const Offset64Int& getTotalmappingsize (  )  const [inline]

get current number of bytes mapped from swap file into virtual memory

void setTotalmappingsize ( const Offset64Int x  )  [inline]

set new mapping size x

bool hasFreeSwap ( const Offset64Int bytes_needed  )  [inline]

determine if a new mapping at the current file position would go beyond EOF


Member Data Documentation

String filename_ [protected]

name of temporary file

Offset64Int filesize_ [protected]

size of temporary file

Offset64Int nextfree_ [protected]

next byte position in file where the next mapping is scheduled

int mmap_handle_ [protected]

filehandle to swap file

Offset64Int totalmappingsize_ [protected]

just for informational purposes: how many bytes are mapped


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