29 #define MESSAGE(which,text)
48 virtual ~TGenVectorProxy()
61 return ((
char*)fEnv->
fStart) + fValDiff*idx;
64 Fatal(
"TGenVectorProxy",
"At> Logic error - no proxy object set.");
73 TPushPop helper(proxy,ptr);
74 proxy->
Clear(
"force");
98 virtual ~TGenVectorBoolProxy()
120 typedef ROOT::TCollectionProxyInfo::Type<std::vector<Bool_t> >::Env_t EnvType_t;
121 EnvType_t *
e = (EnvType_t*)fEnv;
122 fLastValue = *(e->iter());
125 Fatal(
"TGenVectorProxy",
"At> Logic error - no proxy object set.");
132 if ( force && ptr ) {
156 virtual ~TGenBitsetProxy()
178 typedef ROOT::TCollectionProxyInfo::Environ<std::pair<size_t,Bool_t> > EnvType_t;
179 EnvType_t *
e = (EnvType_t*)fEnv;
180 return &(e->fIterator.second);
182 Fatal(
"TGenVectorProxy",
"At> Logic error - no proxy object set.");
189 if ( force && ptr ) {
205 class TGenListProxy :
public TGenVectorProxy {
212 virtual ~TGenListProxy()
232 Fatal(
"TGenListProxy",
"At> Logic error - no proxy object set.");
247 class TGenSetProxy :
public TGenVectorProxy {
254 virtual ~TGenSetProxy()
262 return (((
char*)
fEnv->
fTemp)+idx*fValDiff);
277 Fatal(
"TGenSetProxy",
"At> Logic error - no proxy object set.");
292 class TGenMapProxy :
public TGenSetProxy {
299 virtual ~TGenMapProxy()
303 virtual void DeleteItem(
Bool_t force,
void* ptr)
const
309 proxy->
Clear(
"force");
315 proxy->
Clear(
"force");
333 std::string inside = (inside_type.find(
"const ")==0) ? inside_type.substr(6) : inside_type;
339 fSize = std::string::npos;
342 if ( inside.substr(0,6) ==
"string" || inside.substr(0,11) ==
"std::string" ) {
348 switch(inside[inside.length()-1]) {
351 fSize =
sizeof(
void*);
354 fSize =
sizeof(std::string);
368 if (intype != inside) {
370 fSize =
sizeof(
void*);
387 assert(typeTable &&
"The type of the list of type has changed");
388 assert(enumTable &&
"The type of the list of enum has changed");
390 TDataType *fundType = (
TDataType *)typeTable->THashTable::FindObject( intype.c_str() );
391 if (fundType && fundType->
GetType() < 0x17 && fundType->
GetType() > 0) {
399 if (intype != inside) {
401 fSize =
sizeof(
void*);
405 }
else if (enumTable->THashList::FindObject( intype.c_str() ) ) {
410 if (intype != inside) {
412 fSize =
sizeof(
void*);
429 if (intype != inside) {
431 fSize =
sizeof(
void*);
453 fSize =
sizeof(
void*);
470 fundType =
gROOT->GetType( intype.c_str() );
472 if (intype !=
"long double") {
473 Error(
"TGenCollectionProxy",
"Unknown fundamental type %s",intype.c_str());
505 if (
fSize == std::string::npos ) {
521 return fSize != std::string::npos;
533 fType->Destructor(ptr);
536 ::operator
delete(ptr);
625 Fatal(
"TGenCollectionProxy",
626 "%s %s are too large:%ld bytes. Maximum is:%ld bytes",
627 "Iterators for collection",
647 fTypeinfo(info.fInfo), fOnFileClass(0)
676 Fatal(
"TGenCollectionProxy",
677 "%s %s are too large:%ld bytes. Maximum is:%ld bytes",
678 "Iterators for collection",
695 void clearVector(vec&
v)
699 for(
typename vec::iterator i=v.begin(); i != v.end(); ++i) {
700 typename vec::value_type
e = *i;
723 std::map<std::string, TObjArray*>::iterator it;
746 return new TGenBitsetProxy(*
this);
750 return new TGenVectorBoolProxy(*
this);
752 return new TGenVectorProxy(*
this);
757 return new TGenListProxy(*
this);
762 return new TGenMapProxy(*
this);
767 return new TGenSetProxy(*
this);
779 if (
fValue.load() )
return p;
789 Fatal(
"TGenCollectionProxy",
"No 'size' function pointer for class %s present.",
fName.c_str());
792 Fatal(
"TGenCollectionProxy",
"No 'resize' function for class %s present.",
fName.c_str());
795 Fatal(
"TGenCollectionProxy",
"No 'next' function for class %s present.",
fName.c_str());
798 Fatal(
"TGenCollectionProxy",
"No 'begin' function for class %s present.",
fName.c_str());
801 Fatal(
"TGenCollectionProxy",
"No 'clear' function for class %s present.",
fName.c_str());
804 Fatal(
"TGenCollectionProxy",
"No 'block constructor' function for class %s present.",
fName.c_str());
807 Fatal(
"TGenCollectionProxy",
"No 'block destructor' function for class %s present.",
fName.c_str());
810 Fatal(
"TGenCollectionProxy",
"No 'data feed' function for class %s present.",
fName.c_str());
813 Fatal(
"TGenCollectionProxy",
"No 'data collect' function for class %s present.",
fName.c_str());
816 Fatal(
"TGenCollectionProxy",
"No 'environment creation' function for class %s present.",
fName.c_str());
827 Fatal(
"TGenCollectionProxy",
"Could not find %s!",name.c_str());
838 if (
fValue.load())
return this;
846 std::vector<std::string> inside;
850 Value* newfValue =
nullptr;
851 if ( inside[0].find(
"stdext::hash_") != std::string::npos )
852 inside[0].replace(3,10,
"::");
853 if ( inside[0].find(
"__gnu_cxx::hash_") != std::string::npos )
854 inside[0].replace(0,16,
"std::");
870 int slong =
sizeof(
void*);
876 nam =
"pair<"+inside[1]+
","+inside[2];
877 nam += (nam[nam.length()-1]==
'>') ?
" >" :
">";
919 Fatal(
"TGenCollectionProxy",
"Components of %s not analysed!",cl->
GetName());
921 Fatal(
"TGenCollectionProxy",
"Collection class %s not found!",
fTypeinfo.name());
984 return fValue.load() ? (*fValue).fType.GetClass() : 0;
996 if (
fValue.load() && (*fValue).fType == oldValueType) {
998 (*fValue).fType = newValueType;
1008 return (*fValue).fKind;
1054 Fatal(
"TGenCollectionProxy",
"At> Logic error - no proxy object set.");
1087 Fatal(
"TGenCollectionProxy",
"Size> Logic error - no proxy object set.");
1100 for (i=n; i<nold; ++i)
1109 Fatal(
"TGenCollectionProxy",
"Resize> Logic error - no proxy object set.");
1195 fFeed((
void*)data,container,size);
1228 if ( back->
fObject == objstart ) {
1276 if ( force && ptr ) {
1285 TPushPop helper(proxy,*(
void**)ptr);
1286 proxy->
Clear(
"force");
1293 proxy->
Clear(
"force");
1300 TPushPop helper(proxy,*(
void**)addr);
1301 proxy->
Clear(
"force");
1308 proxy->
Clear(
"force");
1317 TPushPop helper(proxy,*(
void**)ptr);
1318 proxy->
Clear(
"force");
1325 proxy->
Clear(
"force");
1338 MayNotUse(
"TGenCollectionProxy::ReadBuffer(TBuffer &, void *, const TClass *)");
1345 MayNotUse(
"TGenCollectionProxy::ReadBuffer(TBuffer &, void *)");
1357 Fatal(
"TGenCollectionProxy",
"Streamer> Logic error - no proxy object set.");
1378 struct TGenCollectionProxy__SlowIterator {
1388 new (*begin_arena) TGenCollectionProxy__SlowIterator(proxy);
1396 TGenCollectionProxy__SlowIterator *iterator = (TGenCollectionProxy__SlowIterator*)iter;
1397 if (iterator->fIndex != *(
UInt_t*)end) {
1398 void *
result = iterator->fProxy->At(iterator->fIndex);
1399 ++(iterator->fIndex);
1410 *(TGenCollectionProxy__SlowIterator*)dest = *(TGenCollectionProxy__SlowIterator*)source;
1435 std::vector<char> *vec = (std::vector<char>*)obj;
1441 *begin_arena = &(*vec->begin());
1442 #ifdef R__VISUAL_CPLUSPLUS
1443 *end_arena = &(*(vec->end()-1)) + 1;
1446 *end_arena = &(*vec->end());
1464 *(
void**)dest = *(
void**)source;
1490 *end_arena = s->
GetEnd();
1506 *(
void**)dest = *(
void**)source;
1668 if (oldClass == 0) {
1674 std::map<std::string, TObjArray*>::iterator it;
1692 if (valueClass == 0) {
1706 (*fConversionReadMemberWise)[oldClass->
GetName()] = arr;
void *(* fSizeFunc)(void *)
Method fSize
Container accessors: size of container.
void(* DeleteIterator_t)(void *iter)
double read(const std::string &file_name)
reading
void *(* fNext)(void *iter, const void *end)
void * TGenCollectionProxy__StagingCopyIterator(void *dest, const void *source)
void DeleteItem(void *ptr)
DeleteIterator_t fFunctionDeleteIterator
void TGenCollectionProxy__StagingDeleteSingleIterators(void *)
Nothing to do.
ROOT::DelFunc_t fDelete
Method cache for containee delete.
void(* fDeleteTwoIterators)(void *begin, void *end)
ROOT::NewFunc_t fCtor
Method cache for containee constructor.
virtual TStreamerInfoActions::TActionSequence * GetReadMemberWiseActions(Int_t version)
Return the set of action necessary to stream in this collection member-wise coming from the old value...
virtual Int_t GetProperties() const
Proxies_t fProxyKept
Optimization: Keep proxies once they were created.
virtual TVirtualCollectionProxy * Generate() const
Virtual copy constructor.
DeleteTwoIterators_t fFunctionDeleteTwoIterators
void * invoke(void *obj) const
UInt_t fProperties
Additional properties of the value type (kNeedDelete)
void *(* fCollectFunc)(void *, void *)
void TGenCollectionProxy__VectorDeleteTwoIterators(void *, void *)
Nothing to do.
virtual void UpdateValueClass(const TClass *oldcl, TClass *newcl)
Update the internal ValueClass when a TClass constructor need to replace an emulated TClass by the re...
void Fatal(const char *location, const char *msgfmt,...)
void(* fDestructFunc)(void *, size_t)
Bool_t fPointers
Flag to indicate if containee has pointers (key or value)
std::map< std::string, TObjArray * > * fConversionReadMemberWise
Array of bundle of TStreamerInfoActions to stream out (read) derived from another class...
TGenCollectionProxy * Initialize(Bool_t silent) const
Proxy initializer.
Collectfunc_t fCollect
Method to collect objects from container.
ROOT::DesFunc_t GetDestructor() const
std::string fName
Name of the class being proxied.
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.
R__EXTERN TVirtualMutex * gInterpreterMutex
void *(* fCopyIterator)(void *dest, const void *source)
virtual TStreamerInfoActions::TActionSequence * GetWriteMemberWiseActions()
Return the set of action necessary to stream out this collection member-wise.
virtual void PopProxy()
Remove the last object.
const char * GetFullTypeName() const
Get full type description of typedef, e,g.: "class TDirectory*".
void *(* fFeedFunc)(void *, void *, size_t)
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...
Method fFirst
Container accessors: generic iteration: first.
Buffer base class used for serializing objects.
void(* fResizeFunc)(void *, size_t)
virtual TypeInfo_t * TypeInfo_Factory() const
TClass * fOnFileClass
On file class.
Feedfunc_t fFeed
Container accessors: block feed.
ROOT::NewFunc_t GetNew() const
virtual void Clear(const char *opt="")=0
#define MESSAGE(which, text)
UInt_t fCase
type of data of Value_type
virtual Bool_t HasPointers() const
Return true if the content is of type 'pointer to'.
void * TGenCollectionProxy__StagingNext(void *, const void *)
Should not be used.
virtual ULong_t GetIncrement() const
Return the offset between two consecutive value_types (memory layout).
Sizing_t fResize
Container accessors: resize container.
void *(* CopyIterator_t)(void *dest, const void *source)
static TActionSequence * CreateReadMemberWiseActions(TVirtualStreamerInfo *info, TVirtualCollectionProxy &proxy)
Create the bundle of the actions necessary for the streaming memberwise of the content described by '...
size_t fSize
fSize of the contained object
virtual int TypeInfo_Size(TypeInfo_t *) const
virtual Int_t GetCollectionType() const
Return the type of collection see TClassEdit::ESTLType.
virtual void DeleteItem(Bool_t force, void *ptr) const
Call to delete/destruct individual item.
void * TGenCollectionProxy__SlowNext(void *iter, const void *end)
void * TGenCollectionProxy__VectorNext(void *, const void *)
Should not be used.
TObjArray * fReadMemberWise
Array of bundle of TStreamerInfoActions to stream out (read)
CopyIterator_t fFunctionCopyIterator
THashTable implements a hash table to store TObject's.
void TGenCollectionProxy__SlowCreateIterators(void *, void **begin_arena, void **end_arena, TVirtualCollectionProxy *proxy)
THashList implements a hybrid collection class consisting of a hash table and a list to store TObject...
static TGenCollectionProxy::Value * R__CreateValue(const std::string &name, Bool_t silent)
Utility routine to issue a Fatal error is the Value object is not valid.
virtual CreateIterators_t GetFunctionCreateIterators(Bool_t read=kTRUE)
See typedef void (*CreateIterators_t)(void *collection, void *&begin_arena, void *&end_arena); begin_...
virtual TStreamerInfoActions::TActionSequence * GetConversionReadMemberWiseActions(TClass *oldClass, Int_t version)
Return the set of action necessary to stream in this collection member-wise coming from the old value...
virtual void TypeInfo_Delete(TypeInfo_t *) const
void TGenCollectionProxy__SlowDeleteTwoIterators(void *, void *)
Nothing to do.
virtual Bool_t TypeInfo_IsValid(TypeInfo_t *) const
void *(* fConstructFunc)(void *, size_t)
virtual UInt_t Size() const
Return the current size of the container.
ROOT::ESTLType STLKind(std::string_view type)
Converts STL container name to number.
Proxies_t fProxyList
Stack of recursive proxies.
Method fClear
Method cache for container accessors: clear container.
void *(* fNextFunc)(void *)
Method0 fCreateEnv
Method to allocate an Environment holder.
ArrIterfunc_t fConstruct
Container accessors: block construct.
virtual void Streamer(TBuffer &refBuffer)
Streamer Function.
void Error(const char *location, const char *msgfmt,...)
EDataType fKind
kind of ROOT-fundamental type
ROOT::DelFunc_t GetDelete() const
void SetTarget(void *target)
Staged_t fStaged
Optimization: Keep staged array once they were created.
void MayNotUse(const char *method)
This function can be used in classes that should override a certain function, but in the inherited cl...
void TGenCollectionProxy__StagingDeleteTwoIterators(void *, void *)
Nothing to do.
void *(* fClearFunc)(void *)
virtual EDataType GetType() const
If the content is a simple numerical value, return its type (see TDataType)
int fValOffset
Offset from key to value (in maps)
Small helper to save proxy environment in the event of recursive calls.
virtual void AddAtAndExpand(TObject *obj, Int_t idx)
Add object at position idx.
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 TypeInfo_Init(TypeInfo_t *, const char *) const
TVirtualStreamerInfo * GetConversionStreamerInfo(const char *onfile_classname, Int_t version) const
Return a Conversion StreamerInfo from the class 'classname' for version number 'version' to this clas...
virtual void Commit(void *env)
Commit the change.
static TActionSequence * CreateWriteMemberWiseActions(TVirtualStreamerInfo *info, TVirtualCollectionProxy &proxy)
Create the bundle of the actions necessary for the streaming memberwise of the content described by '...
void(* fDeleteSingleIterator)(void *iter)
void(* fCreateIterators)(void *collection, void **begin_arena, void **end_arena, TVirtualCollectionProxy *proxy)
virtual Long_t TypeInfo_Property(TypeInfo_t *) const
virtual void PushProxy(void *objstart)
Add an object.
virtual Next_t GetFunctionNext(Bool_t read=kTRUE)
See typedef void* (*Next_t)(void *iter, void *end); iter and end should be pointer to respectively an...
virtual const char * GetName() const
Returns name of object.
CreateIterators_t fFunctionCreateIterators
The ROOT global object gROOT contains a list of all defined classes.
void *(* fFirstFunc)(void *)
Next_t fFunctionNextIterator
int fValDiff
Offset between two consecutive value_types (memory layout).
void TGenCollectionProxy__SlowDeleteSingleIterators(void *)
Nothing to do.
#define R__LOCKGUARD2(mutex)
virtual void Resize(UInt_t n, Bool_t force_delete)
Resize the container.
virtual Int_t GetSize() const
virtual DeleteIterator_t GetFunctionDeleteIterator(Bool_t read=kTRUE)
See typedef void (*DeleteIterator_t)(void *iter); If the sizeof iterator is greater than fgIteratorAr...
virtual DeleteTwoIterators_t GetFunctionDeleteTwoIterators(Bool_t read=kTRUE)
See typedef void (*DeleteTwoIterators_t)(void *begin, void *end); If the sizeof iterator is greater t...
virtual TGenCollectionProxy * InitializeEx(Bool_t silent)
Proxy initializer.
void(* CreateIterators_t)(void *collection, void **begin_arena, void **end_arena, TVirtualCollectionProxy *proxy)
void *(* Next_t)(void *iter, const void *end)
void TGenCollectionProxy__StagingCreateIterators(void *obj, void **begin_arena, void **end_arena, TVirtualCollectionProxy *)
you should not use this method at all Int_t Int_t Double_t Double_t Double_t e
void CheckFunctions() const
Check existence of function pointers.
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 Clear(const char *opt="")
Clear the emulated collection.
virtual void ReadBuffer(TBuffer &b, void *obj)
virtual CopyIterator_t GetFunctionCopyIterator(Bool_t read=kTRUE)
See typedef void (*CopyIterator_t)(void *&dest, const void *source); Copy the iterator source...
TVirtualCollectionProxy * GetCollectionProxy() const
Return the proxy describing the collection (if any).
virtual TClass * GetValueClass() const
Return a pointer to the TClass representing the content.
Value(const std::string &info, Bool_t silent)
Constructor.
virtual void * At(UInt_t idx)
Return the address of the value at index 'idx'.
Int_t Size() const
Get size of basic typedef'ed type.
void * TGenCollectionProxy__VectorCopyIterator(void *dest, const void *source)
TClass * GetClass() const
virtual UInt_t Size() const =0
Value * fKey
Descriptor of the key_type.
virtual void operator()(TBuffer &refBuffer, void *pObject)
TClassStreamer IO overload.
void * TGenCollectionProxy__SlowCopyIterator(void *dest, const void *source)
Small helper to stage the content of an associative container when reading and before inserting it in...
#define dest(otri, vertexptr)
Proxy around an arbitrary container, which implements basic functionality and iteration.
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
Sizing_t fDestruct
Container accessors: block destruct.
void TGenCollectionProxy__VectorCreateIterators(void *obj, void **begin_arena, void **end_arena, TVirtualCollectionProxy *)
We can safely assume that the std::vector layout does not really depend on the content! ...
Bool_t IsValid()
Return true if the Value has been properly initialized.
Method fNext
Container accessors: generic iteration: next.
void(* DeleteTwoIterators_t)(void *begin, void *end)
Info_t fTypeinfo
Type information.
TObject * At(Int_t idx) const
R__EXTERN TInterpreter * gCling
void Streamer(void *obj, TBuffer &b, const TClass *onfile_class=0) const
void Resize(size_t nelement)
Abstract Interface class describing Streamer information for one class.
virtual TClass * GetCollectionClass() const
Return a pointer to the TClass representing the container.
virtual UInt_t Sizeof() const
Return the sizeof the collection object.
const std::type_info & Info_t
TStreamerInfoActions::TActionSequence * fWriteMemberWise
Int_t Size() const
Return size of object of this class.
Small helper to describe the Value_type or the key_type of an STL container.
void TGenCollectionProxy__VectorDeleteSingleIterators(void *)
Nothing to do.
virtual ~TGenCollectionProxy()
Standard destructor.
virtual void * Allocate(UInt_t n, Bool_t forceDelete)
Allocate the needed space.
Value * fVal
Descriptor of the Value_type.
ROOT::DesFunc_t fDtor
Method cache for containee destructor.