105 Warning(
"DeleteArray",
"Cannot properly delete emulated array of %s at %p, I don't know how many elements it has!",
fClass->
GetName(), p);
123 std::vector<std::string> inside;
128 if ( inside[0].find(
"stdext::hash_") != std::string::npos ) {
129 inside[0].replace(3,10,
"::");
131 if ( inside[0].find(
"__gnu_cxx::hash_") != std::string::npos ) {
132 inside[0].replace(0,16,
"std::");
139 auto alignedSize = [](
size_t in) {
140 constexpr
size_t kSizeOfPtr =
sizeof(
void*);
141 return in + (kSizeOfPtr - in%kSizeOfPtr)%kSizeOfPtr;
146 nam =
"pair<"+inside[1]+
","+inside[2];
147 nam += (nam[nam.length()-1]==
'>') ?
" >" :
">";
168 if (num > 3 && !inside[3].empty()) {
188 if (num > 2 && !inside[2].empty()) {
202 Fatal(
"TEmulatedCollectionProxy",
"Components of %s not analysed!",cl->
GetName());
204 Fatal(
"TEmulatedCollectionProxy",
"Collection class %s not found!",
fTypeinfo.name());
221 Fatal(
"TEmulatedCollectionProxy",
"Size> Logic error - no proxy object set.");
228 Resize(0, opt && *opt==
'f');
235 typedef std::string String_t;
255 for( i=left; i<nCurr; ++i, addr +=
fValDiff ) {
256 ((std::string*)addr)->~String_t();
260 for( i=left; i<nCurr; ++i, addr +=
fValDiff ) {
264 void* ptr = h->
ptr();
270 for( i=nCurr; i<left; ++i, addr +=
fValDiff ) {
274 if (force)
delete (std::string*)h->
ptr();
279 for( i=nCurr; i<left; ++i, addr +=
fValDiff ) {
296 for( i=left; i<nCurr; ++i, addr +=
fValDiff ) {
302 for( i=left; i<nCurr; ++i, addr +=
fValDiff )
303 ((std::string*)addr)->~String_t();
306 for( i=left; i<nCurr; ++i, addr +=
fValDiff ) {
316 for( i=nCurr; i<left; ++i, addr +=
fValDiff ) {
318 if (force)
delete (std::string*)h->
ptr();
323 for( i=nCurr; i<left; ++i, addr +=
fValDiff ) {
345 char* addr = ((
char*)
fEnv->
fStart) + fValDiff*nCurr;
356 for( i=0; i<=nCurr; ++i, offset +=
fValDiff ) {
363 for( i=nCurr; i<left; ++i, addr +=
fValDiff )
367 for( i=nCurr; i<left; ++i, addr +=
fValDiff )
368 ::
new(addr) std::string();
373 for( i=nCurr; i<left; ++i, addr +=
fValDiff )
389 for( i=0; i<=nCurr; ++i, offset +=
fValDiff ) {
396 for( i=nCurr; i<left; ++i, addr +=
fValDiff ) {
401 for( i=nCurr; i<left; ++i, addr +=
fValDiff )
402 ::
new(addr) std::string();
407 for( i=nCurr; i<left; ++i, addr +=
fValDiff )
420 size_t nCurr =
Size();
423 if ( left == nCurr ) {
426 else if ( left < nCurr ) {
427 Shrink(nCurr, left, force);
433 Fatal(
"TEmulatedCollectionProxy",
"Resize> Logic error - no proxy object set.");
441 size_t s = c->size();
447 Fatal(
"TEmulatedCollectionProxy",
"At> Logic error - no proxy object set.");
465 Fatal(
"Insert",
"Not yet implemented, require copy of objects.");
499 Error(
"TEmulatedCollectionProxy",
"fType %d is not supported yet!\n",
fVal->
fKind);
503 #define DOLOOP(x) {int idx=0; while(idx<nElements) {StreamHelper* i=(StreamHelper*)(((char*)itm) + fValDiff*idx); { x ;} ++idx;} break;} 508 DOLOOP( i->read_std_string(b) );
512 DOLOOP( i->read_std_string_pointer(b) );
514 DOLOOP( i->read_tstring_pointer(vsn3,b) );
548 Error(
"TEmulatedCollectionProxy",
"fType %d is not supported yet!\n",
fVal->
fKind);
551 #define DOLOOP(x) {int idx=0; while(idx<nElements) {StreamHelper* i=(StreamHelper*)(((char*)itm) + fValDiff*idx); { x ;} ++idx;} break;} 559 DOLOOP( i->write_std_string_pointer(b) );
561 DOLOOP( i->write_tstring_pointer(b) );
584 if ( nElements > 0 ) {
598 if ( nElements > 0 ) {
605 if ( nElements > 0 ) {
620 Bool_t dmIsPtr = (s1 != dmType);
621 const char *dmTitle =
"Emulation";
624 if (dt && dt->
GetType() > 0 ) {
629 Error(
"Pair Emulation Building",
"%s is not yet supported in pair emulation",
639 static const char *full_string_name =
"basic_string<char,char_traits<char>,allocator<char> >";
640 if (strcmp(dmType,
"string") == 0 || strcmp(dmType,
"std::string") == 0 || strcmp(dmType,full_string_name)==0 ) {
644 return new TStreamerSTL(dmName,dmTitle,offset,dmFull,dmFull,dmIsPtr);
680 std::string pname =
"pair<"+fname+
","+sname;
681 pname += (pname[pname.length()-1]==
'>') ?
" >" :
">";
691 Int_t sp =
sizeof(
void *);
693 if (size%sp != 0) size = size - size%sp + sp;
virtual UInt_t Size() const
Return the current size of the container.
Describe Streamer information for one class version.
virtual const char * GetName() const
Returns name of object.
void Expand(UInt_t nCurr, UInt_t left)
virtual void WriteFastArrayFloat16(const Float_t *f, Int_t n, TStreamerElement *ele=0)=0
ROOT::ESTLType IsSTLCont(std::string_view type)
type : type name: vector<list<classA,allocator>,allocator> result: 0 : not stl container code of cont...
R__EXTERN Int_t gErrorIgnoreLevel
UInt_t fProperties
Additional properties of the value type (kNeedDelete)
virtual void Destructor(void *p, Bool_t dtorOnly=kFALSE) const
void Fatal(const char *location, const char *msgfmt,...)
virtual void SetSize(Int_t dsize)
Bool_t fPointers
Flag to indicate if containee has pointers (key or value)
std::string fName
Name of the class being proxied.
virtual void Delete(Option_t *option="")
Remove all objects from the array AND delete all heap based objects.
int GetSplit(const char *type, std::vector< std::string > &output, int &nestedLoc, EModType mode=TClassEdit::kNone)
Stores in output (after emptying it) the split type.
static TStreamerElement * R__CreateEmulatedElement(const char *dmName, const char *dmFull, Int_t offset)
R__EXTERN TVirtualMutex * gInterpreterMutex
std::vector< char > Cont_t
virtual void SetName(const char *name)
Set the name of the TNamed.
TVirtualStreamerInfo * GetStreamerInfo(Int_t version=0) const
returns a pointer to the TVirtualStreamerInfo object for version If the object does not exist...
bool IsDefAlloc(const char *alloc, const char *classname)
return whether or not 'allocname' is the STL default allocator for type 'classname' ...
Buffer base class used for serializing objects.
UInt_t fCase
type of data of Value_type
virtual Int_t WriteObjectAny(const void *obj, const TClass *ptrClass, Bool_t cacheReuse=kTRUE)=0
Streamer around an arbitrary STL like container, which implements basic container functionality...
virtual TVirtualStreamerInfo * GetInfo()=0
size_t fSize
fSize of the contained object
void Move(void *arenaFrom, void *arenaTo) const
Register the fact that an object was moved from the memory location 'arenaFrom' to the memory locatio...
TEmulatedCollectionProxy(const TEmulatedCollectionProxy ©)
ROOT::ESTLType STLKind(std::string_view type)
Converts STL container name to number.
void SetClass(TClass *cl)
virtual void * Allocate(UInt_t n, Bool_t forceDelete)
Allocate the needed space.
Method0 fCreateEnv
Method to allocate an Environment holder.
void Error(const char *location, const char *msgfmt,...)
static constexpr double second
EDataType fKind
kind of ROOT-fundamental type
virtual void Resize(UInt_t n, Bool_t force_delete)
Resize the container.
virtual ~TEmulatedCollectionProxy()
int fValOffset
Offset from key to value (in maps)
TGenCollectionProxy * Initialize(Bool_t silent) const
Proxy initializer.
virtual TVirtualCollectionProxy * Generate() const
Virtual copy constructor.
void BuildOld()
rebuild the TStreamerInfo structure
virtual void ReadFastArrayDouble32(Double_t *d, Int_t n, TStreamerElement *ele=0)=0
int fSTL_type
STL container type.
Basic data type descriptor (datatype information is obtained from CINT).
virtual void Clear(const char *opt="")
Clear the emulated collection.
void Destructor(void *obj, Bool_t dtorOnly=kFALSE)
Explicitly call destructor for object.
virtual void ReadFastArrayFloat16(Float_t *f, Int_t n, TStreamerElement *ele=0)=0
virtual TGenCollectionProxy * InitializeEx(Bool_t silent)
Proxy initializer.
The ROOT global object gROOT contains a list of all defined classes.
void Warning(const char *location, const char *msgfmt,...)
void WriteItems(int nElements, TBuffer &b)
virtual void ReadFastArray(Bool_t *b, Int_t n)=0
virtual void WriteFastArray(const Bool_t *b, Int_t n)=0
int fValDiff
Offset between two consecutive value_types (memory layout).
virtual void StreamObject(void *obj, const std::type_info &typeinfo, const TClass *onFileClass=0)=0
virtual void Commit(void *env)
Commit the change.
virtual Int_t GetSize() const
Returns size of this element in bytes.
virtual void Insert(const void *data, void *container, size_t size)
Insert data into the container where data is a C-style array of the actual type contained in the coll...
static constexpr double s
void Shrink(UInt_t nCurr, UInt_t left, Bool_t force)
#define R__LOCKGUARD(mutex)
virtual Version_t GetOldVersion() const =0
static TClass * GetClass(const char *name, Bool_t load=kTRUE, Bool_t silent=kFALSE)
Static method returning pointer to TClass of the specified class name.
std::atomic< Value * > fValue
Descriptor of the container value type.
TClassRef fType
TClass reference of Value_type in collection.
virtual void SetOnFileClass(TClass *cl)
static TStreamerInfo * R__GenerateTClassForPair(const std::string &f, const std::string &s)
virtual TObject * Clone(const char *newname="") const
Make a clone of an object using the Streamer facility.
TObjArray * GetElements() const
Bool_t IsTObject() const
Return kTRUE is the class inherits from TObject.
Value * fKey
Descriptor of the key_type.
void ReadItems(int nElements, TBuffer &b)
void BuildCheck(TFile *file=0)
Check if built and consistent with the class dictionary.
virtual void DeleteArray(void *p, Bool_t dtorOnly=kFALSE) const
Helper class to facilitate I/O.
Proxy around an arbitrary container, which implements basic functionality and iteration.
Int_t Size() const
Get size of basic typedef'ed type.
EnvironBase_t * fEnv
Address of the currently proxied object.
std::string ShortType(const char *typeDesc, int mode)
Return the absolute type of typeDesc.
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
virtual void * At(UInt_t idx)
Return the address of the value at index 'idx'.
Bool_t IsValid()
Return true if the Value has been properly initialized.
virtual void ReadBuffer(TBuffer &buff, void *pObj)
Info_t fTypeinfo
Type information.
virtual void Streamer(TBuffer &refBuffer)
Streamer Function.
virtual void WriteFastArrayDouble32(const Double_t *d, Int_t n, TStreamerElement *ele=0)=0
Value * fVal
Descriptor of the Value_type.
void * New(ENewType defConstructor=kClassNew, Bool_t quiet=kFALSE) const
Return a pointer to a newly allocated object of this class.