Add namespace around all files
This commit is contained in:
@@ -7,6 +7,11 @@
|
||||
|
||||
#include <cmath>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace util
|
||||
{
|
||||
|
||||
double ComputeAngle::OfThreeFixedPointCoordinates(const FixedPointCoordinate &first,
|
||||
const FixedPointCoordinate &second,
|
||||
const FixedPointCoordinate &third) noexcept
|
||||
@@ -25,3 +30,5 @@ double ComputeAngle::OfThreeFixedPointCoordinates(const FixedPointCoordinate &fi
|
||||
}
|
||||
return angle;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,11 @@
|
||||
#include <iostream>
|
||||
#include <limits>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace util
|
||||
{
|
||||
|
||||
FixedPointCoordinate::FixedPointCoordinate()
|
||||
: lat(std::numeric_limits<int>::min()), lon(std::numeric_limits<int>::min())
|
||||
{
|
||||
@@ -50,3 +55,5 @@ std::ostream &operator<<(std::ostream &out, const FixedPointCoordinate &coordina
|
||||
out << "(" << static_cast<double>(coordinate.lat / COORDINATE_PRECISION) << "," << static_cast<double>(coordinate.lon / COORDINATE_PRECISION) << ")";
|
||||
return out;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,11 @@
|
||||
|
||||
#include <limits>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace util
|
||||
{
|
||||
|
||||
namespace
|
||||
{
|
||||
constexpr static const double RAD = 0.017453292519943295769236907684886;
|
||||
@@ -223,3 +228,5 @@ double bearing(const FixedPointCoordinate &first_coordinate,
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,11 @@
|
||||
|
||||
#include "osrm/coordinate.hpp"
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace util
|
||||
{
|
||||
|
||||
uint64_t HilbertCode::operator()(const FixedPointCoordinate ¤t_coordinate) const
|
||||
{
|
||||
unsigned location[2];
|
||||
@@ -71,3 +76,5 @@ void HilbertCode::TransposeCoordinate(uint32_t *X) const
|
||||
X[i] ^= t;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,11 @@
|
||||
|
||||
#include <cmath>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace util
|
||||
{
|
||||
|
||||
double mercator::y2lat(const double value) noexcept
|
||||
{
|
||||
return 180. * M_1_PI * (2. * std::atan(std::exp(value * M_PI / 180.)) - M_PI_2);
|
||||
@@ -11,3 +16,5 @@ double mercator::lat2y(const double latitude) noexcept
|
||||
{
|
||||
return 180. * M_1_PI * std::log(std::tan(M_PI_4 + latitude * (M_PI / 180.) / 2.));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
#include "util/osrm_exception.hpp"
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
// This function exists to 'anchor' the class, and stop the compiler from
|
||||
// copying vtable and RTTI info into every object file that includes
|
||||
// this header. (Caught by -Wweak-vtables under Clang.)
|
||||
@@ -12,5 +10,13 @@ namespace osrm
|
||||
// always have at least one out-of-line virtual method in the class. Without
|
||||
// this, the compiler will copy the vtable and RTTI into every .o file that
|
||||
// #includes the header, bloating .o file sizes and increasing link times.
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace util
|
||||
{
|
||||
|
||||
void exception::anchor() const {}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,11 @@
|
||||
#include <mutex>
|
||||
#include <string>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace util
|
||||
{
|
||||
|
||||
namespace
|
||||
{
|
||||
static const char COL_RESET[]{"\x1b[0m"};
|
||||
@@ -92,3 +97,5 @@ SimpleLogger::~SimpleLogger()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user