summaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/util')
-rw-r--r--src/util/areastore.cpp10
-rw-r--r--src/util/areastore.h3
2 files changed, 12 insertions, 1 deletions
diff --git a/src/util/areastore.cpp b/src/util/areastore.cpp
index b0076faa3..cf972586c 100644
--- a/src/util/areastore.cpp
+++ b/src/util/areastore.cpp
@@ -44,6 +44,16 @@ with this program; if not, write to the Free Software Foundation, Inc.,
AST_OVERLAPS_IN_DIMENSION((amine), (amaxe), (b), Y) && \
AST_OVERLAPS_IN_DIMENSION((amine), (amaxe), (b), Z))
+
+AreaStore *AreaStore::getOptimalImplementation()
+{
+#if USE_SPATIAL
+ return new SpatialAreaStore();
+#else
+ return new VectorAreaStore();
+#endif
+}
+
u16 AreaStore::size() const
{
return areas_map.size();
diff --git a/src/util/areastore.h b/src/util/areastore.h
index c36cbc389..dee1f8bab 100644
--- a/src/util/areastore.h
+++ b/src/util/areastore.h
@@ -52,7 +52,6 @@ struct Area {
std::string data;
};
-std::vector<std::string> get_areastore_typenames();
class AreaStore {
protected:
@@ -93,6 +92,8 @@ public:
const Area *getArea(u32 id) const;
u16 size() const;
+
+ static AreaStore *getOptimalImplementation();
#if 0
bool deserialize(std::istream &is);
void serialize(std::ostream &is) const;