From 6a9240f3d4beb72f1500289a19e507ede83f901f Mon Sep 17 00:00:00 2001 From: artemp Date: Thu, 18 Feb 2016 17:37:46 +0100 Subject: [PATCH] Revert "shape.input - add 'update-cache' optional parameter (default:true)" -- no much use as OS seems to apply it's own caching, doh .. This reverts commit f65c799475dd88c518f6af3b3052701526713475. --- plugins/input/shape/dbfile.cpp | 4 ++-- plugins/input/shape/dbfile.hpp | 2 +- plugins/input/shape/shape_datasource.cpp | 1 - plugins/input/shape/shape_datasource.hpp | 1 - plugins/input/shape/shape_io.cpp | 8 ++++---- plugins/input/shape/shape_io.hpp | 2 +- plugins/input/shape/shapefile.hpp | 4 ++-- 7 files changed, 10 insertions(+), 12 deletions(-) diff --git a/plugins/input/shape/dbfile.cpp b/plugins/input/shape/dbfile.cpp index c73406468..d64d37384 100644 --- a/plugins/input/shape/dbfile.cpp +++ b/plugins/input/shape/dbfile.cpp @@ -49,7 +49,7 @@ dbf_file::dbf_file() record_length_(0), record_(0) {} -dbf_file::dbf_file(std::string const& file_name, bool update_cache) +dbf_file::dbf_file(std::string const& file_name) :num_records_(0), num_fields_(0), record_length_(0), @@ -64,7 +64,7 @@ dbf_file::dbf_file(std::string const& file_name, bool update_cache) { #if defined(MAPNIK_MEMORY_MAPPED_FILE) - boost::optional memory = mapnik::mapped_memory_cache::instance().find(file_name, update_cache); + boost::optional memory = mapnik::mapped_memory_cache::instance().find(file_name,true); if (memory) { mapped_region_ = *memory; diff --git a/plugins/input/shape/dbfile.hpp b/plugins/input/shape/dbfile.hpp index 0f6f37db1..9ff022400 100644 --- a/plugins/input/shape/dbfile.hpp +++ b/plugins/input/shape/dbfile.hpp @@ -69,7 +69,7 @@ private: char* record_; public: dbf_file(); - dbf_file(std::string const& file_name, bool update_cache = true); + dbf_file(std::string const& file_name); ~dbf_file(); bool is_open(); int num_records() const; diff --git a/plugins/input/shape/shape_datasource.cpp b/plugins/input/shape/shape_datasource.cpp index d101ba8c4..56d7a6aae 100644 --- a/plugins/input/shape/shape_datasource.cpp +++ b/plugins/input/shape/shape_datasource.cpp @@ -64,7 +64,6 @@ shape_datasource::shape_datasource(parameters const& params) file_length_(0), indexed_(false), row_limit_(*params.get("row_limit",0)), - update_cache_(*params.get("update-cache", true)), desc_(shape_datasource::name(), *params.get("encoding","utf-8")) { #ifdef MAPNIK_STATS diff --git a/plugins/input/shape/shape_datasource.hpp b/plugins/input/shape/shape_datasource.hpp index ee1647512..f702036eb 100644 --- a/plugins/input/shape/shape_datasource.hpp +++ b/plugins/input/shape/shape_datasource.hpp @@ -72,7 +72,6 @@ private: box2d extent_; bool indexed_; const int row_limit_; - const bool update_cache_; layer_descriptor desc_; }; diff --git a/plugins/input/shape/shape_io.cpp b/plugins/input/shape/shape_io.cpp index b3423e62a..5dd591996 100644 --- a/plugins/input/shape/shape_io.cpp +++ b/plugins/input/shape/shape_io.cpp @@ -35,11 +35,11 @@ const std::string shape_io::SHX = ".shx"; const std::string shape_io::DBF = ".dbf"; const std::string shape_io::INDEX = ".index"; -shape_io::shape_io(std::string const& shape_name, bool open_index, bool update_cache) +shape_io::shape_io(std::string const& shape_name, bool open_index) : type_(shape_null), - shp_(shape_name + SHP, update_cache), - shx_(shape_name + SHX, update_cache), - dbf_(shape_name + DBF, update_cache), + shp_(shape_name + SHP), + shx_(shape_name + SHX), + dbf_(shape_name + DBF), reclength_(0), id_(0) { diff --git a/plugins/input/shape/shape_io.hpp b/plugins/input/shape/shape_io.hpp index 6ff634413..1828ebd54 100644 --- a/plugins/input/shape/shape_io.hpp +++ b/plugins/input/shape/shape_io.hpp @@ -57,7 +57,7 @@ public: shape_multipatch = 31 }; - shape_io(std::string const& shape_name, bool open_index = true, bool update_cache = true); + shape_io(std::string const& shape_name, bool open_index=true); ~shape_io(); shape_file& shp(); diff --git a/plugins/input/shape/shapefile.hpp b/plugins/input/shape/shapefile.hpp index c175ba6d5..15e5c7757 100644 --- a/plugins/input/shape/shapefile.hpp +++ b/plugins/input/shape/shapefile.hpp @@ -159,7 +159,7 @@ public: shape_file() {} - shape_file(std::string const& file_name, bool update_cache = true) : + shape_file(std::string const& file_name) : #if defined(MAPNIK_MEMORY_MAPPED_FILE) file_() #elif defined (_WINDOWS) @@ -170,7 +170,7 @@ public: { #if defined(MAPNIK_MEMORY_MAPPED_FILE) boost::optional memory = - mapnik::mapped_memory_cache::instance().find(file_name, update_cache); + mapnik::mapped_memory_cache::instance().find(file_name,true); if (memory) {