2019-10-22 00:24:54 +00:00
|
|
|
|
#ifndef __SINGLETON_H__
|
|
|
|
|
#define __SINGLETON_H__
|
|
|
|
|
|
|
|
|
|
#include <iostream>
|
|
|
|
|
#include <string.h>
|
|
|
|
|
#include <mutex>
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
|
|
//Ŀ<><C4BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
class Controller
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
Controller(){}
|
2021-04-04 13:09:08 +00:00
|
|
|
|
virtual ~Controller(){}
|
2019-10-22 00:24:54 +00:00
|
|
|
|
virtual void pathPlanning() = 0;
|
|
|
|
|
private:
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>DxfParser
|
|
|
|
|
class DxfParser
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
DxfParser(){}
|
|
|
|
|
void parseFile(){
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD>ȡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>PathPlanner
|
|
|
|
|
class PathPlanner
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
PathPlanner(){}
|
|
|
|
|
void calculate(){
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӹ<EFBFBD>·<EFBFBD><EFBFBD>\n");
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Adapter
|
|
|
|
|
class Adapter:public Controller
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
Adapter(){
|
|
|
|
|
dxfParser = new DxfParser();
|
|
|
|
|
pathPlanner = new PathPlanner();
|
|
|
|
|
}
|
|
|
|
|
void pathPlanning(){
|
|
|
|
|
printf("·<EFBFBD><EFBFBD><EFBFBD>滮<EFBFBD><EFBFBD>\n");
|
|
|
|
|
dxfParser->parseFile();
|
|
|
|
|
pathPlanner->calculate();
|
|
|
|
|
}
|
|
|
|
|
private:
|
|
|
|
|
DxfParser *dxfParser;
|
|
|
|
|
PathPlanner *pathPlanner;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif //__SINGLETON_H__
|