📄 route.h
字号:
#ifndef ROUTE_H#define ROUTE_H#include <string>#include <vector>#include "waypoint.h"namespace gpsmgr{ class Route { public: typedef std::vector<Waypoint> Waypoints; public: Route(); Route(const std::string& name, const std::string& comment); template <class ItrType> Route(ItrType begin, ItrType end, const std::string& name, const std::string& comment); // accessors std::string name() const; std::string comment() const; Waypoints& waypoints(); const Waypoints& waypoints() const; // mutators void setName(const std::string& name); void setComment(const std::string& comment); template <class ItrType> void setWaypoint(ItrType begin, ItrType end); private: std::string mName; std::string mComment; Waypoints mWaypoints; }; ////////////////////////////// // TEMPLATE IMPLEMENTATIONS // ////////////////////////////// template <class ItrType> Route::Route(ItrType begin, ItrType end, const std::string& name, const std::string& comment) : mName (name), mComment (comment), mWaypoints (begin, end) {} template <class ItrType> void Route::setWaypoint(ItrType begin, ItrType end) { mWaypoints.assign(begin, end); } }#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -