📄 gpsroadstruct.cpp
字号:
// 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);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -