aboutsummaryrefslogtreecommitdiff
path: root/src/utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils.h')
-rw-r--r--src/utils.h18
1 files changed, 1 insertions, 17 deletions
diff --git a/src/utils.h b/src/utils.h
index dea052b..71041a7 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -106,7 +106,7 @@ namespace utils {
return std::vector<T>(begin(data), end(data));
}
- template<typename T> std::vector<std::shared_ptr<T>> jsonList2ptrvec(const std::string& type, const std::vector<std::string>& names) {
+ template<typename T> std::vector<std::shared_ptr<T>> instantiateNames(const std::string& type, const std::vector<std::string>& names) {
std::vector<std::shared_ptr<T>> ret;
for(auto name : names) {
auto j = utils::loadJson(type, name);
@@ -114,20 +114,4 @@ namespace utils {
}
return ret;
}
-
- template<typename T> std::vector<std::shared_ptr<T>> json2ptrvec(const nlohmann::json& data) {
- std::vector<std::shared_ptr<T>> ret;
- for(nlohmann::json d : data) {
- ret.push_back(T::create(d));
- }
- return ret;
- }
-
- template<typename T> std::vector<nlohmann::json> ptrvec2json(std::vector<T> src) {
- std::vector<nlohmann::json> ret;
- for(T i : src) {
- ret.push_back(i->toJson());
- }
- return ret;
- }
}