11#ifndef FRAMEWORK_VARIANTPTREEHELPERS_H
12#define FRAMEWORK_VARIANTPTREEHELPERS_H
15#include <boost/property_tree/ptree.hpp>
22 boost::property_tree::ptree branch;
23 for (
auto i = 0u;
i <
size; ++
i) {
24 boost::property_tree::ptree leaf;
26 branch.push_back(std::make_pair(
"", leaf));
40 boost::property_tree::ptree branch;
54 boost::property_tree::ptree subtree;
55 for (
auto i = 0u;
i <
array.rows; ++
i) {
56 boost::property_tree::ptree branch;
57 for (
auto j = 0u;
j <
array.cols; ++
j) {
58 boost::property_tree::ptree leaf;
60 branch.push_back(std::make_pair(
"", leaf));
62 subtree.push_back(std::make_pair(
"", branch));
70 boost::property_tree::ptree subtree;
78 std::vector<T>
result(branch.size());
80 for (
auto const&
entry : branch) {
89 return basicVectorFromBranch<T>(branch.get_child(
"values"));
100 for (
auto const&
row : branch) {
102 ncols =
row.second.size();
106 for (
auto const&
entry :
row.second) {
107 cache.push_back(
entry.second.get_value<T>());
118 return basicArray2DFromBranch<T>(ptree.get_child(
"values"));
121std::pair<std::vector<std::string>, std::vector<std::string>>
extractLabels(boost::property_tree::ptree
const&
tree);
127 auto values = basicArray2DFromBranch<T>(
tree.get_child(
"values"));
135 boost::property_tree::ptree subtree;
169extern template std::vector<float> o2::framework::basicVectorFromBranch<float>(boost::property_tree::ptree
const&
tree);
170extern template std::vector<int> o2::framework::basicVectorFromBranch<int>(boost::property_tree::ptree
const&
tree);
171extern template std::vector<std::basic_string<char>> o2::framework::basicVectorFromBranch<std::basic_string<char>>(boost::property_tree::ptree
const&
tree);
172extern template std::vector<double> o2::framework::basicVectorFromBranch<double>(boost::property_tree::ptree
const&
tree);
std::vector< std::string > labels_rows
std::vector< std::string > labels_cols
GLenum GLsizei GLsizei GLint * values
Defining ITS Vertex explicitly as messageable.
LabeledArray< T > labeledArrayFromBranch(boost::property_tree::ptree const &tree)
Array2D< T > basicArray2DFromBranch(boost::property_tree::ptree const &branch)
boost::property_tree::ptree labeledArrayToBranch(LabeledArray< T > &&array)
boost::property_tree::ptree basicVectorToBranch(T *values, size_t size)
boost::property_tree::ptree basicArray2DToBranch(Array2D< T > &&array)
std::pair< std::vector< std::string >, std::vector< std::string > > extractLabels(boost::property_tree::ptree const &tree)
boost::property_tree::ptree array2DToBranch(Array2D< T > &&array)
Array2D< T > array2DFromBranch(boost::property_tree::ptree const &ptree)
std::vector< T > vectorFromBranch(boost::property_tree::ptree const &branch)
std::vector< T > basicVectorFromBranch(boost::property_tree::ptree const &branch)
boost::property_tree::ptree vectorToBranch(T const *values, size_t size)
std::unique_ptr< TTree > tree((TTree *) flIn.Get(std::string(o2::base::NameConf::CTFTREENAME).c_str()))