Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[hrpPlanner] fix warnings(-Wdelete-incomplete) #138

Merged
merged 1 commit into from
Sep 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 20 additions & 21 deletions hrplib/hrpPlanner/Algorithm.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,6 @@

namespace PathEngine {
class PathPlanner;
class Algorithm;

/**
* 経路計画アルゴリズム生成関数
*/
typedef Algorithm* (*AlgorithmNewFunc)(PathPlanner* planner);

/**
* 経路計画アルゴリズム削除関数
*/
typedef void (*AlgorithmDeleteFunc)(Algorithm* algorithm);

template <class _New>
Algorithm* AlgorithmCreate(PathPlanner* planner) {
return new _New(planner);
}

template <class _Delete>
void AlgorithmDelete(Algorithm* algorithm) {
delete algorithm;
}

/**
* @brief 経路計画アルゴリズム基底クラス
Expand Down Expand Up @@ -201,6 +180,26 @@ namespace PathEngine {
*/
void ignoreCollisionAtStart(bool b) { ignoreCollisionAtStart_ = b; }
};

/**
* 経路計画アルゴリズム生成関数
*/
typedef Algorithm* (*AlgorithmNewFunc)(PathPlanner* planner);

/**
* 経路計画アルゴリズム削除関数
*/
typedef void (*AlgorithmDeleteFunc)(Algorithm* algorithm);

template <class _New>
Algorithm* AlgorithmCreate(PathPlanner* planner) {
return new _New(planner);
}

template <class _Delete>
void AlgorithmDelete(Algorithm* algorithm) {
delete algorithm;
}
};

#endif // __ALGORITHM_H__
54 changes: 26 additions & 28 deletions hrplib/hrpPlanner/Mobility.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,7 @@
#include "Configuration.h"

namespace PathEngine {

class PathPlanner;
class Mobility;

/**
* @brief 移動アルゴリズム生成関数
*/
typedef Mobility* (*MobilityNewFunc)(PathPlanner* planner);

/**
* @brief 移動アルゴリズム解放関数
*/
typedef void (*MobilityDeleteFunc)(Mobility* mobility);

/**
* @brief 移動アルゴリズム生成関数生成テンプレート
*/
template <class _New>
Mobility* MobilityCreate(PathPlanner* planner) {
return new _New(planner);
}

/**
* @brief 移動アルゴリズム解放関数生成テンプレート
*/
template <class _Delete>
void MobilityDelete(Mobility* mobility) {
delete mobility;
}

/**
* @brief 移動アルゴリズム実装用抽象クラス
Expand Down Expand Up @@ -122,5 +94,31 @@ namespace PathEngine {
*/
static double interpolationDistance_;
};

/**
* @brief 移動アルゴリズム生成関数
*/
typedef Mobility* (*MobilityNewFunc)(PathPlanner* planner);

/**
* @brief 移動アルゴリズム解放関数
*/
typedef void (*MobilityDeleteFunc)(Mobility* mobility);

/**
* @brief 移動アルゴリズム生成関数生成テンプレート
*/
template <class _New>
Mobility* MobilityCreate(PathPlanner* planner) {
return new _New(planner);
}

/**
* @brief 移動アルゴリズム解放関数生成テンプレート
*/
template <class _Delete>
void MobilityDelete(Mobility* mobility) {
delete mobility;
}
};
#endif // __MOBILITY_H__
41 changes: 20 additions & 21 deletions hrplib/hrpPlanner/Optimizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,8 @@
#include "Configuration.h"

namespace PathEngine {
class Optimizer;
class PathPlanner;

/**
* 経路最適化アルゴリズム生成関数
*/
typedef Optimizer* (*OptimizerNewFunc)(PathPlanner* planner);

/**
* 経路最適化アルゴリズム削除関数
*/
typedef void (*OptimizerDeleteFunc)(Optimizer* optimizer);

template <class _New>
Optimizer* OptimizerCreate(PathPlanner* planner) {
return new _New(planner);
}

template <class _Delete>
void OptimizerDelete(Optimizer* optimizer) {
delete optimizer;
}

/**
* @brief 経路最適化アルゴリズム実装用の抽象クラス
*
Expand Down Expand Up @@ -57,6 +36,26 @@ namespace PathEngine {
protected:
PathPlanner *planner_;
};

/**
* 経路最適化アルゴリズム生成関数
*/
typedef Optimizer* (*OptimizerNewFunc)(PathPlanner* planner);

/**
* 経路最適化アルゴリズム削除関数
*/
typedef void (*OptimizerDeleteFunc)(Optimizer* optimizer);

template <class _New>
Optimizer* OptimizerCreate(PathPlanner* planner) {
return new _New(planner);
}

template <class _Delete>
void OptimizerDelete(Optimizer* optimizer) {
delete optimizer;
}
};

#endif