11#ifndef ROOT_TEmulatedCollectionProxy
12#define ROOT_TEmulatedCollectionProxy
28 using Cont1_t = std::vector<ROOT::Internal::RAlignedStorage< 1>>;
29 using Cont2_t = std::vector<ROOT::Internal::RAlignedStorage< 2>>;
30 using Cont4_t = std::vector<ROOT::Internal::RAlignedStorage< 4>>;
31 using Cont8_t = std::vector<ROOT::Internal::RAlignedStorage< 8>>;
32 using Cont16_t = std::vector<ROOT::Internal::RAlignedStorage< 16>>;
33 using Cont32_t = std::vector<ROOT::Internal::RAlignedStorage< 32>>;
34 using Cont64_t = std::vector<ROOT::Internal::RAlignedStorage< 64>>;
35 using Cont128_t = std::vector<ROOT::Internal::RAlignedStorage< 128>>;
36 using Cont256_t = std::vector<ROOT::Internal::RAlignedStorage< 256>>;
37 using Cont512_t = std::vector<ROOT::Internal::RAlignedStorage< 512>>;
38 using Cont1024_t = std::vector<ROOT::Internal::RAlignedStorage<1024>>;
39 using Cont2048_t = std::vector<ROOT::Internal::RAlignedStorage<2048>>;
40 using Cont4096_t = std::vector<ROOT::Internal::RAlignedStorage<4096>>;
56 std::size_t align =
alignof(std::max_align_t);
59 align =
alignof(
void*);
62 align =
vcl->GetClassAlignment();
66 case kUChar_t: align =
alignof(char);
break;
68 case kUShort_t: align =
alignof(short);
break;
72 case kULong_t: align =
alignof(long);
break;
74 case kULong64_t:align =
alignof(
long long);
break;
76 case kFloat_t: align =
alignof(float);
break;
80 Fatal(
"TEmulatedCollectionProxy::WithCont",
"Unsupported value type %d for value class %s",
fVal->
fKind,
81 vcl ?
vcl->GetName() :
"<unknown>");
87 case 4096:
fn(
reinterpret_cast<Cont4096_t*
>(obj), std::size_t(4096));
break;
88 case 2048:
fn(
reinterpret_cast<Cont2048_t*
>(obj), std::size_t(2048));
break;
89 case 1024:
fn(
reinterpret_cast<Cont1024_t*
>(obj), std::size_t(1024));
break;
90 case 512:
fn(
reinterpret_cast<Cont512_t *
>(obj), std::size_t( 512));
break;
91 case 256:
fn(
reinterpret_cast<Cont256_t *
>(obj), std::size_t( 256));
break;
92 case 128:
fn(
reinterpret_cast<Cont128_t *
>(obj), std::size_t( 128));
break;
93 case 64:
fn(
reinterpret_cast<Cont64_t *
>(obj), std::size_t( 64));
break;
94 case 32:
fn(
reinterpret_cast<Cont32_t *
>(obj), std::size_t( 32));
break;
95 case 16:
fn(
reinterpret_cast<Cont16_t *
>(obj), std::size_t( 16));
break;
96 case 8:
fn(
reinterpret_cast<Cont8_t *
>(obj), std::size_t( 8));
break;
97 case 4:
fn(
reinterpret_cast<Cont4_t *
>(obj), std::size_t( 4));
break;
98 case 2:
fn(
reinterpret_cast<Cont2_t *
>(obj), std::size_t( 2));
break;
99 case 1:
fn(
reinterpret_cast<Cont1_t *
>(obj), std::size_t( 1));
break;
101 Fatal(
"TEmulatedCollectionProxy::WithCont",
"Unsupported alignment %zu for value class %s",
102 align,
vcl ?
vcl->GetName() :
"<unknown>");
139 void *
New()
const override
142 WithCont(
mem, [](
auto *
c, std::size_t) {
new (
c) std::decay_t<
decltype(*
c)>(); });
149 WithCont(
memory, [](
auto *
c, std::size_t) {
new (
c) std::decay_t<
decltype(*
c)>(); });
165 [](
auto *
c, std::size_t) {
new (
c) std::decay_t<
decltype(*
c)>(); });
174 [](
auto *
c, std::size_t) {
new (
c) std::decay_t<
decltype(*
c)>(); });
200 void Clear(
const char *opt =
"")
override;
240 "The class requested (%s) for the branch \"%s\" "
241 "is an instance of an stl collection and does not have a compiled CollectionProxy. "
242 "Please generate the dictionary for this collection (%s) to avoid writing corrupted data.";
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
bool Bool_t
Boolean (0=false, 1=true) (bool)
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int)
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
void Fatal(const char *location, const char *msgfmt,...)
Use this function in case of a fatal error. It will abort the program.
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
Buffer base class used for serializing objects.
TClass instances represent classes, structs and namespaces in the ROOT type system.
TVirtualCollectionProxy * GetCollectionProxy() const
Return the proxy describing the collection (if any).
Streamer around an arbitrary STL like container, which implements basic container functionality.
TEmulatedCollectionProxy & operator=(const TEmulatedCollectionProxy &)
UInt_t Size() const override
Return the current number of elements in the container.
void Insert(const void *data, void *container, size_t size) override
Insert data into the container where data is a C-style array of the actual type contained in the coll...
TGenCollectionProxy * InitializeEx(Bool_t silent) override
Proxy initializer.
void * Allocate(UInt_t n, Bool_t forceDelete) override
Allocates space for storing at least n elements.
TClass::ObjectPtr NewObjectArray(Int_t nElements) const override
Construct an array of nElements container objects and return the base address of the array.
std::vector< ROOT::Internal::RAlignedStorage< 2048 > > Cont2048_t
void * NewArray(Int_t nElements) const override
Construct an array of nElements container objects and return the base address of the array.
std::vector< ROOT::Internal::RAlignedStorage< 128 > > Cont128_t
friend class TCollectionProxy
void Expand(UInt_t nCurr, UInt_t left)
std::vector< ROOT::Internal::RAlignedStorage< 64 > > Cont64_t
TClass::ObjectPtr NewObject() const override
Construct a new container object and return its address.
std::vector< ROOT::Internal::RAlignedStorage< 256 > > Cont256_t
void * New() const override
Construct a new container object and return its address.
void WriteItems(int nElements, TBuffer &b)
void * New(void *memory) const override
Construct a new container object at the address given by arena
TClass::ObjectPtr NewObject(void *memory) const override
Construct a new container object at the address given by arena
TVirtualCollectionProxy * Generate() const override
Returns a clean object of the actual class that derives from TVirtualCollectionProxy.
std::vector< char > Cont_t
std::vector< ROOT::Internal::RAlignedStorage< 1 > > Cont1_t
void Commit(void *env) override
Commits pending elements in a staging area (see Allocate() for more information).
std::vector< ROOT::Internal::RAlignedStorage< 1024 > > Cont1024_t
std::vector< ROOT::Internal::RAlignedStorage< 4 > > Cont4_t
~TEmulatedCollectionProxy() override
std::vector< ROOT::Internal::RAlignedStorage< 32 > > Cont32_t
void Streamer(TBuffer &buff, void *pObj, int siz) override
Streamer I/O overload.
std::vector< ROOT::Internal::RAlignedStorage< 16 > > Cont16_t
void Clear(const char *opt="") override
Clear the container.
std::vector< ROOT::Internal::RAlignedStorage< 8 > > Cont8_t
void * NewArray(Int_t nElements, void *memory) const override
Construct an array of nElements container objects at the address given by arena
std::vector< ROOT::Internal::RAlignedStorage< 4096 > > Cont4096_t
void Shrink(UInt_t nCurr, UInt_t left, Bool_t force)
std::vector< ROOT::Internal::RAlignedStorage< 512 > > Cont512_t
void * At(UInt_t idx) override
Return the address of the value at index idx
void ReadItems(int nElements, TBuffer &b)
std::vector< ROOT::Internal::RAlignedStorage< 2 > > Cont2_t
void WithCont(void *obj, F &&fn) const
Invoke fn(typed_ptr, elemSize) where typed_ptr is the container pointer cast to the correct AlignedSt...
TClass::ObjectPtr NewObjectArray(Int_t nElements, void *memory) const override
Construct an array of nElements container objects at the address given by arena
void Destructor(void *p, Bool_t dtorOnly=kFALSE) const override
Execute the container destructor.
void ReadBuffer(TBuffer &buff, void *pObj) override
void Streamer(TBuffer &refBuffer) override
Streamer Function.
void DeleteArray(void *p, Bool_t dtorOnly=kFALSE) const override
Execute the container array destructor.
TEmulatedCollectionProxy(const TEmulatedCollectionProxy ©)
UInt_t Sizeof() const override
Return the sizeof() of the collection object.
void Resize(UInt_t n, Bool_t force_delete) override
Resize the container.
Proxy around an arbitrary container, which implements basic functionality and iteration.
virtual void Streamer(TBuffer &refBuffer)
Streamer Function.
TClass * GetValueClass() const override
Return a pointer to the TClass representing the content.
Value * fKey
Descriptor of the key_type.
Value * fVal
Descriptor of the Value_type.
Defines a common interface to inspect/change the contents of an object that represents a collection.
bool HasEmulatedProxy(TClass *cl)
void PrintWriteStlWithoutProxyMsg(const char *where, const char *clName, const char *BranchName)
constexpr bool IsValidAlignment(std::size_t align) noexcept
Return true if align is a valid C++ alignment value: strictly positive and a power of two.
UInt_t fCase
type of data of Value_type
EDataType fKind
kind of ROOT-fundamental type