diff options
author | vng <viktor.govako@gmail.com> | 2014-07-13 22:34:27 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 02:20:41 +0300 |
commit | 4100abc69e5aae53f8e2ee01c3c52164650e0ca5 (patch) | |
tree | 4cffc52bfa462492e4b7e1c7c82d90d37ec4e04d /routing/route.hpp | |
parent | 2aca4755f344d49a90009a33aa3c45ff2710547d (diff) |
[routing] Added more constructors to the Route class.
Diffstat (limited to 'routing/route.hpp')
-rw-r--r-- | routing/route.hpp | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/routing/route.hpp b/routing/route.hpp index eb9d9848c6..c368b1d027 100644 --- a/routing/route.hpp +++ b/routing/route.hpp @@ -12,8 +12,28 @@ namespace routing class Route { public: - Route() {} - Route(string const & router, vector<m2::PointD> const & points, string const & name = ""); + explicit Route(string const & router, string const & name = string()) + : m_router(router), m_name(name) + { + } + + template <class IterT> + Route(string const & router, IterT beg, IterT end, + string const & name = string()) + : m_router(router), m_poly(beg, end), m_name(name) + { + } + + Route(string const & router, vector<m2::PointD> const & points, + string const & name = string()) + : m_router(router), m_poly(points), m_name(name) + { + } + + template <class IterT> void SetGeometry(IterT beg, IterT end) + { + m2::PolylineD(beg, end).Swap(m_poly); + } string const & GetRouterId() const { return m_router; } m2::PolylineD const & GetPoly() const { return m_poly; } |