2012-09-18 03:04:42 +00:00
|
|
|
#include <fc/interprocess/file_mapping.hpp>
|
|
|
|
|
#include <boost/interprocess/file_mapping.hpp>
|
|
|
|
|
#include <boost/interprocess/mapped_region.hpp>
|
|
|
|
|
#include <fc/fwd_impl.hpp>
|
|
|
|
|
|
|
|
|
|
namespace fc {
|
2013-07-07 02:07:12 +00:00
|
|
|
|
|
|
|
|
|
2012-09-18 03:04:42 +00:00
|
|
|
file_mapping::file_mapping( const char* file, mode_t m )
|
|
|
|
|
:my(file, m == read_only ? boost::interprocess::read_only : boost::interprocess::read_write ){}
|
|
|
|
|
file_mapping::~file_mapping(){}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-06-05 19:19:00 +00:00
|
|
|
mapped_region::mapped_region( const file_mapping& fm, mode_t m, uint64_t start, size_t size )
|
2012-09-18 03:04:42 +00:00
|
|
|
:my( *fm.my, m == read_only ? boost::interprocess::read_only : boost::interprocess::read_write ,start, size) { }
|
|
|
|
|
mapped_region::mapped_region( const file_mapping& fm, mode_t m )
|
|
|
|
|
:my( *fm.my, m == read_only ? boost::interprocess::read_only : boost::interprocess::read_write) { }
|
|
|
|
|
mapped_region::~mapped_region(){}
|
|
|
|
|
void* mapped_region::get_address()const { return my->get_address(); }
|
2013-01-27 15:24:11 +00:00
|
|
|
void mapped_region::flush(){ my->flush(); }
|
2012-09-18 03:04:42 +00:00
|
|
|
size_t mapped_region::get_size()const { return my->get_size(); }
|
|
|
|
|
}
|