16#ifndef ROOT7_RField_ProxiedCollection
17#define ROOT7_RField_ProxiedCollection
20#error "Please include RField.hxx!"
34#include <unordered_map>
35#include <unordered_set>
39namespace Experimental {
75 auto fnNext_Contig = [&]() {
78 auto &iter =
reinterpret_cast<unsigned char *&
>(
fIterator),
p = iter;
115 std::size_t stride = 0U)
128 std::shared_ptr<TVirtualCollectionProxy>
fProxy;
141 void operator()(
void *objPtr,
bool dtorOnly)
final;
145 std::shared_ptr<TVirtualCollectionProxy>
fProxy;
160 std::unique_ptr<RFieldBase> itemField);
163 std::unique_ptr<RFieldBase>
CloneImpl(std::string_view newName)
const final;
171 std::
size_t AppendImpl(const
void *from) final;
184 size_t GetAlignment() const final {
return alignof(std::max_align_t); }
200template <
typename T,
typename =
void>
205 T, typename std::enable_if<std::is_same<typename T::IsCollectionProxy, std::true_type>::value>
::type>
246template <
typename T,
typename =
void>
270 static_assert(std::is_class<T>::value,
"collection proxy unsupported for fundamental types");
284 RMapField(std::string_view fieldName, std::string_view typeName, std::unique_ptr<RFieldBase> itemField);
290template <
typename KeyT,
typename ValueT>
299 : RMapField(
name,
TypeName(), std::make_unique<
RField<std::pair<KeyT, ValueT>>>(
"_0"))
307template <typename KeyT, typename ValueT>
308class
RField<std::unordered_map<KeyT, ValueT>> final : public RMapField {
316 : RMapField(
name,
TypeName(), std::make_unique<
RField<std::pair<KeyT, ValueT>>>(
"_0"))
324template <typename KeyT, typename ValueT>
325class
RField<std::multimap<KeyT, ValueT>> final : public RMapField {
333 : RMapField(
name,
TypeName(), std::make_unique<
RField<std::pair<KeyT, ValueT>>>(
"_0"))
341template <typename KeyT, typename ValueT>
342class
RField<std::unordered_multimap<KeyT, ValueT>> final : public RMapField {
350 : RMapField(
name,
TypeName(), std::make_unique<
RField<std::pair<KeyT, ValueT>>>(
"_0"))
365 RSetField(std::string_view fieldName, std::string_view typeName, std::unique_ptr<RFieldBase> itemField);
371template <
typename ItemT>
382template <typename ItemT>
383class
RField<std::unordered_set<ItemT>> final : public RSetField {
393template <typename ItemT>
394class
RField<std::multiset<ItemT>> final : public RSetField {
404template <typename ItemT>
405class
RField<std::unordered_multiset<ItemT>> final : public RSetField {
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
Abstract base class for classes implementing the visitor design pattern.
void GetCollectionInfo(const NTupleSize_t globalIndex, RClusterIndex *collectionStart, ClusterSize_t *collectionSize)
For offset columns only, look at the two adjacent values that define a collection's coordinates.
Addresses a column element or field item relative to a particular cluster, instead of a global NTuple...
Some fields have multiple possible column representations, e.g.
A functor to release the memory acquired by CreateValue (memory and constructor).
Points to an object with RNTuple I/O support and keeps a pointer to the corresponding field.
A field translates read and write calls from/to underlying columns to/from tree values.
Internal::RColumn * fPrincipalColumn
All fields that have columns have a distinct main column.
Classes with dictionaries that can be inspected by TClass.
RField & operator=(RField &&other)=default
static std::string TypeName()
Template specializations for C++ std::[unordered_][multi]map.
RMapField(RMapField &&other)=default
~RMapField() override=default
RMapField & operator=(RMapField &&other)=default
The on-storage meta-data of an ntuple.
pointer operator*() const
bool operator==(const iterator &rh) const
RIterator(const RCollectionIterableOnce &owner)
bool operator!=(const iterator &rh) const
std::forward_iterator_tag iterator_category
const RCollectionIterableOnce & fOwner
RIterator(const RCollectionIterableOnce &owner, void *iter)
std::ptrdiff_t difference_type
Allows for iterating over the elements of a proxied collection.
unsigned char fEndSmallBuf[TVirtualCollectionProxy::fgIteratorArenaSize]
unsigned char fBeginSmallBuf[TVirtualCollectionProxy::fgIteratorArenaSize]
const RIteratorFuncs & fIFuncs
const std::size_t fStride
~RCollectionIterableOnce()
static RIteratorFuncs GetIteratorFuncs(TVirtualCollectionProxy *proxy, bool readFromDisk)
RCollectionIterableOnce(void *collection, const RIteratorFuncs &ifuncs, TVirtualCollectionProxy *proxy, std::size_t stride=0U)
Construct a RCollectionIterableOnce that iterates over collection.
RProxiedCollectionDeleter(std::shared_ptr< TVirtualCollectionProxy > proxy, std::unique_ptr< RDeleter > itemDeleter, size_t itemSize)
void operator()(void *objPtr, bool dtorOnly) final
std::shared_ptr< TVirtualCollectionProxy > fProxy
std::unique_ptr< RDeleter > fItemDeleter
RCollectionIterableOnce::RIteratorFuncs fIFuncsWrite
RProxiedCollectionDeleter(std::shared_ptr< TVirtualCollectionProxy > proxy)
The field for a class representing a collection of elements via TVirtualCollectionProxy.
size_t GetValueSize() const final
The number of bytes taken by a value of the appropriate type.
size_t GetAlignment() const final
As a rule of thumb, the alignment is equal to the size of the type.
void CommitClusterImpl() final
std::size_t AppendImpl(const void *from) final
Operations on values of complex types, e.g.
void GetCollectionInfo(RClusterIndex clusterIndex, RClusterIndex *collectionStart, ClusterSize_t *size) const
std::shared_ptr< TVirtualCollectionProxy > fProxy
The collection proxy is needed by the deleters and thus defined as a shared pointer.
RCollectionIterableOnce::RIteratorFuncs fIFuncsRead
Two sets of functions to operate on iterators, to be used depending on the access type.
void AcceptVisitor(Detail::RFieldVisitor &visitor) const final
void ReadGlobalImpl(NTupleSize_t globalIndex, void *to) final
std::unique_ptr< RDeleter > GetDeleter() const final
const RColumnRepresentations & GetColumnRepresentations() const final
Implementations in derived classes should return a static RColumnRepresentations object.
std::unique_ptr< RFieldBase > CloneImpl(std::string_view newName) const final
Called by Clone(), which additionally copies the on-disk ID.
RProxiedCollectionField(RProxiedCollectionField &&other)=default
void GetCollectionInfo(NTupleSize_t globalIndex, RClusterIndex *collectionStart, ClusterSize_t *size) const
~RProxiedCollectionField() override=default
void GenerateColumns() final
Implementations in derived classes should create the backing columns corresponsing to the field type ...
RCollectionIterableOnce::RIteratorFuncs fIFuncsWrite
void ConstructValue(void *where) const final
Constructs value in a given location of size at least GetValueSize(). Called by the base class' Creat...
std::vector< RValue > SplitValue(const RValue &value) const final
Creates the list of direct child values given a value for this field.
RProxiedCollectionField & operator=(RProxiedCollectionField &&other)=default
Template specializations for C++ std::[unordered_][multi]set.
RSetField(RSetField &&other)=default
RSetField & operator=(RSetField &&other)=default
~RSetField() override=default
TClass instances represent classes, structs and namespaces in the ROOT type system.
Defines a common interface to inspect/change the contents of an object that represents a collection.
void(* CreateIterators_t)(void *collection, void **begin_arena, void **end_arena, TVirtualCollectionProxy *proxy)
*begin_arena and *end_arena should contain the location of a memory arena of size fgIteratorArenaSize...
void *(* Next_t)(void *iter, const void *end)
iter and end should be pointers to an iterator to be incremented and an iterator that points to the e...
void(* DeleteTwoIterators_t)(void *begin, void *end)
static const Int_t fgIteratorArenaSize
The size of a small buffer that can be allocated on the stack to store iterator-specific information.
std::uint64_t NTupleSize_t
Integer type long enough to hold the maximum number of entries in a column.
std::string GetDemangledTypeName(const std::type_info &t)
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
Template specializations for classes with collection proxies.
The point here is that we can only tell at run time if a class has an associated collection proxy.
Wrap the integer in a struct in order to avoid template specialization clash with std::uint64_t.
TVirtualCollectionProxy::Next_t fNext
TVirtualCollectionProxy::DeleteTwoIterators_t fDeleteTwoIterators
TVirtualCollectionProxy::CreateIterators_t fCreateIterators