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 int slong =
sizeof(
void*);
143 nam =
"pair<"+inside[1]+
","+inside[2];
144 nam += (nam[nam.length()-1]==
'>') ?
" >" :
">";
193 Fatal(
"TEmulatedCollectionProxy",
"Components of %s not analysed!",cl->
GetName());
195 Fatal(
"TEmulatedCollectionProxy",
"Collection class %s not found!",
fTypeinfo.name());
212 Fatal(
"TEmulatedCollectionProxy",
"Size> Logic error - no proxy object set.");
219 Resize(0, opt && *opt==
'f');
226 typedef std::string String_t;
246 for( i=left; i<nCurr; ++i, addr +=
fValDiff ) {
247 ((std::string*)addr)->~String_t();
251 for( i=left; i<nCurr; ++i, addr +=
fValDiff ) {
255 void* ptr = h->
ptr();
261 for( i=nCurr; i<left; ++i, addr +=
fValDiff ) {
265 if (force)
delete (std::string*)h->
ptr();
270 for( i=nCurr; i<left; ++i, addr +=
fValDiff ) {
287 for( i=left; i<nCurr; ++i, addr +=
fValDiff ) {
293 for( i=left; i<nCurr; ++i, addr +=
fValDiff )
294 ((std::string*)addr)->~String_t();
297 for( i=left; i<nCurr; ++i, addr +=
fValDiff ) {
307 for( i=nCurr; i<left; ++i, addr +=
fValDiff ) {
309 if (force)
delete (std::string*)h->
ptr();
314 for( i=nCurr; i<left; ++i, addr +=
fValDiff ) {
336 char* addr = ((
char*)
fEnv->
fStart) + fValDiff*nCurr;
347 for( i=0; i<=nCurr; ++i, offset +=
fValDiff ) {
354 for( i=nCurr; i<left; ++i, addr +=
fValDiff )
358 for( i=nCurr; i<left; ++i, addr +=
fValDiff )
359 ::
new(addr) std::string();
364 for( i=nCurr; i<left; ++i, addr +=
fValDiff )
380 for( i=0; i<=nCurr; ++i, offset +=
fValDiff ) {
387 for( i=nCurr; i<left; ++i, addr +=
fValDiff ) {
392 for( i=nCurr; i<left; ++i, addr +=
fValDiff )
393 ::
new(addr) std::string();
398 for( i=nCurr; i<left; ++i, addr +=
fValDiff )
411 size_t nCurr =
Size();
414 if ( left == nCurr ) {
417 else if ( left < nCurr ) {
418 Shrink(nCurr, left, force);
424 Fatal(
"TEmulatedCollectionProxy",
"Resize> Logic error - no proxy object set.");
432 size_t s = c->size();
438 Fatal(
"TEmulatedCollectionProxy",
"At> Logic error - no proxy object set.");
456 Fatal(
"Insert",
"Not yet implemented, require copy of objects.");
491 Error(
"TEmulatedCollectionProxy",
"fType %d is not supported yet!\n",
fVal->
fKind);
495 #define DOLOOP(x) {int idx=0; while(idx<nElements) {StreamHelper* i=(StreamHelper*)(((char*)itm) + fValDiff*idx); { x ;} ++idx;} break;}
500 DOLOOP( i->read_std_string(b) );
504 DOLOOP( i->read_std_string_pointer(b) );
506 DOLOOP( i->read_tstring_pointer(vsn3,b) );
541 Error(
"TEmulatedCollectionProxy",
"fType %d is not supported yet!\n",
fVal->
fKind);
544 #define DOLOOP(x) {int idx=0; while(idx<nElements) {StreamHelper* i=(StreamHelper*)(((char*)itm) + fValDiff*idx); { x ;} ++idx;} break;}
552 DOLOOP( i->write_std_string_pointer(b) );
554 DOLOOP( i->write_tstring_pointer(b) );
577 if ( nElements > 0 ) {
591 if ( nElements > 0 ) {
598 if ( nElements > 0 ) {
613 Bool_t dmIsPtr = (s1 != dmType);
614 const char *dmTitle =
"Emulation";
617 if (dt && dt->
GetType() > 0 ) {
622 Error(
"Pair Emulation Building",
"%s is not yet supported in pair emulation",
632 static const char *full_string_name =
"basic_string<char,char_traits<char>,allocator<char> >";
633 if (strcmp(dmType,
"string") == 0 || strcmp(dmType,
"std::string") == 0 || strcmp(dmType,full_string_name)==0 ) {
637 return new TStreamerSTL(dmName,dmTitle,offset,dmFull,dmFull,dmIsPtr);
674 pname += (pname[pname.length()-1]==
'>') ?
" >" :
">";
684 Int_t sp =
sizeof(
void *);
686 if (size%sp != 0) size = size - size%sp + sp;
Describe Streamer information for one class version.
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)
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)
TGenCollectionProxy * Initialize(Bool_t silent) const
Proxy initializer.
virtual void StreamObject(void *obj, const type_info &typeinfo, const TClass *onFileClass=0)=0
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 splited type.
static TStreamerElement * R__CreateEmulatedElement(const char *dmName, const char *dmFull, Int_t offset)
R__EXTERN TVirtualMutex * gInterpreterMutex
std::vector< char > Cont_t
virtual Int_t WriteObjectAny(const void *obj, const TClass *ptrClass)=0
virtual void SetName(const char *name)
Change (i.e.
Bool_t IsTObject() const
Return kTRUE is the class inherits from TObject.
Buffer base class used for serializing objects.
virtual Int_t GetSize() const
Returns size of this element in bytes.
UInt_t fCase
type of data of Value_type
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 ©)
UChar_t mod R__LOCKGUARD2(gSrvAuthenticateMutex)
void * New(ENewType defConstructor=kClassNew, Bool_t quiet=kFALSE) const
Return a pointer to a newly allocated object of this class.
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.
virtual TObject * Clone(const char *newname="") const
Make a clone of an object using the Streamer facility.
Method0 fCreateEnv
Method to allocate an Environment holder.
void Error(const char *location, const char *msgfmt,...)
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)
TObjArray * GetElements() const
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.
TVirtualStreamerInfo * GetStreamerInfo(Int_t version=0) const
returns a pointer to the TVirtualStreamerInfo object for version If the object does not exist...
Basic data type descriptor (datatype information is obtained from CINT).
virtual void Clear(const char *opt="")
Clear the emulated collection.
virtual TVirtualCollectionProxy * Generate() const
Virtual copy constructor.
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.
virtual const char * GetName() const
Returns name of object.
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 Commit(void *env)
Commit the change.
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...
void Shrink(UInt_t nCurr, UInt_t left, Bool_t force)
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)
Int_t Size() const
Get size of basic typedef'ed type.
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.
Helper class to facilitate I/O.
Proxy around an arbitrary container, which implements basic functionality and iteration.
EnvironBase_t * fEnv
Address of the currently proxied object.
virtual UInt_t Size() const
Return the current size of the container.
std::string ShortType(const char *typeDesc, int mode)
Return the absolute type of typeDesc.
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 Destructor(void *p, Bool_t dtorOnly=kFALSE) const
virtual void Streamer(TBuffer &refBuffer)
Streamer Function.
virtual void DeleteArray(void *p, Bool_t dtorOnly=kFALSE) const
virtual void WriteFastArrayDouble32(const Double_t *d, Int_t n, TStreamerElement *ele=0)=0
Value * fVal
Descriptor of the Value_type.