MongoDB C++ Driver legacy-1.1.2
Loading...
Searching...
No Matches
coordinates.h
Go to the documentation of this file.
1/* Copyright 2014 MongoDB Inc.
2 *
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
18#pragma once
19
20#include <vector>
21
22#include "mongo/client/export_macros.h"
23#include "mongo/db/jsobj.h"
24
25namespace mongo {
26namespace geo {
27
28class MONGO_CLIENT_API Coordinates {
29public:
30 virtual ~Coordinates() {}
31
37 virtual std::vector<double> getValues() const = 0;
38
47 virtual BSONObj toBSON() const = 0;
48
57 virtual double operator[](size_t dimension) const = 0;
58};
59
60} // namespace geo
61} // namespace mongo
C++ representation of a "BSON" object – that is, an extended JSON-style object in a binary representa...
Definition bsonobj.h:78
Definition coordinates.h:28
virtual double operator[](size_t dimension) const =0
Obtain the value of these coordinates in a particular dimension.
virtual std::vector< double > getValues() const =0
Get the values of these coordinates as a vector of doubles.
virtual BSONObj toBSON() const =0
Obtain a BSON representation of these coordinates.
BSON classes.
Utility functions for parsing numbers from strings.
Definition compare_numbers.h:20