diff --git a/hrplib/hrpPlanner/Algorithm.h b/hrplib/hrpPlanner/Algorithm.h index 6b53df73c..de5a28d71 100644 --- a/hrplib/hrpPlanner/Algorithm.h +++ b/hrplib/hrpPlanner/Algorithm.h @@ -12,27 +12,6 @@ namespace PathEngine { class PathPlanner; - class Algorithm; - - /** - * 経路計画アルゴリズム生成関数 - */ - typedef Algorithm* (*AlgorithmNewFunc)(PathPlanner* planner); - - /** - * 経路計画アルゴリズム削除関数 - */ - typedef void (*AlgorithmDeleteFunc)(Algorithm* algorithm); - - template - Algorithm* AlgorithmCreate(PathPlanner* planner) { - return new _New(planner); - } - - template - void AlgorithmDelete(Algorithm* algorithm) { - delete algorithm; - } /** * @brief 経路計画アルゴリズム基底クラス @@ -201,6 +180,26 @@ namespace PathEngine { */ void ignoreCollisionAtStart(bool b) { ignoreCollisionAtStart_ = b; } }; + + /** + * 経路計画アルゴリズム生成関数 + */ + typedef Algorithm* (*AlgorithmNewFunc)(PathPlanner* planner); + + /** + * 経路計画アルゴリズム削除関数 + */ + typedef void (*AlgorithmDeleteFunc)(Algorithm* algorithm); + + template + Algorithm* AlgorithmCreate(PathPlanner* planner) { + return new _New(planner); + } + + template + void AlgorithmDelete(Algorithm* algorithm) { + delete algorithm; + } }; #endif // __ALGORITHM_H__ diff --git a/hrplib/hrpPlanner/Mobility.h b/hrplib/hrpPlanner/Mobility.h index 99d681e7c..0996a2d38 100644 --- a/hrplib/hrpPlanner/Mobility.h +++ b/hrplib/hrpPlanner/Mobility.h @@ -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 - Mobility* MobilityCreate(PathPlanner* planner) { - return new _New(planner); - } - - /** - * @brief 移動アルゴリズム解放関数生成テンプレート - */ - template - void MobilityDelete(Mobility* mobility) { - delete mobility; - } /** * @brief 移動アルゴリズム実装用抽象クラス @@ -122,5 +94,31 @@ namespace PathEngine { */ static double interpolationDistance_; }; + + /** + * @brief 移動アルゴリズム生成関数 + */ + typedef Mobility* (*MobilityNewFunc)(PathPlanner* planner); + + /** + * @brief 移動アルゴリズム解放関数 + */ + typedef void (*MobilityDeleteFunc)(Mobility* mobility); + + /** + * @brief 移動アルゴリズム生成関数生成テンプレート + */ + template + Mobility* MobilityCreate(PathPlanner* planner) { + return new _New(planner); + } + + /** + * @brief 移動アルゴリズム解放関数生成テンプレート + */ + template + void MobilityDelete(Mobility* mobility) { + delete mobility; + } }; #endif // __MOBILITY_H__ diff --git a/hrplib/hrpPlanner/Optimizer.h b/hrplib/hrpPlanner/Optimizer.h index 989489287..fdd2637cc 100644 --- a/hrplib/hrpPlanner/Optimizer.h +++ b/hrplib/hrpPlanner/Optimizer.h @@ -7,29 +7,8 @@ #include "Configuration.h" namespace PathEngine { - class Optimizer; class PathPlanner; - /** - * 経路最適化アルゴリズム生成関数 - */ - typedef Optimizer* (*OptimizerNewFunc)(PathPlanner* planner); - - /** - * 経路最適化アルゴリズム削除関数 - */ - typedef void (*OptimizerDeleteFunc)(Optimizer* optimizer); - - template - Optimizer* OptimizerCreate(PathPlanner* planner) { - return new _New(planner); - } - - template - void OptimizerDelete(Optimizer* optimizer) { - delete optimizer; - } - /** * @brief 経路最適化アルゴリズム実装用の抽象クラス * @@ -57,6 +36,26 @@ namespace PathEngine { protected: PathPlanner *planner_; }; + + /** + * 経路最適化アルゴリズム生成関数 + */ + typedef Optimizer* (*OptimizerNewFunc)(PathPlanner* planner); + + /** + * 経路最適化アルゴリズム削除関数 + */ + typedef void (*OptimizerDeleteFunc)(Optimizer* optimizer); + + template + Optimizer* OptimizerCreate(PathPlanner* planner) { + return new _New(planner); + } + + template + void OptimizerDelete(Optimizer* optimizer) { + delete optimizer; + } }; #endif