bugfix: add destructor, and disable copy ctor
parent
8c3b7a6a87
commit
81bd28e821
|
@ -6,7 +6,7 @@
|
|||
#include <mutex>
|
||||
using namespace std;
|
||||
|
||||
//目标抽象类
|
||||
//Ŀ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
class Controller
|
||||
{
|
||||
public:
|
||||
|
@ -16,27 +16,27 @@ public:
|
|||
private:
|
||||
};
|
||||
|
||||
//适配者类DxfParser
|
||||
//<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>DxfParser
|
||||
class DxfParser
|
||||
{
|
||||
public:
|
||||
DxfParser(){}
|
||||
void parseFile(){
|
||||
printf("解析文件提取数据\n");
|
||||
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD>ȡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
|
||||
}
|
||||
};
|
||||
|
||||
//适配者类PathPlanner
|
||||
//<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>PathPlanner
|
||||
class PathPlanner
|
||||
{
|
||||
public:
|
||||
PathPlanner(){}
|
||||
void calculate(){
|
||||
printf("计算加工路径\n");
|
||||
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӹ<EFBFBD>·<EFBFBD><EFBFBD>\n");
|
||||
}
|
||||
};
|
||||
|
||||
//适配器类Adapter
|
||||
//<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Adapter
|
||||
class Adapter:public Controller
|
||||
{
|
||||
public:
|
||||
|
@ -44,8 +44,14 @@ public:
|
|||
dxfParser = new DxfParser();
|
||||
pathPlanner = new PathPlanner();
|
||||
}
|
||||
~Adapter(){
|
||||
delete dxfParser;
|
||||
delete pathPlanner;
|
||||
}
|
||||
Adapter(const Adapter& other) = delete;
|
||||
Adapter& operator=(const Adapter& ) = delete;
|
||||
void pathPlanning(){
|
||||
printf("路径规划:\n");
|
||||
printf("·<EFBFBD><EFBFBD><EFBFBD>滮<EFBFBD><EFBFBD>\n");
|
||||
dxfParser->parseFile();
|
||||
pathPlanner->calculate();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue