BitShares-Core  4.0.0
BitShares blockchain implementation and command-line interface software
file_mapping.cpp
Go to the documentation of this file.
2 #include <boost/interprocess/file_mapping.hpp>
3 #include <boost/interprocess/mapped_region.hpp>
4 #include <fc/fwd_impl.hpp>
5 
6 namespace fc {
7 
8 
9  file_mapping::file_mapping( const char* file, mode_t m ) :
10  my(file, m == read_only ? boost::interprocess::read_only : boost::interprocess::read_write )
11  {}
12 
14 
15 
16 
17  mapped_region::mapped_region( const file_mapping& fm, mode_t m, uint64_t start, size_t size ) :
18  my( *fm.my, m == read_only ? boost::interprocess::read_only : boost::interprocess::read_write ,start, size)
19  {}
20 
22  my( *fm.my, m == read_only ? boost::interprocess::read_only : boost::interprocess::read_write)
23  {}
24 
26 
28  {
29  return my->get_address();
30  }
31 
33  {
34  my->flush();
35  }
36 
37  size_t mapped_region::get_size() const
38  {
39  return my->get_size();
40  }
41 }
size_t get_size() const
file_mapping(const char *file, mode_t)
Definition: file_mapping.cpp:9
void * get_address() const
Definition: api.hpp:15
mapped_region(const file_mapping &fm, mode_t m, uint64_t start, size_t size)