Skip to content

Commit 1ee58e6

Browse files
authored
プルリクの指摘に対応してコメント追加 (#274)
1 parent 860261f commit 1ee58e6

File tree

4 files changed

+15
-12
lines changed

4 files changed

+15
-12
lines changed

include/plateau/dataset/gml_file.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include <optional>
66
#include "plateau/network/client.h"
77
#include "city_model_package.h"
8+
#include "plateau/dataset/grid_code.h"
89

910
namespace plateau::dataset {
1011

@@ -20,7 +21,11 @@ namespace plateau::dataset {
2021
const std::string& getPath() const;
2122
void setPath(const std::string& path);
2223
std::shared_ptr<GridCode> getGridCode() const;
23-
GridCode* getGridCodeRaw() const; // 寿命管理をDLL利用者に任せる用です
24+
/**
25+
* getGridCode関数をP/Invokeで利用するための生ポインタ版です。
26+
* 新しいGridCodeインスタンスを生成して返すので、DLL利用者が廃棄する必要があります。
27+
*/
28+
GridCode* getGridCodeRaw() const;
2429
double getEpsg() const;
2530
bool isPolarCoordinateSystem() const;
2631
const std::string& getFeatureType() const;

include/plateau/dataset/grid_code.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ namespace plateau::dataset {
7373
static std::shared_ptr<GridCode> create(const std::string& code);
7474

7575
/**
76-
* \brief 与えられたコードから適切なGridCodeの派生クラスのインスタンスを作成します
76+
* \brief create()をUnityのP/Invokeから呼び出す版です。newして返すので、利用者が適切に廃棄する必要があります
7777
* \param code コード文字列
7878
* \return コードの形式に応じてMeshCodeまたはStandardMapGridのインスタンスを返します。生ポインタで返されます。
7979
* \throw std::invalid_argument コードの形式が不正な場合

include/plateau/dataset/i_dataset_accessor.h

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@ namespace plateau::dataset {
2727
return name_;
2828
}
2929

30-
explicit operator std::string& () {
31-
return name_;
32-
}
33-
3430
explicit operator std::string() const {
3531
return name_;
3632
}
@@ -114,12 +110,6 @@ namespace plateau::dataset {
114110
*/
115111
virtual std::shared_ptr<IDatasetAccessor> filter(const geometry::Extent& extent) const = 0;
116112

117-
/**
118-
* \brief メッシュコードで都市モデルデータをフィルタリングします。
119-
* \param grid_codes 欲しい地域IDのvector
120-
* \param collection フィルタリングされた都市モデルデータの格納先
121-
*/
122-
virtual void filterByGridCodes(const std::vector<GridCode*>& grid_codes, IDatasetAccessor& collection) const = 0;
123113

124114
/**
125115
* \brief メッシュコードで都市モデルデータをフィルタリングします。
@@ -129,6 +119,11 @@ namespace plateau::dataset {
129119
virtual std::shared_ptr<IDatasetAccessor> filterByGridCodes(
130120
const std::vector<std::shared_ptr<GridCode>>& grid_codes) const = 0;
131121

122+
/**
123+
* \brief filterByGridCodes関数の、UnityでP/Invokeから呼び出す版です。引数のvector内のポインタの廃棄はDLL側で責任を持ってください。
124+
*/
125+
virtual void filterByGridCodes(const std::vector<GridCode*>& grid_codes, IDatasetAccessor& collection) const = 0;
126+
132127
/**
133128
* \brief 都市モデルデータが存在する地域メッシュのリストを取得します。
134129
*/

include/plateau/dataset/invalid_grid_code.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ namespace plateau::dataset {
4646
return std::make_shared<InvalidGridCode>();
4747
}
4848

49+
/**
50+
* InvalidGridCodeをnewして返します。DLLの利用者が廃棄に責任を持つ必要があります。
51+
*/
4952
GridCode* upperRaw() const override {
5053
return new InvalidGridCode();
5154
}

0 commit comments

Comments
 (0)