latitude.h
Go to the documentation of this file.
/*
* Copyright © 2012-2013 Canonical Ltd.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License version 3,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Authored by: Thomas Voß <thomas.voss@canonical.com>
*/
#ifndef LOCATION_SERVICE_COM_LOMIRI_LOCATION_WGS84_LATITUDE_H_
#define LOCATION_SERVICE_COM_LOMIRI_LOCATION_WGS84_LATITUDE_H_
#include <com/lomiri/location/units/units.h>
#include <com/lomiri/location/wgs84/coordinate.h>
#include <stdexcept>
namespace com
{
namespace lomiri
{
namespace location
{
namespace wgs84
{
namespace tag
{
struct Latitude;
}
typedef Coordinate<tag::Latitude, units::PlaneAngle> Latitude;
template<>
struct CoordinateTraits<Latitude>
{
static double min()
{
return -90;
};
static double max()
{
return 90;
};
static void check_and_throw_if_invalid(const typename Latitude::Quantity& coordinate)
{
if (coordinate.value() < min())
throw std::out_of_range(u8"Latitude(coordinate.value() < min())");
if (coordinate.value() > max())
throw std::out_of_range(u8"Latitude(coordinate.value() > max())");
}
};
}
}
}
}
#endif // LOCATION_SERVICE_COM_LOMIRI_LOCATION_WGS84_LATITUDE_H_
com::lomiri::location::wgs84::Coordinate
Definition coordinate.h:43
com::lomiri::location::wgs84::Coordinate< tag::Latitude, units::PlaneAngle >::Quantity
units::Quantity< Unit > Quantity
Definition coordinate.h:46
coordinate.h
com::lomiri::location::wgs84::tag
Definition altitude.h:33
com::lomiri::location::wgs84
Definition altitude.h:31
com::lomiri::location::wgs84::Latitude
Coordinate< tag::Latitude, units::PlaneAngle > Latitude
Definition latitude.h:38
com::lomiri::location
Definition accuracy.h:28
com::lomiri
Definition accuracy.h:26
com
Definition accuracy.h:24
com::lomiri::location::wgs84::CoordinateTraits< Latitude >::min
static double min()
Definition latitude.h:43
com::lomiri::location::wgs84::CoordinateTraits< Latitude >::max
static double max()
Definition latitude.h:47
com::lomiri::location::wgs84::CoordinateTraits< Latitude >::check_and_throw_if_invalid
static void check_and_throw_if_invalid(const typename Latitude::Quantity &coordinate)
Definition latitude.h:52
com::lomiri::location::wgs84::CoordinateTraits
Definition coordinate.h:35
units.h