forward declare mapped_region in mapped_memory_cache.hpp and other shared memory fixups

This commit is contained in:
Dane Springmeyer 2013-08-13 14:13:56 -04:00
parent d2000b465b
commit 134cbc3eec
6 changed files with 10 additions and 6 deletions

View file

@ -30,16 +30,14 @@
// boost
#include <boost/unordered_map.hpp>
#include <boost/interprocess/mapped_region.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/optional.hpp>
#include <boost/interprocess/interprocess_fwd.hpp>
namespace mapnik
{
using namespace boost::interprocess;
typedef boost::shared_ptr<mapped_region> mapped_region_ptr;
typedef boost::shared_ptr<boost::interprocess::mapped_region> mapped_region_ptr;
class MAPNIK_DECL mapped_memory_cache :
public singleton<mapped_memory_cache, CreateStatic>,

View file

@ -34,6 +34,7 @@
#include <mapnik/feature_factory.hpp>
// boost
#include <boost/interprocess/mapped_region.hpp>
#include <boost/interprocess/streams/bufferstream.hpp>
// ogr

View file

@ -32,6 +32,7 @@
#include <boost/spirit/include/qi.hpp>
#include <boost/cstdint.hpp> // for int16_t and int32_t
#ifdef SHAPE_MEMORY_MAPPED_FILE
#include <boost/interprocess/mapped_region.hpp>
#include <mapnik/mapped_memory_cache.hpp>
#endif

View file

@ -29,7 +29,9 @@
// boost
#include <boost/algorithm/string.hpp>
#ifdef SHAPE_MEMORY_MAPPED_FILE
#include <boost/interprocess/streams/bufferstream.hpp>
#endif
#include <boost/make_shared.hpp>
#include "shape_index_featureset.hpp"

View file

@ -34,6 +34,7 @@
#include <mapnik/utils.hpp>
#include <mapnik/box2d.hpp>
#ifdef SHAPE_MEMORY_MAPPED_FILE
#include <boost/interprocess/mapped_region.hpp>
#include <mapnik/mapped_memory_cache.hpp>
#endif
#include <mapnik/noncopyable.hpp>

View file

@ -27,6 +27,7 @@
// boost
#include <boost/assert.hpp>
#include <boost/interprocess/mapped_region.hpp>
#include <boost/interprocess/file_mapping.hpp>
#include <boost/make_shared.hpp>
@ -67,8 +68,8 @@ boost::optional<mapped_region_ptr> mapped_memory_cache::find(std::string const&
{
try
{
file_mapping mapping(uri.c_str(),read_only);
mapped_region_ptr region(boost::make_shared<mapped_region>(mapping,read_only));
boost::interprocess::file_mapping mapping(uri.c_str(),boost::interprocess::read_only);
mapped_region_ptr region(boost::make_shared<boost::interprocess::mapped_region>(mapping,boost::interprocess::read_only));
result.reset(region);