Libosmium  2.6.1
Fast and flexible C++ library for working with OpenStreetMap data
Public Member Functions | List of all members
osmium::util::AnonymousMemoryMapping Class Reference

#include <memory_mapping.hpp>

Inheritance diagram for osmium::util::AnonymousMemoryMapping:
Inheritance graph
[legend]
Collaboration diagram for osmium::util::AnonymousMemoryMapping:
Collaboration graph
[legend]

Public Member Functions

 AnonymousMemoryMapping (size_t size)
 
- Public Member Functions inherited from osmium::util::MemoryMapping
 MemoryMapping (size_t size, mapping_mode mode, int fd=-1, off_t offset=0)
 
OSMIUM_DEPRECATED MemoryMapping (size_t size, bool writable=true, int fd=-1, off_t offset=0)
 
 MemoryMapping (const MemoryMapping &)=delete
 You can not copy construct a MemoryMapping. More...
 
MemoryMappingoperator= (const MemoryMapping &)=delete
 You can not copy a MemoryMapping. More...
 
 MemoryMapping (MemoryMapping &&other)
 
MemoryMappingoperator= (MemoryMapping &&other)
 
 ~MemoryMapping () noexcept
 
void unmap ()
 
void resize (size_t new_size)
 
 operator bool () const noexcept
 
size_t size () const noexcept
 
int fd () const noexcept
 
bool writable () const noexcept
 
template<typename T = void>
T * get_addr () const
 

Additional Inherited Members

- Public Types inherited from osmium::util::MemoryMapping
enum  mapping_mode { mapping_mode::readonly = 0, mapping_mode::write_private = 1, mapping_mode::write_shared = 2 }
 

Detailed Description

Anonymous memory mapping.

Usage for anonymous mapping:

AnonymousMemoryMapping mapping(1024); // create anonymous mapping with size
auto ptr = mapping.get_addr<char*>(); // get pointer to memory
mapping.unmap(); // release mapping by calling unmap() (or at end of scope)

Constructor & Destructor Documentation

osmium::util::AnonymousMemoryMapping::AnonymousMemoryMapping ( size_t  size)
inline

The documentation for this class was generated from the following file: