Go to the documentation of this file.
25 #include "spdlog/fmt/ostr.h"
26 #include "spdlog/spdlog.h"
45 #define AD_MAP_POINT_LONGITUDE_THROWS_EXCEPTION 1
47 #if SAFE_DATATYPES_EXPLICIT_CONVERSION
51 #define _AD_MAP_POINT_LONGITUDE_EXPLICIT_CONVERSION_ explicit
56 #define _AD_MAP_POINT_LONGITUDE_EXPLICIT_CONVERSION_
91 : mLongitude(std::numeric_limits<double>::quiet_NaN())
101 : mLongitude(iLongitude)
172 return (mLongitude > other.mLongitude) &&
operator!=(other);
188 return (mLongitude < other.mLongitude) &&
operator!=(other);
204 return ((mLongitude > other.mLongitude) ||
operator==(other));
220 return ((mLongitude < other.mLongitude) ||
operator==(other));
237 Longitude const result(mLongitude + other.mLongitude);
256 mLongitude += other.mLongitude;
275 Longitude const result(mLongitude - other.mLongitude);
294 mLongitude -= other.mLongitude;
312 Longitude const result(mLongitude * scalar);
330 Longitude const result(
operator/(scalarLongitude));
350 double const result = mLongitude / other.mLongitude;
390 auto const valueClass = std::fpclassify(mLongitude);
391 return ((valueClass == FP_NORMAL) || (valueClass == FP_ZERO)) && (
cMinValue <= mLongitude)
405 spdlog::info(
"ensureValid(::ad::map::point::Longitude)>> {} value out of range", *
this);
406 #if (AD_MAP_POINT_LONGITUDE_THROWS_EXCEPTION == 1)
407 throw std::out_of_range(
"Longitude value out of range");
423 spdlog::info(
"ensureValid(::ad::map::point::Longitude)>> {} value is zero", *
this);
424 #if (AD_MAP_POINT_LONGITUDE_THROWS_EXCEPTION == 1)
425 throw std::out_of_range(
"Longitude value is zero");
477 return value.operator*(other);
488 inline ::ad::map::point::Longitude
fabs(const ::ad::map::point::Longitude other)
508 static inline ::ad::map::point::Longitude
lowest()
510 return ::ad::map::point::Longitude::getMin();
515 static inline ::ad::map::point::Longitude
max()
517 return ::ad::map::point::Longitude::getMax();
523 static inline ::ad::map::point::Longitude
epsilon()
525 return ::ad::map::point::Longitude::getPrecision();
534 #ifndef GEN_GUARD_AD_MAP_POINT_LONGITUDE
535 #define GEN_GUARD_AD_MAP_POINT_LONGITUDE
562 return os << double(_value);
575 return to_string(
static_cast<double>(value));
578 #endif // GEN_GUARD_AD_MAP_POINT_LONGITUDE
namespace ad
Definition: GeometryStoreItem.hpp:28
std::ostream & operator<<(std::ostream &os, Altitude const &_value)
standard ostream operator
Definition: Altitude.hpp:562
bool isValid() const
Definition: Longitude.hpp:388
_AD_MAP_POINT_LONGITUDE_EXPLICIT_CONVERSION_ Longitude(double const iLongitude)
standard constructor
Definition: Longitude.hpp:100
static inline ::ad::map::point::Longitude lowest()
Definition: Longitude.hpp:508
void ensureValidNonZero() const
ensure that the Longitude is valid and non zero
Definition: Longitude.hpp:418
bool operator<=(const Longitude &other) const
standard comparison operator
Definition: Longitude.hpp:216
static inline ::ad::map::point::Longitude max()
Definition: Longitude.hpp:515
static const double cMaxValue
constant defining the maximum valid Longitude value (used in isValid())
Definition: Longitude.hpp:76
bool operator!=(const Longitude &other) const
standard comparison operator
Definition: Longitude.hpp:154
Longitude operator-() const
standard arithmetic operator
Definition: Longitude.hpp:362
inline ::ad::map::point::Longitude operator*(const double &other, ::ad::map::point::Longitude const &value)
standard arithmetic operator
Definition: Longitude.hpp:475
static const double cPrecisionValue
constant defining the assumed Longitude value accuracy (used in comparison operator==(),...
Definition: Longitude.hpp:82
inline ::ad::map::point::Longitude fabs(const ::ad::map::point::Longitude other)
overload of the std::fabs for Longitude
Definition: Longitude.hpp:488
static Longitude getPrecision()
get assumed accuracy of Longitude (i.e. cPrecisionValue)
Definition: Longitude.hpp:449
std::string to_string(::ad::map::access::GeometryStoreItem const &value)
overload of the std::to_string for GeometryStoreItem
Definition: GeometryStoreItem.hpp:183
Longitude()
default constructor
Definition: Longitude.hpp:90
bool operator>(const Longitude &other) const
standard comparison operator
Definition: Longitude.hpp:168
static Longitude getMin()
get minimum valid Longitude (i.e. cMinValue)
Definition: Longitude.hpp:433
static inline ::ad::map::point::Longitude epsilon()
Definition: Longitude.hpp:523
Longitude operator*(const double &scalar) const
standard arithmetic operator
Definition: Longitude.hpp:309
double operator/(const Longitude &other) const
standard arithmetic operator
Definition: Longitude.hpp:346
Longitude operator+(const Longitude &other) const
standard arithmetic operator
Definition: Longitude.hpp:233
void ensureValid() const
ensure that the Longitude is valid
Definition: Longitude.hpp:401
bool operator<(const Longitude &other) const
standard comparison operator
Definition: Longitude.hpp:184
Longitude & operator=(const Longitude &other)=default
standard assignment operator
Longitude operator/(const double &scalar) const
standard arithmetic operator
Definition: Longitude.hpp:327
bool operator>=(const Longitude &other) const
standard comparison operator
Definition: Longitude.hpp:200
Longitude operator-(const Longitude &other) const
standard arithmetic operator
Definition: Longitude.hpp:271
static const double cMinValue
constant defining the minimum valid Longitude value (used in isValid())
Definition: Longitude.hpp:71
static Longitude getMax()
get maximum valid Longitude (i.e. cMaxValue)
Definition: Longitude.hpp:441
Longitude & operator+=(const Longitude &other)
standard arithmetic operator
Definition: Longitude.hpp:252
Longitude operator-=(const Longitude &other)
standard arithmetic operator
Definition: Longitude.hpp:290
DataType Longitude.
Definition: Longitude.hpp:65
bool operator==(const Longitude &other) const
standard comparison operator
Definition: Longitude.hpp:140
#define _AD_MAP_POINT_LONGITUDE_EXPLICIT_CONVERSION_
Enable/Disable explicit conversion. Currently set to "implicit conversion allowed".
Definition: Longitude.hpp:56
inline ::ad::map::point::Altitude fabs(const ::ad::map::point::Altitude other)
overload of the std::fabs for Altitude
Definition: Altitude.hpp:490