This source file includes following definitions.
- error_code
- Validate
#include "content/public/common/geoposition.h"
namespace {
const double kBadLatitudeLongitude = 200;
const int kBadAltitude = -10000;
const int kBadAccuracy = -1;
const int kBadHeading = -1;
const int kBadSpeed = -1;
}
namespace content {
Geoposition::Geoposition()
: latitude(kBadLatitudeLongitude),
longitude(kBadLatitudeLongitude),
altitude(kBadAltitude),
accuracy(kBadAccuracy),
altitude_accuracy(kBadAccuracy),
heading(kBadHeading),
speed(kBadSpeed),
error_code(ERROR_CODE_NONE) {
}
bool Geoposition::Validate() const {
return latitude >= -90. && latitude <= 90. &&
longitude >= -180. && longitude <= 180. &&
accuracy >= 0. &&
!timestamp.is_null();
}
}