Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RNTupleUtils.hxx
Go to the documentation of this file.
1/// \file ROOT/RNTupleUtils.hxx
2/// \ingroup NTuple
3/// \author Jakob Blomer <jblomer@cern.ch>
4/// \date 2025-07-31
5
6/*************************************************************************
7 * Copyright (C) 1995-2025, Rene Brun and Fons Rademakers. *
8 * All rights reserved. *
9 * *
10 * For the licensing terms see $ROOTSYS/LICENSE. *
11 * For the list of contributors see $ROOTSYS/README/CREDITS. *
12 *************************************************************************/
13
14#ifndef ROOT_RNTupleUtils
15#define ROOT_RNTupleUtils
16
17#include <ROOT/RError.hxx>
18
19#include <cstddef>
20#include <memory>
21#include <string_view>
22
23namespace ROOT {
24
25class RLogChannel;
26
27namespace Internal {
28
29/// Log channel for RNTuple diagnostics.
31
32template <typename T>
34{
35 const static std::shared_ptr<T> fgRawPtrCtrlBlock;
36 return std::shared_ptr<T>(fgRawPtrCtrlBlock, rawPtr);
37}
38
39/// Make an array of default-initialized elements. This is useful for buffers that do not need to be initialized.
40///
41/// With C++20, this function can be replaced by std::make_unique_for_overwrite<T[]>.
42template <typename T>
43std::unique_ptr<T[]> MakeUninitArray(std::size_t size)
44{
45 // DO NOT use std::make_unique<T[]>, the array elements are value-initialized!
46 return std::unique_ptr<T[]>(new T[size]);
47}
48
49/// Check whether a given string is a valid name according to the RNTuple specification
50RResult<void> EnsureValidNameForRNTuple(std::string_view name, std::string_view where);
51
52} // namespace Internal
53} // namespace ROOT
54
55#endif
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
char name[80]
Definition TGX11.cxx:110
A log configuration for a channel, e.g.
Definition RLogger.hxx:98
RResult< void > EnsureValidNameForRNTuple(std::string_view name, std::string_view where)
Check whether a given string is a valid name according to the RNTuple specification.
ROOT::RLogChannel & NTupleLog()
Log channel for RNTuple diagnostics.
std::unique_ptr< T[]> MakeUninitArray(std::size_t size)
Make an array of default-initialized elements.
auto MakeAliasedSharedPtr(T *rawPtr)
Namespace for new ROOT classes and functions.