summaryrefslogtreecommitdiff
path: root/src/mongo/db/geo
diff options
context:
space:
mode:
authorAndrew Morrow <acm@mongodb.com>2015-06-10 18:08:48 -0400
committerAndrew Morrow <acm@mongodb.com>2015-06-10 22:37:49 -0400
commitd7d1fdb75966c684e9a42150e6e9b69c4a10ee08 (patch)
treed28b0767cbd8c1a09535f1676152e7ac57e829ce /src/mongo/db/geo
parenta9b6612f5322f916298c19a6728817a1034c6aab (diff)
downloadmongo-d7d1fdb75966c684e9a42150e6e9b69c4a10ee08.tar.gz
SERVER-17308 Replace boost::scoped_ptr<T> with std::unique_ptr<T>
Diffstat (limited to 'src/mongo/db/geo')
-rw-r--r--src/mongo/db/geo/big_polygon.cpp3
-rw-r--r--src/mongo/db/geo/big_polygon.h7
-rw-r--r--src/mongo/db/geo/geometry_container.h23
-rw-r--r--src/mongo/db/geo/r2_region_coverer.h5
-rw-r--r--src/mongo/db/geo/shapes.h11
5 files changed, 22 insertions, 27 deletions
diff --git a/src/mongo/db/geo/big_polygon.cpp b/src/mongo/db/geo/big_polygon.cpp
index 10241db45dc..94723eb4cae 100644
--- a/src/mongo/db/geo/big_polygon.cpp
+++ b/src/mongo/db/geo/big_polygon.cpp
@@ -28,7 +28,6 @@
#include "mongo/db/geo/big_polygon.h"
-#include <boost/scoped_ptr.hpp>
#include <map>
#include "mongo/base/owned_pointer_vector.h"
@@ -36,7 +35,7 @@
namespace mongo {
- using boost::scoped_ptr;
+ using std::unique_ptr;
using std::unique_ptr;
using std::vector;
diff --git a/src/mongo/db/geo/big_polygon.h b/src/mongo/db/geo/big_polygon.h
index 7125da35f35..c5a913ac05b 100644
--- a/src/mongo/db/geo/big_polygon.h
+++ b/src/mongo/db/geo/big_polygon.h
@@ -28,7 +28,6 @@
#pragma once
-#include <boost/scoped_ptr.hpp>
#include <vector>
#include "mongo/db/geo/s2.h"
@@ -104,7 +103,7 @@ namespace mongo {
private:
- boost::scoped_ptr<S2Loop> _loop;
+ std::unique_ptr<S2Loop> _loop;
// Cache whether the loop area is at most 2*Pi (the area of hemisphere).
//
@@ -114,8 +113,8 @@ namespace mongo {
bool _isNormalized;
// Cached to do Intersects() and Contains() with S2Polylines.
- mutable boost::scoped_ptr<S2Polyline> _borderLine;
- mutable boost::scoped_ptr<S2Polygon> _borderPoly;
+ mutable std::unique_ptr<S2Polyline> _borderLine;
+ mutable std::unique_ptr<S2Polygon> _borderPoly;
};
}
diff --git a/src/mongo/db/geo/geometry_container.h b/src/mongo/db/geo/geometry_container.h
index 415f603d178..05ca1ed2962 100644
--- a/src/mongo/db/geo/geometry_container.h
+++ b/src/mongo/db/geo/geometry_container.h
@@ -28,7 +28,6 @@
#pragma once
-#include <boost/scoped_ptr.hpp>
#include <string>
#include "mongo/base/disallow_copying.h"
@@ -143,20 +142,20 @@ namespace mongo {
// Only one of these shared_ptrs should be non-NULL. S2Region is a
// superclass but it only supports testing against S2Cells. We need
// the most specific class we can get.
- boost::scoped_ptr<PointWithCRS> _point;
- boost::scoped_ptr<LineWithCRS> _line;
- boost::scoped_ptr<BoxWithCRS> _box;
- boost::scoped_ptr<PolygonWithCRS> _polygon;
- boost::scoped_ptr<CapWithCRS> _cap;
- boost::scoped_ptr<MultiPointWithCRS> _multiPoint;
- boost::scoped_ptr<MultiLineWithCRS> _multiLine;
- boost::scoped_ptr<MultiPolygonWithCRS> _multiPolygon;
- boost::scoped_ptr<GeometryCollection> _geometryCollection;
+ std::unique_ptr<PointWithCRS> _point;
+ std::unique_ptr<LineWithCRS> _line;
+ std::unique_ptr<BoxWithCRS> _box;
+ std::unique_ptr<PolygonWithCRS> _polygon;
+ std::unique_ptr<CapWithCRS> _cap;
+ std::unique_ptr<MultiPointWithCRS> _multiPoint;
+ std::unique_ptr<MultiLineWithCRS> _multiLine;
+ std::unique_ptr<MultiPolygonWithCRS> _multiPolygon;
+ std::unique_ptr<GeometryCollection> _geometryCollection;
// Cached for use during covering calculations
// TODO: _s2Region is currently generated immediately - don't necessarily need to do this
- boost::scoped_ptr<S2RegionUnion> _s2Region;
- boost::scoped_ptr<R2Region> _r2Region;
+ std::unique_ptr<S2RegionUnion> _s2Region;
+ std::unique_ptr<R2Region> _r2Region;
};
} // namespace mongo
diff --git a/src/mongo/db/geo/r2_region_coverer.h b/src/mongo/db/geo/r2_region_coverer.h
index ff4f820d755..ddfda208094 100644
--- a/src/mongo/db/geo/r2_region_coverer.h
+++ b/src/mongo/db/geo/r2_region_coverer.h
@@ -29,7 +29,6 @@
#pragma once
#include <boost/noncopyable.hpp>
-#include <boost/scoped_ptr.hpp>
#include <queue>
#include "mongo/db/geo/hash.h"
@@ -109,8 +108,8 @@ namespace mongo {
typedef std::pair<int, Candidate*> QueueEntry;
typedef std::priority_queue<QueueEntry, std::vector<QueueEntry>,
CompareQueueEntries> CandidateQueue;
- boost::scoped_ptr<CandidateQueue> _candidateQueue; // Priority queue owns candidate pointers.
- boost::scoped_ptr<std::vector<GeoHash> > _results;
+ std::unique_ptr<CandidateQueue> _candidateQueue; // Priority queue owns candidate pointers.
+ std::unique_ptr<std::vector<GeoHash> > _results;
};
diff --git a/src/mongo/db/geo/shapes.h b/src/mongo/db/geo/shapes.h
index 297eb8135d3..5eb2f8bceaa 100644
--- a/src/mongo/db/geo/shapes.h
+++ b/src/mongo/db/geo/shapes.h
@@ -28,7 +28,6 @@
#pragma once
-#include <boost/scoped_ptr.hpp>
#include <cmath>
#include <string>
#include <vector>
@@ -191,8 +190,8 @@ namespace mongo {
std::vector<Point> _points;
// Cached attributes of the polygon
- mutable boost::scoped_ptr<Box> _bounds;
- mutable boost::scoped_ptr<Point> _centroid;
+ mutable std::unique_ptr<Box> _bounds;
+ mutable std::unique_ptr<Point> _centroid;
};
class R2Region {
@@ -301,10 +300,10 @@ namespace mongo {
PolygonWithCRS() : crs(UNSET) {}
- boost::scoped_ptr<S2Polygon> s2Polygon;
+ std::unique_ptr<S2Polygon> s2Polygon;
// Simple polygons with strict winding order may be bigger or smaller than a hemisphere.
// Only used for query. We don't support storing/indexing big polygons.
- boost::scoped_ptr<BigSimplePolygon> bigPolygon;
+ std::unique_ptr<BigSimplePolygon> bigPolygon;
Polygon oldPolygon;
CRS crs;
@@ -339,7 +338,7 @@ namespace mongo {
std::vector<PointWithCRS> points;
- // The amount of indirection here is painful but we can't operator= scoped_ptr or
+ // The amount of indirection here is painful but we can't operator= unique_ptr or
// OwnedPointerVector.
OwnedPointerVector<LineWithCRS> lines;
OwnedPointerVector<PolygonWithCRS> polygons;