18 #ifndef LUNCHBOX_MEMORYMAP_H 19 #define LUNCHBOX_MEMORYMAP_H 21 #include <boost/noncopyable.hpp> 50 LUNCHBOX_API
explicit MemoryMap(
const std::string& filename);
58 LUNCHBOX_API MemoryMap(
const std::string& filename,
const size_t size);
67 LUNCHBOX_API ~MemoryMap();
79 LUNCHBOX_API
const void* map(
const std::string& filename);
90 LUNCHBOX_API
const void* remap(
const std::string& filename);
103 LUNCHBOX_API
void* create(
const std::string& filename,
const size_t size);
115 LUNCHBOX_API
void* recreate(
const std::string& filename,
size_t size);
127 LUNCHBOX_API
void* resize(
size_t size);
130 LUNCHBOX_API
void unmap();
133 LUNCHBOX_API
const void* getAddress()
const;
136 LUNCHBOX_API
void* getAddress();
142 return static_cast<const T*
>(getAddress());
149 return static_cast<T*
>(getAddress());
154 T&
get(
const size_t i)
156 return getAddress<T>()[i];
161 const T&
get(
const size_t i)
const 163 return getAddress<T>()[i];
167 LUNCHBOX_API
size_t getSize()
const;
170 detail::MemoryMap*
const impl_;
179 #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