Joshua
open source statistical hierarchical phrase-based machine translation system
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
util::scoped_memory Class Reference

#include <mmap.hh>

List of all members.

Public Types

enum  Alloc { MMAP_ALLOCATED, ARRAY_ALLOCATED, MALLOC_ALLOCATED, NONE_ALLOCATED }

Public Member Functions

 scoped_memory ()
 ~scoped_memory ()
void * get () const
const char * begin () const
const char * end () const
std::size_t size () const
Alloc source () const
void reset ()
void reset (void *data, std::size_t size, Alloc from)
void call_realloc (std::size_t to)

Private Member Functions

 scoped_memory (const scoped_memory &)
scoped_memoryoperator= (const scoped_memory &)

Private Attributes

void * data_
std::size_t size_
Alloc source_

Member Enumeration Documentation

Enumerator:
MMAP_ALLOCATED 
ARRAY_ALLOCATED 
MALLOC_ALLOCATED 
NONE_ALLOCATED 

Constructor & Destructor Documentation

Here is the call graph for this function:


Member Function Documentation

const char* util::scoped_memory::begin ( ) const

Here is the caller graph for this function:

void util::scoped_memory::call_realloc ( std::size_t  to)

Here is the call graph for this function:

Here is the caller graph for this function:

const char* util::scoped_memory::end ( ) const
void* util::scoped_memory::get ( ) const

Here is the caller graph for this function:

scoped_memory& util::scoped_memory::operator= ( const scoped_memory ) [private]

Here is the call graph for this function:

Here is the caller graph for this function:

void util::scoped_memory::reset ( void *  data,
std::size_t  size,
Alloc  from 
)

Here is the call graph for this function:

std::size_t util::scoped_memory::size ( ) const

Here is the caller graph for this function:

Here is the caller graph for this function:


Member Data Documentation

void* util::scoped_memory::data_ [private]
std::size_t util::scoped_memory::size_ [private]