Factor out constructor to cpp.

This commit is contained in:
Denis Koronchik 2014-07-09 18:27:35 +02:00 committed by Alex Zolotarev
parent bb20f3198c
commit 90090a1ed4
2 changed files with 10 additions and 7 deletions

View file

@ -1,11 +1,20 @@
#include "road_graph.hpp"
#include "../base/assert.hpp"
#include "../std/sstream.hpp"
namespace routing
{
RoadPos::RoadPos(uint32_t featureId, bool bForward, size_t pointId)
: m_featureId((featureId << 1) + (bForward ? 1 : 0)), m_pointId(pointId)
{
ASSERT_LESS(featureId, 1U << 31, ());
ASSERT_LESS(pointId, 0xFFFFFFFF, ());
}
string DebugPrint(RoadPos const & r)
{
ostringstream ss;

View file

@ -2,7 +2,6 @@
#include "../geometry/point2d.hpp"
#include "../base/assert.hpp"
#include "../base/string_utils.hpp"
#include "../std/vector.hpp"
@ -16,12 +15,7 @@ class RoadPos
{
public:
RoadPos() : m_featureId(0), m_pointId(0) {}
RoadPos(uint32_t featureId, bool bForward, size_t pointId)
: m_featureId((featureId << 1) + (bForward ? 1 : 0)), m_pointId(pointId)
{
ASSERT_LESS(featureId, 1U << 31, ());
ASSERT_LESS(pointId, 0xFFFFFFFF, ());
}
RoadPos(uint32_t featureId, bool bForward, size_t pointId);
uint32_t GetFeatureId() const { return m_featureId >> 1; }
bool IsForward() const { return (m_featureId & 1) != 0; }