use unordered_map for proj_transform caching
This commit is contained in:
parent
5c086b0cd5
commit
e5c182591a
1 changed files with 4 additions and 3 deletions
|
@ -41,7 +41,7 @@ MAPNIK_DISABLE_WARNING_PUSH
|
||||||
MAPNIK_DISABLE_WARNING_POP
|
MAPNIK_DISABLE_WARNING_POP
|
||||||
|
|
||||||
// stl
|
// stl
|
||||||
#include <map>
|
#include <unordered_map>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
@ -57,6 +57,7 @@ class layer;
|
||||||
|
|
||||||
class MAPNIK_DECL Map : boost::equality_comparable<Map>
|
class MAPNIK_DECL Map : boost::equality_comparable<Map>
|
||||||
{
|
{
|
||||||
|
using proj_cache_type = std::unordered_map<std::string, std::unique_ptr<proj_transform>>;
|
||||||
public:
|
public:
|
||||||
|
|
||||||
enum aspect_fix_mode
|
enum aspect_fix_mode
|
||||||
|
@ -104,7 +105,7 @@ private:
|
||||||
boost::optional<std::string> font_directory_;
|
boost::optional<std::string> font_directory_;
|
||||||
freetype_engine::font_file_mapping_type font_file_mapping_;
|
freetype_engine::font_file_mapping_type font_file_mapping_;
|
||||||
freetype_engine::font_memory_cache_type font_memory_cache_;
|
freetype_engine::font_memory_cache_type font_memory_cache_;
|
||||||
mutable std::map<std::string, std::unique_ptr<proj_transform>> proj_cache_;
|
mutable proj_cache_type proj_cache_;
|
||||||
public:
|
public:
|
||||||
|
|
||||||
using const_style_iterator = std::map<std::string,feature_type_style>::const_iterator;
|
using const_style_iterator = std::map<std::string,feature_type_style>::const_iterator;
|
||||||
|
@ -502,7 +503,7 @@ public:
|
||||||
{
|
{
|
||||||
return font_memory_cache_;
|
return font_memory_cache_;
|
||||||
}
|
}
|
||||||
std::map<std::string, std::unique_ptr<proj_transform>> & proj_cache() const
|
proj_cache_type& proj_cache() const
|
||||||
{
|
{
|
||||||
return proj_cache_;
|
return proj_cache_;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue