18 #ifndef LUNCHBOX_MEMORYMAP_H 19 #define LUNCHBOX_MEMORYMAP_H 22 #include <boost/noncopyable.hpp> 28 namespace detail {
class MemoryMap; }
47 LUNCHBOX_API
explicit MemoryMap(
const std::string& filename );
55 LUNCHBOX_API MemoryMap(
const std::string& filename,
const size_t size );
64 LUNCHBOX_API ~MemoryMap();
76 LUNCHBOX_API
const void* map(
const std::string& filename );
87 LUNCHBOX_API
const void* remap(
const std::string& filename );
100 LUNCHBOX_API
void* create(
const std::string& filename,
const size_t size );
112 LUNCHBOX_API
void* recreate(
const std::string& filename,
116 LUNCHBOX_API
void unmap();
119 LUNCHBOX_API
const void* getAddress()
const;
122 LUNCHBOX_API
void* getAddress();
126 {
return static_cast< const T*
>( getAddress( )); }
130 {
return static_cast< T*
>( getAddress( )); }
133 LUNCHBOX_API
size_t getSize()
const;
136 detail::MemoryMap*
const impl_;
146 #endif //LUNCHBOX_MEMORYMAP_H Defines export visibility macros for library Lunchbox.
const void * getAddress() const
Helper to map a file to a memory address (mmap).
Abstraction layer and common utilities for multi-threaded programming.
std::ostream & operator<<(std::ostream &os, const Array< T > &array)
Pretty-print all members of the array.
const T * getAddress() const