firebase::firestore::GeoPoint

#include <geo_point.h>

An immutable object representing a geographical point in Firestore.

Summary

The point is represented as a latitude/longitude pair.

Latitude values are in the range of [-90, 90]. Longitude values are in the range of [-180, 180].

Constructors and Destructors

GeoPoint()
Creates a GeoPoint with both latitude and longitude set to 0.
GeoPoint(double latitude, double longitude)
Creates a GeoPoint from the provided latitude and longitude values.
GeoPoint(const GeoPoint & other)
Copy constructor, GeoPoint is trivially copyable.
GeoPoint(GeoPoint && other)
Move constructor, equivalent to copying.

Public functions

ToString() const
std::string
Returns a string representation of this GeoPoint for logging/debugging purposes.
latitude() const
double
Returns the latitude value of this GeoPoint.
longitude() const
double
Returns the latitude value of this GeoPoint.
operator=(const GeoPoint & other)=default
Copy assignment operator, GeoPoint is trivially copyable.
operator=(GeoPoint && other)=default
Move assignment operator, equivalent to copying.

Friend classes

operator<<
friend std::ostream &
Outputs the string representation of this GeoPoint to the given stream.

Public functions

GeoPoint

 GeoPoint()=default

Creates a GeoPoint with both latitude and longitude set to 0.

GeoPoint

 GeoPoint(
  double latitude,
  double longitude
)

Creates a GeoPoint from the provided latitude and longitude values.

Details
Parameters
latitude
The latitude as number of degrees between -90 and 90.
longitude
The longitude as number of degrees between -180 and 180.

GeoPoint

 GeoPoint(
  const GeoPoint & other
)=default

Copy constructor, GeoPoint is trivially copyable.

GeoPoint

 GeoPoint(
  GeoPoint && other
)=default

Move constructor, equivalent to copying.

ToString

std::string ToString() const 

Returns a string representation of this GeoPoint for logging/debugging purposes.

latitude

double latitude() const 

Returns the latitude value of this GeoPoint.

longitude

double longitude() const 

Returns the latitude value of this GeoPoint.

operator=

GeoPoint & operator=(
  const GeoPoint & other
)=default

Copy assignment operator, GeoPoint is trivially copyable.

operator=

GeoPoint & operator=(
  GeoPoint && other
)=default

Move assignment operator, equivalent to copying.

Friend classes

operator<<

friend std::ostream & operator<<(std::ostream &out, const GeoPoint &geo_point)

Outputs the string representation of this GeoPoint to the given stream.

See also:ToString() for comments on the representation format.