GpsRoadStruct.cpp
上传用户:yffx2008
上传日期:2014-10-12
资源大小:12414k
文件大小:2k
- // GpsRoadStruct.cpp: implementation of the CGpsRoadStruct class.
- //
- //////////////////////////////////////////////////////////////////////
- #include "stdafx.h"
- #include "GpsSC.h"
- #include "GpsRoadStruct.h"
- #include "SmallRoadStruct.h"
- #ifdef _DEBUG
- #undef THIS_FILE
- static char THIS_FILE[]=__FILE__;
- #define new DEBUG_NEW
- #endif
- //////////////////////////////////////////////////////////////////////
- // Construction/Destruction
- //////////////////////////////////////////////////////////////////////
- CGpsRoadStruct::CGpsRoadStruct()
- {
- BigRoad_SN_Bytes = 1;
- BigRoad_Serial = 0;
- m_BigRoad_Number = 0;
- m_byBigRoad_Number_Bytes = 2;
- SmallRoadTotal = 0;
- SmallRoadTotal_Bytes= 1; //相同的两个字节表示
- m_byIsHelpRoad = 0;
- m_byHelpRoad_Bytes = 1;
- ClearSmallRoadList();
- }
- CGpsRoadStruct::~CGpsRoadStruct()
- {
- ClearSmallRoadList();
- }
- CGpsRoadStruct::ClearSmallRoadList()
- {
- CSmallRoadStruct *pSmallRoadStruct;
- POSITION pos = SmallRoadList.GetHeadPosition();
- while(pos != NULL) {
- pSmallRoadStruct = (CSmallRoadStruct*)SmallRoadList.GetNext(pos);
- delete pSmallRoadStruct;
- }
- SmallRoadList.RemoveAll();
- }
- CGpsRoadStruct& CGpsRoadStruct::operator = (const CGpsRoadStruct& ds)
- {
- BigRoad_Serial = ds.BigRoad_Serial;
- m_BigRoad_Number = ds.m_BigRoad_Number;
- SmallRoadTotal = ds.SmallRoadTotal;
- CopyRoadList(&ds.SmallRoadList,&SmallRoadList);
- return *this;
- }
- CGpsRoadStruct::CopyRoadList(const CObList *SourceList,CObList *DestList)
- {
- CSmallRoadStruct *pSmallRoad,*pTemp;
- POSITION pos;
- pos = SourceList->GetTailPosition();
- while(pos != NULL) {
- pSmallRoad = (CSmallRoadStruct*)SourceList->GetPrev(pos);
- pTemp = new CSmallRoadStruct;
- *pTemp = *pSmallRoad;
- DestList->AddHead(pTemp);
- }
- }