Splitting utility header with ambigious name into two files with better

names
This commit is contained in:
DennisOSRM 2013-01-06 19:03:04 +01:00
parent 864c2d9f49
commit 2b5e110719
6 changed files with 45 additions and 28 deletions

View File

@ -0,0 +1,38 @@
/*
open source routing machine
Copyright (C) Dennis Luxen, others 2010
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU AFFERO General Public License as published by
the Free Software Foundation; either version 3 of the License, or
any later version.
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 General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
or see http://www.gnu.org/licenses/agpl.txt.
*/
#ifndef MERCATORUTIL_H_
#define MERCATORUTIL_H_
#include <cmath>
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
inline double y2lat(double a) {
return 180/M_PI * (2 * atan(exp(a*M_PI/180)) - M_PI/2);
}
inline double lat2y(double a) {
return 180/M_PI * log(tan(M_PI/4+a*(M_PI/180)/2));
}
#endif /* MERCATORUTIL_H_ */

View File

@ -44,12 +44,12 @@ or see http://www.gnu.org/licenses/agpl.txt.
#include <boost/unordered_map.hpp>
#include "DeallocatingVector.h"
//#include "ExtractorStructs.h"
#include "GridEdge.h"
#include "Percent.h"
#include "PhantomNodes.h"
#include "Util.h"
#include "MercatorUtil.h"
#include "StaticGraph.h"
#include "TimingUtil.h"
#include "../Algorithms/Bresenham.h"
namespace NNGrid{

View File

@ -18,16 +18,12 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
or see http://www.gnu.org/licenses/agpl.txt.
*/
#ifndef TIMEUTIL_H_
#define TIMEUTIL_H_
#ifndef TIMINGUTIL_H_
#define TIMINGUTIL_H_
#include <climits>
#include <cmath>
#include <cstdlib>
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
#ifdef _WIN32
#include <sys/timeb.h>
@ -43,13 +39,6 @@ or see http://www.gnu.org/licenses/agpl.txt.
#include <sys/time.h>
#endif
#ifdef _WIN32
#include <boost/functional/hash.hpp>
#else
#include <tr1/functional_hash.h>
#endif
#include <boost/thread.hpp>
/** Returns a timestamp (now) in seconds (incl. a fractional part). */
static inline double get_timestamp() {
struct timeval tp;
@ -57,14 +46,5 @@ static inline double get_timestamp() {
return double(tp.tv_sec) + tp.tv_usec / 1000000.;
}
static inline double y2lat(double a) { return 180/M_PI * (2 * atan(exp(a*M_PI/180)) - M_PI/2); }
static inline double lat2y(double a) { return 180/M_PI * log(tan(M_PI/4+a*(M_PI/180)/2)); }
static inline unsigned boost_thread_id_hash(boost::thread::id const& id) {
std::stringstream ostr;
ostr << id;
std::tr1::hash<std::string> h;
return h(ostr.str());
}
#endif /* TIMEUTIL_H_ */
#endif /* TIMINGUTIL_H_ */

View File

@ -25,7 +25,7 @@
#include <stxxl.h>
#include "ExtractorStructs.h"
#include "../DataStructures/Util.h"
#include "../DataStructures/TimingUtil.h"
class ExtractionContainers {
public:

View File

@ -34,7 +34,7 @@ or see http://www.gnu.org/licenses/agpl.txt.
#include "../DataStructures/ImportNode.h"
#include "../DataStructures/NodeCoords.h"
#include "../DataStructures/Restriction.h"
#include "../DataStructures/Util.h"
#include "../DataStructures/TimingUtil.h"
#include "../typedefs.h"
typedef boost::unordered_map<std::string, NodeID > StringMap;

View File

@ -30,7 +30,6 @@ or see http://www.gnu.org/licenses/agpl.txt.
#include <boost/shared_ptr.hpp>
#include <boost/enable_shared_from_this.hpp>
#include "../DataStructures/Util.h"
#include "BasicDatastructures.h"
#include "RequestHandler.h"
#include "RequestParser.h"