Skip to content

Commit 803ecbd

Browse files
committed
DPL: only support getting a certain set of vectors
We do not support extracting anything but known types, actually.
1 parent 4d5a07f commit 803ecbd

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

Framework/Core/include/Framework/ConfigParamRegistry.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,11 @@
1313

1414
#include "Framework/ConfigParamStore.h"
1515
#include <boost/property_tree/ptree.hpp>
16-
#include "Framework/Traits.h"
1716

1817
#include <concepts>
1918
#include <cstdint>
2019
#include <memory>
2120
#include <string>
22-
#include <cassert>
23-
#include <type_traits>
2421

2522
template <typename T>
2623
concept SimpleConfigValueType = std::same_as<T, int> ||
@@ -37,6 +34,13 @@ concept SimpleConfigValueType = std::same_as<T, int> ||
3734
std::same_as<T, double> ||
3835
std::same_as<T, bool>;
3936

37+
template <typename T>
38+
concept VectorConfigValueType = std::same_as<T, std::vector<int>> ||
39+
std::same_as<T, std::vector<float>> ||
40+
std::same_as<T, std::vector<double>> ||
41+
std::same_as<T, std::vector<std::string>> ||
42+
std::same_as<T, std::vector<bool>>;
43+
4044
template <typename T>
4145
concept StringConfigValueType = std::same_as<T, std::string>;
4246

@@ -50,7 +54,7 @@ template <typename T>
5054
concept LabeledArrayLike = requires(T& t) { t.is_labeled_array(); };
5155

5256
template <typename T>
53-
concept ConfigValueType = SimpleConfigValueType<T> || StringConfigValueType<T> || o2::framework::base_of_template<std::vector, T> || Array2DLike<T> || LabeledArrayLike<T>;
57+
concept ConfigValueType = SimpleConfigValueType<T> || StringConfigValueType<T> || VectorConfigValueType<T> || Array2DLike<T> || LabeledArrayLike<T>;
5458

5559
namespace o2::framework
5660
{

Framework/Core/src/ConfigParamRegistry.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ T getImpl(boost::property_tree::ptree const& tree, const char* key)
5050
}
5151

5252
template <typename T>
53-
requires base_of_template<std::vector, T>
53+
requires VectorConfigValueType<T>
5454
auto getImpl(boost::property_tree::ptree const& tree, const char* key)
5555
{
5656
return o2::framework::vectorFromBranch<typename T::value_type>(tree.get_child(key));

0 commit comments

Comments
 (0)