track.h

来自「GPS的一个应用程序,很不错的.大家试一试.」· C头文件 代码 · 共 102 行

H
102
字号
#ifndef TRACK_H#define TRACK_H#include "datatypes.h"#include "latlon.h"#include <string>#include <vector>namespace gpsmgr{    //--------------------------------------------------------------------------    class TrackPoint    {    public:	TrackPoint();	TrackPoint(const LatLon& pos,		   DistFt altitude,		   UnixTime time);	const LatLon& position() const;	void setPosition(const LatLon& pos);	DistFt altitude() const;	void setAltitude(DistFt alt);	UnixTime time() const;	void setTime(UnixTime time);	    private:	LatLon mPosition;	DistFt mAltitude;	UnixTime mTime;    };    //--------------------------------------------------------------------------    class Track    {    public:	typedef vector<TrackPoint> PointList;	Track();	Track(const string& name,	      const string& comment);		template <class ItrType>	Track(ItrType begin,	      ItrType end,	      const string& name,	      const string& comment);	const PointList& points() const;	PointList& points();	template <class ItrType>	void setPoints(ItrType begin, ItrType end);	const string& name() const;	void setName(const string& name);	const string& comment() const;	void setComment(const string& comment);	    private:	PointList mTrackList;	string mName;	string mComment;    };    bool operator==(const TrackPoint& lhs, const TrackPoint& rhs);    bool operator==(const Track& lhs, const Track& rhs);    bool operator<(const TrackPoint& lhs, const TrackPoint& rhs);    bool operator<(const Track& lhs, const Track& rhs);    ///////////////////////////////    // TEMPLATE IMPLEMENTATAIONS //    ///////////////////////////////    template <class ItrType>    Track::Track(ItrType begin,		 ItrType end,		 const string& name,		 const string& comment) :	mTrackList (begin, end),	mName (name),	mComment (comment)    {}        template <class ItrType>    void Track::setPoints(ItrType begin, ItrType end)    {	mTrackList.assign(begin, end);    }}#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?