diff options
Diffstat (limited to 'src/mongo/db/geo/hash.h')
-rw-r--r-- | src/mongo/db/geo/hash.h | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/mongo/db/geo/hash.h b/src/mongo/db/geo/hash.h index bfdca2cdffd..6b59034accc 100644 --- a/src/mongo/db/geo/hash.h +++ b/src/mongo/db/geo/hash.h @@ -179,14 +179,18 @@ public: double scaling; }; - GeoHashConverter(const Parameters& params); + /** + * Factory method to return a new instance with status. Uses hashing parameters parsed from a + * BSONObj. + */ + static StatusWith<std::unique_ptr<GeoHashConverter>> createFromDoc(const BSONObj& paramDoc); /** - * Returns hashing parameters parsed from a BSONObj + * Factory method to return a new instance with status. */ - static Status parseParameters(const BSONObj& paramDoc, Parameters* params); + static StatusWith<std::unique_ptr<GeoHashConverter>> createFromParams(const Parameters& params); - static double calcUnhashToBoxError(const GeoHashConverter::Parameters& params); + static double calcUnhashToBoxError(const Parameters& params); /** * Return converter parameterss which can be used to @@ -257,6 +261,8 @@ public: double convertToDoubleHashScale(double in) const; private: + GeoHashConverter(const Parameters& params); + void init(); // Convert from an unsigned in [0, (max-min)*scaling] to [min, max] |