Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RFieldUtils.hxx
Go to the documentation of this file.
1/// \file RFieldUtils.hxx
2/// \ingroup NTuple ROOT7
3/// \author Jonas Hahnfeld <jonas.hahnfeld@cern.ch>
4/// \date 2024-11-19
5/// \warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback
6/// is welcome!
7
8#ifndef ROOT7_RFieldUtils
9#define ROOT7_RFieldUtils
10
11#include <string>
12#include <string_view>
13#include <tuple>
14#include <vector>
15
16class TClass;
17
18namespace ROOT {
19namespace Experimental {
20namespace Internal {
21
22/// Applies type name normalization rules that lead to the final name used to create a RField, e.g. transforms
23/// `const vector<T>` to `std::vector<T>`. Specifically, `const` / `volatile` qualifiers are removed and `std::` is
24/// added to fully qualify known types in the `std` namespace. The same happens to `ROOT::RVec` which is normalized to
25/// `ROOT::VecOps::RVec`.
26std::string GetNormalizedTypeName(const std::string &typeName);
27
28/// Possible settings for the "rntuple.streamerMode" class attribute in the dictionary.
30
32
33/// Parse a type name of the form `T[n][m]...` and return the base type `T` and a vector that contains,
34/// in order, the declared size for each dimension, e.g. for `unsigned char[1][2][3]` it returns the tuple
35/// `{"unsigned char", {1, 2, 3}}`. Extra whitespace in `typeName` should be removed before calling this function.
36///
37/// If `typeName` is not an array type, it returns a tuple `{T, {}}`. On error, it returns a default-constructed tuple.
38std::tuple<std::string, std::vector<size_t>> ParseArrayType(std::string_view typeName);
39
40/// Used in RFieldBase::Create() in order to get the comma-separated list of template types
41/// E.g., gets {"int", "std::variant<double,int>"} from "int,std::variant<double,int>"
42std::vector<std::string> TokenizeTypeList(std::string_view templateType);
43
44} // namespace Internal
45
46} // namespace Experimental
47} // namespace ROOT
48
49#endif
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition TClass.h:81
std::vector< std::string > TokenizeTypeList(std::string_view templateType)
Used in RFieldBase::Create() in order to get the comma-separated list of template types E....
std::string GetNormalizedTypeName(const std::string &typeName)
Applies type name normalization rules that lead to the final name used to create a RField,...
ERNTupleSerializationMode
Possible settings for the "rntuple.streamerMode" class attribute in the dictionary.
ERNTupleSerializationMode GetRNTupleSerializationMode(TClass *cl)
std::tuple< std::string, std::vector< size_t > > ParseArrayType(std::string_view typeName)
Parse a type name of the form T[n][m]... and return the base type T and a vector that contains,...
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...