Logo ROOT  
Reference Guide
TGenCollectionProxy.h
Go to the documentation of this file.
1 // @(#)root/io:$Id$
2 // Author: Markus Frank 28/10/04
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 #ifndef ROOT_TGenCollectionProxy
12 #define ROOT_TGenCollectionProxy
13 
14 #include "TBuffer.h"
15 
17 
18 #include "TCollectionProxyInfo.h"
19 
20 #include <atomic>
21 #include <string>
22 #include <map>
23 #include <cstdlib>
24 #include <vector>
25 
26 class TObjArray;
28 
31 {
32 
33  // Friend declaration
35 
36 public:
37 
38 #ifdef R__HPUX
39  typedef const std::type_info& Info_t;
40 #else
41  typedef const std::type_info& Info_t;
42 #endif
43 
44  enum {
45  // Those 'bits' are used in conjunction with CINT's bit to store the 'type'
46  // info into one int
47  kBIT_ISSTRING = 0x20000000, // We can optimized a value operation when the content are strings
48  kBIT_ISTSTRING = 0x40000000
49  };
50 
51  /** @class TGenCollectionProxy::Value TGenCollectionProxy.h TGenCollectionProxy.h
52  *
53  * Small helper to describe the Value_type or the key_type
54  * of an STL container.
55  *
56  * @author M.Frank
57  * @version 1.0
58  * @date 10/10/2004
59  */
60  struct Value {
61  ROOT::NewFunc_t fCtor; ///< Method cache for containee constructor
62  ROOT::DesFunc_t fDtor; ///< Method cache for containee destructor
63  ROOT::DelFunc_t fDelete; ///< Method cache for containee delete
64  UInt_t fCase; ///< type of data of Value_type
65  UInt_t fProperties; ///< Additional properties of the value type (kNeedDelete)
66  TClassRef fType; ///< TClass reference of Value_type in collection
67  EDataType fKind; ///< kind of ROOT-fundamental type
68  size_t fSize; ///< fSize of the contained object
69 
70  // Default copy constructor has the correct implementation.
71 
72  // Initializing constructor
73  Value(const std::string& info, Bool_t silent);
74  // Delete individual item from STL container
75  void DeleteItem(void* ptr);
76 
77  Bool_t IsValid();
78  };
79 
80  /**@class StreamHelper
81  *
82  * Helper class to facilitate I/O
83  *
84  * @author M.Frank
85  * @version 1.0
86  * @date 10/10/2004
87  */
88  union StreamHelper {
102  void* p_void;
103  void** pp_void;
104  char* kchar;
106  void* ptr() {
107  return *(&this->p_void);
108  }
109  std::string* str() {
110  return (std::string*)this;
111  }
112  const char* c_str() {
113  return ((std::string*)this)->c_str();
114  }
115  const char* c_pstr() {
116  return (*(std::string**)this)->c_str();
117  }
118  void set(void* p) {
119  *(&this->p_void) = p;
120  }
122  TString s;
123  s.Streamer(b);
124  ((std::string*)this)->assign(s.Data());
125  }
127  *((TString*)this) = "";
128  ((TString*)this)->Streamer(b);
129  return this;
130  }
132  TString s;
133  std::string* str2 = (std::string*)ptr();
134  if (!str2) str2 = new std::string();
135  s.Streamer(b);
136  *str2 = s;
137  set(str2);
138  }
140  const char* c;
141  if (ptr()) {
142  std::string* strptr = (*(std::string**)this);
143  c = (const char*)(strptr->c_str());
144  } else c = "";
145  TString(c).Streamer(b);
146  }
148  void* p = ptr();
149  if ( p ) {
150  if ( v->fDelete ) { // Compiled content: call Destructor
151  (*v->fDelete)(p);
152  }
153  else if ( v->fType ) { // Emulated content: call TClass::Delete
154  v->fType->Destructor(p);
155  }
156  else if ( v->fDtor ) {
157  (*v->fDtor)(p);
158  ::operator delete(p);
159  }
160  else {
161  ::operator delete(p);
162  }
163  }
164  set( b.ReadObjectAny(v->fType) );
165  }
166 
168  TString* s = (TString*)ptr();
169  if ( vsn3 ) {
170  if ( !s ) s = new TString();
171  else s->Clear();
172  s->Streamer(b);
173  set(s);
174  return;
175  }
176  if ( s ) delete s;
177  set( b.ReadObjectAny(TString::Class()) );
178  }
180  b.WriteObjectAny(ptr(), TString::Class());
181  }
182  };
183 
184  /** @class TGenCollectionProxy::Method TGenCollectionProxy.h TGenCollectionProxy.h
185  *
186  * Small helper to execute (compiler) generated function for the
187  * access to STL or other containers.
188  *
189  * @author M.Frank
190  * @version 1.0
191  * @date 10/10/2004
192  */
193  class Method {
194  public:
195  typedef void* (*Call_t)(void*);
197  Method() : call(0) { }
198  Method(Call_t c) : call(c) { }
199  Method(const Method& m) : call(m.call) { }
200  Method &operator=(const Method& m) { call = m.call; return *this; }
201  void* invoke(void* obj) const { return (*call)(obj); }
202  };
203 
204  /** @class TGenCollectionProxy::Method TGenCollectionProxy.h TGenCollectionProxy.h
205  *
206  * Small helper to execute (compiler) generated function for the
207  * access to STL or other containers.
208  *
209  * @author M.Frank
210  * @version 1.0
211  * @date 10/10/2004
212  */
213  class Method0 {
214  public:
215  typedef void* (*Call_t)();
217  Method0() : call(0) { }
219  Method0(const Method0& m) : call(m.call) { }
220  Method0 &operator=(const Method0& m) { call = m.call; return *this; }
221  void* invoke() const { return (*call)(); }
222  };
223 
224  /** @class TGenCollectionProxy::TStaging
225  *
226  * Small helper to stage the content of an associative
227  * container when reading and before inserting it in the
228  * actual collection.
229  *
230  * @author Ph.Canal
231  * @version 1.0
232  * @date 20/08/2010
233  */
234  class TStaging {
235  void *fTarget; ///< Pointer to the collection we are staging for.
236  void *fContent; ///< Pointer to the content
237  size_t fReserved; ///< Amount of space already reserved.
238  size_t fSize; ///< Number of elements
239  size_t fSizeOf; ///< size of each elements
240 
241  TStaging(const TStaging&); ///< Not implemented.
242  TStaging &operator=(const TStaging&); ///< Not implemented.
243 
244  public:
245  TStaging(size_t size, size_t size_of) : fTarget(0), fContent(0), fReserved(0), fSize(size), fSizeOf(size_of)
246  {
247  // Usual constructor. Reserves the required number of elements.
248  fReserved = fSize;
250  }
251 
253  // Usual destructor
254  ::free(fContent);
255  }
256 
257  void *GetContent() {
258  // Return the location of the array of content.
259  return fContent;
260  }
261  void *GetEnd() {
262  // Return the 'end' of the array of content.
263  return ((char*)fContent) + fSize*fSizeOf;
264  }
265  size_t GetSize() {
266  // Return the number of elements.
267  return fSize;
268  }
269  void *GetTarget() {
270  // Get the address of the collection we are staging for.
271  return fTarget;
272  }
273  void Resize(size_t nelement) {
274  if (fReserved < nelement) {
275  fReserved = nelement;
277  }
278  fSize = nelement;
279  }
280  void SetTarget(void *target) {
281  // Set the collection we are staging for.
282  fTarget = target;
283  }
284  };
285 
286 protected:
289  typedef std::vector<TStaging*> Staged_t; ///< Collection of pre-allocated staged array for associative containers.
290  typedef std::vector<EnvironBase_t*> Proxies_t;
291  mutable TObjArray *fReadMemberWise; ///< Array of bundle of TStreamerInfoActions to stream out (read)
292  mutable std::map<std::string, TObjArray*> *fConversionReadMemberWise; ///< Array of bundle of TStreamerInfoActions to stream out (read) derived from another class.
294  typedef void (*Sizing_t)(void *obj, size_t size);
295  typedef void* (*Feedfunc_t)(void *from, void *to, size_t size);
296  typedef void* (*Collectfunc_t)(void *from, void *to);
297  typedef void* (*ArrIterfunc_t)(void *from, size_t size);
298 
299  std::string fName; ///< Name of the class being proxied.
300  Bool_t fPointers; ///< Flag to indicate if containee has pointers (key or value)
301  Method fClear; ///< Method cache for container accessors: clear container
302  Method fSize; ///< Container accessors: size of container
303  Sizing_t fResize; ///< Container accessors: resize container
304  Method fFirst; ///< Container accessors: generic iteration: first
305  Method fNext; ///< Container accessors: generic iteration: next
306  ArrIterfunc_t fConstruct; ///< Container accessors: block construct
307  Sizing_t fDestruct; ///< Container accessors: block destruct
308  Feedfunc_t fFeed; ///< Container accessors: block feed
309  Collectfunc_t fCollect; ///< Method to collect objects from container
310  Method0 fCreateEnv; ///< Method to allocate an Environment holder.
311  std::atomic<Value*> fValue; ///< Descriptor of the container value type
312  Value* fVal; ///< Descriptor of the Value_type
313  Value* fKey; ///< Descriptor of the key_type
314  EnvironBase_t*fEnv; ///< Address of the currently proxied object
315  int fValOffset; ///< Offset from key to value (in maps)
316  int fValDiff; ///< Offset between two consecutive value_types (memory layout).
317  Proxies_t fProxyList; ///< Stack of recursive proxies
318  Proxies_t fProxyKept; ///< Optimization: Keep proxies once they were created
319  Staged_t fStaged; ///< Optimization: Keep staged array once they were created
320  int fSTL_type; ///< STL container type
321  Info_t fTypeinfo; ///< Type information
322  TClass* fOnFileClass; ///< On file class
323 
329 
330  // Late initialization of collection proxy
331  TGenCollectionProxy* Initialize(Bool_t silent) const;
332  // Some hack to avoid const-ness.
333  virtual TGenCollectionProxy* InitializeEx(Bool_t silent);
334  // Call to delete/destruct individual contained item.
335  virtual void DeleteItem(Bool_t force, void* ptr) const;
336  // Allow to check function pointers.
337  void CheckFunctions() const;
338 
339 private:
340  TGenCollectionProxy(); // not implemented on purpose.
341 
342 public:
343 
344  // Virtual copy constructor.
345  virtual TVirtualCollectionProxy* Generate() const;
346 
347  // Copy constructor.
349 
350 private:
351  // Assignment operator
352  TGenCollectionProxy &operator=(const TGenCollectionProxy&); // Not Implemented
353 
354 public:
355  // Initializing constructor
356  TGenCollectionProxy(Info_t typ, size_t iter_size);
358 
359  // Standard destructor.
360  virtual ~TGenCollectionProxy();
361 
362  // Return a pointer to the TClass representing the container.
363  virtual TClass *GetCollectionClass() const;
364 
365  // Return the type of collection see TClassEdit::ESTLType
366  virtual Int_t GetCollectionType() const;
367 
368  // Return the offset between two consecutive value_types (memory layout).
369  virtual ULong_t GetIncrement() const;
370 
371  // Return the sizeof the collection object.
372  virtual UInt_t Sizeof() const;
373 
374  // Push new proxy environment.
375  virtual void PushProxy(void *objstart);
376 
377  // Pop old proxy environment.
378  virtual void PopProxy();
379 
380  // Return true if the content is of type 'pointer to'.
381  virtual Bool_t HasPointers() const;
382 
383  // Return a pointer to the TClass representing the content.
384  virtual TClass *GetValueClass() const;
385 
386  // If the content is a simple numerical value, return its type (see TDataType).
387  virtual EDataType GetType() const;
388 
389  // Return the address of the value at index 'idx'.
390  virtual void *At(UInt_t idx);
391 
392  // Clear the container.
393  virtual void Clear(const char *opt = "");
394 
395  // Resize the container.
396  virtual void Resize(UInt_t n, Bool_t force_delete);
397 
398  // Return the current size of the container.
399  virtual UInt_t Size() const;
400 
401  // Block allocation of containees.
402  virtual void* Allocate(UInt_t n, Bool_t forceDelete);
403 
404  // Insert data into the container where data is a C-style array of the actual type contained in the collection
405  // of the given size. For associative container (map, etc.), the data type is the pair<key,value>.
406  virtual void Insert(const void *data, void *container, size_t size);
407 
408  // Block commit of containees.
409  virtual void Commit(void* env);
410 
411  // Streamer function.
412  virtual void Streamer(TBuffer &refBuffer);
413 
414  // Streamer I/O overload.
415  virtual void Streamer(TBuffer &refBuffer, void *pObject, int siz);
416 
417  // TClassStreamer I/O overload.
418  virtual void operator()(TBuffer &refBuffer, void *pObject);
419 
420  // Routine to read the content of the buffer into 'obj'.
421  virtual void ReadBuffer(TBuffer &b, void *obj);
422  virtual void ReadBuffer(TBuffer &b, void *obj, const TClass *onfileClass);
423 
424  virtual void SetOnFileClass( TClass* cl ) { fOnFileClass = cl; }
425  virtual TClass* GetOnFileClass() const { return fOnFileClass; }
426 
427  // MemberWise actions
431 
432  // Set of functions to iterate easily throught the collection
433 
435  // typedef void (*CreateIterators_t)(void *collection, void **begin_arena, void **end_arena);
436  // begin_arena and end_arena should contain the location of a memory arena of size fgIteratorSize.
437  // If the collection iterator are of that size or less, the iterators will be constructed in place in those location (new with placement)
438  // Otherwise the iterators will be allocated via a regular new and their address returned by modifying the value of begin_arena and end_arena.
439 
441  // typedef void* (*CopyIterator_t)(void **dest, const void *source);
442  // Copy the iterator source, into dest. dest should contain the location of a memory arena of size fgIteratorSize.
443  // If the collection iterator is of that size or less, the iterator will be constructed in place in this location (new with placement)
444  // Otherwise the iterator will be allocated via a regular new.
445  // The actual address of the iterator is returned in both case.
446 
447  virtual Next_t GetFunctionNext(Bool_t read = kTRUE);
448  // typedef void* (*Next_t)(void *iter, const void *end);
449  // iter and end should be pointers to respectively an iterator to be incremented and the result of collection.end()
450  // If the iterator has not reached the end of the collection, 'Next' increment the iterator 'iter' and return 0 if
451  // the iterator reached the end.
452  // If the end was not reached, 'Next' returns the address of the content pointed to by the iterator before the
453  // incrementation ; if the collection contains pointers, 'Next' will return the value of the pointer.
454 
457  // typedef void (*DeleteIterator_t)(void *iter);
458  // typedef void (*DeleteTwoIterators_t)(void *begin, void *end);
459  // If the size of the iterator is greater than fgIteratorArenaSize, call delete on the addresses,
460  // Otherwise just call the iterator's destructor.
461 
462 };
463 
464 template <typename T>
467  : TGenCollectionProxy(typeid(T::Cont_t),sizeof(T::Iter_t))
468  {
469  // Constructor.
470  fValDiff = sizeof(T::Value_t);
471  fValOffset = T::value_offset();
472  fSize.call = T::size;
473  fResize = T::resize;
474  fNext.call = T::next;
475  fFirst.call = T::first;
476  fClear.call = T::clear;
477  fConstruct = T::construct;
478  fDestruct = T::destruct;
479  fFeed = T::feed;
480  CheckFunctions();
481  }
482  virtual ~AnyCollectionProxy() { }
483 };
484 
485 #endif
486 
TGenCollectionProxy::GetWriteMemberWiseActions
virtual TStreamerInfoActions::TActionSequence * GetWriteMemberWiseActions()
Return the set of action necessary to stream out this collection member-wise.
Definition: TGenCollectionProxy.cxx:1770
c
#define c(i)
Definition: RSha256.hxx:101
TGenCollectionProxy::Generate
virtual TVirtualCollectionProxy * Generate() const
Virtual copy constructor.
Definition: TGenCollectionProxy.cxx:733
TGenCollectionProxy::Collectfunc_t
void *(* Collectfunc_t)(void *from, void *to)
Definition: TGenCollectionProxy.h:296
TGenCollectionProxy::StreamHelper::u_char
UChar_t u_char
Definition: TGenCollectionProxy.h:97
m
auto * m
Definition: textangle.C:8
TGenCollectionProxy::operator()
virtual void operator()(TBuffer &refBuffer, void *pObject)
TClassStreamer IO overload.
Definition: TGenCollectionProxy.cxx:1403
TGenCollectionProxy::Method::Call_t
void *(* Call_t)(void *)
Definition: TGenCollectionProxy.h:195
TGenCollectionProxy::StreamHelper::c_pstr
const char * c_pstr()
Definition: TGenCollectionProxy.h:115
TGenCollectionProxy::Clear
virtual void Clear(const char *opt="")
Clear the emulated collection.
Definition: TGenCollectionProxy.cxx:1092
n
const Int_t n
Definition: legend1.C:16
TGenCollectionProxy::PushProxy
virtual void PushProxy(void *objstart)
Add an object.
Definition: TGenCollectionProxy.cxx:1254
TGenCollectionProxy::Value::fDtor
ROOT::DesFunc_t fDtor
Method cache for containee destructor.
Definition: TGenCollectionProxy.h:62
TGenCollectionProxy::StreamHelper::u_short
UShort_t u_short
Definition: TGenCollectionProxy.h:98
ROOT::DesFunc_t
void(* DesFunc_t)(void *)
Definition: Rtypes.h:112
TGenCollectionProxy::DeleteItem
virtual void DeleteItem(Bool_t force, void *ptr) const
Call to delete/destruct individual item.
Definition: TGenCollectionProxy.cxx:1305
TGenCollectionProxy::TGenCollectionProxy
TGenCollectionProxy()
TVirtualCollectionProxy.h
ROOT::Detail::TCollectionProxyInfo
Definition: TCollectionProxyInfo.h:53
TGenCollectionProxy::TStaging
Small helper to stage the content of an associative container when reading and before inserting it in...
Definition: TGenCollectionProxy.h:234
TGenCollectionProxy::StreamHelper::ptr
void * ptr()
Definition: TGenCollectionProxy.h:106
TGenCollectionProxy::TStaging::fReserved
size_t fReserved
Amount of space already reserved.
Definition: TGenCollectionProxy.h:237
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
ROOT::Detail::TCollectionProxyInfo::Environ
Small helper to save proxy environment in the event of recursive calls.
Definition: TCollectionProxyInfo.h:240
TObjArray
An array of TObjects.
Definition: TObjArray.h:37
TGenCollectionProxy::Method0::Method0
Method0(const Method0 &m)
Definition: TGenCollectionProxy.h:219
TGenCollectionProxy::fConversionReadMemberWise
std::map< std::string, TObjArray * > * fConversionReadMemberWise
Array of bundle of TStreamerInfoActions to stream out (read) derived from another class.
Definition: TGenCollectionProxy.h:292
AnyCollectionProxy::AnyCollectionProxy
AnyCollectionProxy()
Definition: TGenCollectionProxy.h:466
TGenCollectionProxy::Value::DeleteItem
void DeleteItem(void *ptr)
Definition: TGenCollectionProxy.cxx:520
TGenCollectionProxy::StreamHelper::pp_void
void ** pp_void
Definition: TGenCollectionProxy.h:103
TGenCollectionProxy::fReadMemberWise
TObjArray * fReadMemberWise
Array of bundle of TStreamerInfoActions to stream out (read)
Definition: TGenCollectionProxy.h:291
TGenCollectionProxy::Value::fCtor
ROOT::NewFunc_t fCtor
Method cache for containee constructor.
Definition: TGenCollectionProxy.h:61
TVirtualCollectionProxy::CopyIterator_t
void *(* CopyIterator_t)(void *dest, const void *source)
Definition: TVirtualCollectionProxy.h:170
TGenCollectionProxy::StreamHelper::s_short
Short_t s_short
Definition: TGenCollectionProxy.h:91
UShort_t
unsigned short UShort_t
Definition: RtypesCore.h:40
TGenCollectionProxy::Value::fProperties
UInt_t fProperties
Additional properties of the value type (kNeedDelete)
Definition: TGenCollectionProxy.h:65
ROOT::DelFunc_t
void(* DelFunc_t)(void *)
Definition: Rtypes.h:110
TGenCollectionProxy::GetCollectionType
virtual Int_t GetCollectionType() const
Return the type of collection see TClassEdit::ESTLType.
Definition: TGenCollectionProxy.cxx:951
TGenCollectionProxy::Method0::call
Call_t call
Definition: TGenCollectionProxy.h:216
TGenCollectionProxy::fPointers
Bool_t fPointers
Flag to indicate if containee has pointers (key or value)
Definition: TGenCollectionProxy.h:300
TGenCollectionProxy::GetType
virtual EDataType GetType() const
If the content is a simple numerical value, return its type (see TDataType)
Definition: TGenCollectionProxy.cxx:1009
TGenCollectionProxy::StreamHelper::dbl
Double_t dbl
Definition: TGenCollectionProxy.h:96
TGenCollectionProxy::TStaging::fSize
size_t fSize
Number of elements.
Definition: TGenCollectionProxy.h:238
Long64_t
long long Long64_t
Definition: RtypesCore.h:73
TGenCollectionProxy::Value::fCase
UInt_t fCase
type of data of Value_type
Definition: TGenCollectionProxy.h:64
TGenCollectionProxy::StreamHelper::read_tstring
void * read_tstring(TBuffer &b)
Definition: TGenCollectionProxy.h:126
TGenCollectionProxy::StreamHelper::u_int
UInt_t u_int
Definition: TGenCollectionProxy.h:99
TGenCollectionProxy::StreamHelper::p_void
void * p_void
Definition: TGenCollectionProxy.h:102
TGenCollectionProxy::fSTL_type
int fSTL_type
STL container type.
Definition: TGenCollectionProxy.h:320
TGenCollectionProxy::GetReadMemberWiseActions
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...
Definition: TGenCollectionProxy.cxx:1748
TGenCollectionProxy::StreamHelper::u_longlong
ULong64_t u_longlong
Definition: TGenCollectionProxy.h:101
TGenCollectionProxy::GetFunctionCreateIterators
virtual CreateIterators_t GetFunctionCreateIterators(Bool_t read=kTRUE)
See typedef void (*CreateIterators_t)(void *collection, void *&begin_arena, void *&end_arena); begin_...
Definition: TGenCollectionProxy.cxx:1562
TGenCollectionProxy::StreamHelper::set
void set(void *p)
Definition: TGenCollectionProxy.h:118
Float_t
float Float_t
Definition: RtypesCore.h:57
TGeant4Unit::s
static constexpr double s
Definition: TGeant4SystemOfUnits.h:162
Int_t
int Int_t
Definition: RtypesCore.h:45
TGenCollectionProxy::Method
Small helper to execute (compiler) generated function for the access to STL or other containers.
Definition: TGenCollectionProxy.h:193
TGenCollectionProxy::Env_t
ROOT::Detail::TCollectionProxyInfo::Environ< char[64]> Env_t
Definition: TGenCollectionProxy.h:287
TGenCollectionProxy::Method::invoke
void * invoke(void *obj) const
Definition: TGenCollectionProxy.h:201
TGenCollectionProxy::fProxyKept
Proxies_t fProxyKept
Optimization: Keep proxies once they were created.
Definition: TGenCollectionProxy.h:318
TGenCollectionProxy::Sizing_t
void(* Sizing_t)(void *obj, size_t size)
Definition: TGenCollectionProxy.h:294
TGenCollectionProxy::Resize
virtual void Resize(UInt_t n, Bool_t force_delete)
Resize the container.
Definition: TGenCollectionProxy.cxx:1125
TGenCollectionProxy::StreamHelper::read_std_string
void read_std_string(TBuffer &b)
Definition: TGenCollectionProxy.h:121
TGenCollectionProxy::TStaging::fTarget
void * fTarget
Pointer to the collection we are staging for.
Definition: TGenCollectionProxy.h:235
TCollectionProxyInfo.h
TGenCollectionProxy::TStaging::fContent
void * fContent
Pointer to the content.
Definition: TGenCollectionProxy.h:236
TBuffer
Buffer base class used for serializing objects.
Definition: TBuffer.h:43
TGenCollectionProxy::GetFunctionDeleteIterator
virtual DeleteIterator_t GetFunctionDeleteIterator(Bool_t read=kTRUE)
See typedef void (*DeleteIterator_t)(void *iter); If the sizeof iterator is greater than fgIteratorAr...
Definition: TGenCollectionProxy.cxx:1648
TGenCollectionProxy::StreamHelper::write_tstring_pointer
void write_tstring_pointer(TBuffer &b)
Definition: TGenCollectionProxy.h:179
TGenCollectionProxy::Insert
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...
Definition: TGenCollectionProxy.cxx:1224
TString
Basic string class.
Definition: TString.h:136
Bool_t
bool Bool_t
Definition: RtypesCore.h:63
TGenCollectionProxy::GetOnFileClass
virtual TClass * GetOnFileClass() const
Definition: TGenCollectionProxy.h:425
TGenCollectionProxy::Method::Method
Method(Call_t c)
Definition: TGenCollectionProxy.h:198
v
@ v
Definition: rootcling_impl.cxx:3635
TGenCollectionProxy::fWriteMemberWise
TStreamerInfoActions::TActionSequence * fWriteMemberWise
Definition: TGenCollectionProxy.h:293
TGenCollectionProxy::GetFunctionCopyIterator
virtual CopyIterator_t GetFunctionCopyIterator(Bool_t read=kTRUE)
See typedef void (*CopyIterator_t)(void *&dest, const void *source); Copy the iterator source,...
Definition: TGenCollectionProxy.cxx:1596
b
#define b(i)
Definition: RSha256.hxx:100
TGenCollectionProxy::Staged_t
std::vector< TStaging * > Staged_t
Collection of pre-allocated staged array for associative containers.
Definition: TGenCollectionProxy.h:289
TGenCollectionProxy::GetFunctionNext
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...
Definition: TGenCollectionProxy.cxx:1623
TGenCollectionProxy::Value::fSize
size_t fSize
fSize of the contained object
Definition: TGenCollectionProxy.h:68
bool
TGenCollectionProxy::StreamHelper::s_int
Int_t s_int
Definition: TGenCollectionProxy.h:92
TGenCollectionProxy::SetOnFileClass
virtual void SetOnFileClass(TClass *cl)
Definition: TGenCollectionProxy.h:424
TGenCollectionProxy::fVal
Value * fVal
Descriptor of the Value_type.
Definition: TGenCollectionProxy.h:312
TGenCollectionProxy::ReadBuffer
virtual void ReadBuffer(TBuffer &b, void *obj)
Definition: TGenCollectionProxy.cxx:1374
TGenCollectionProxy::~TGenCollectionProxy
virtual ~TGenCollectionProxy()
Standard destructor.
Definition: TGenCollectionProxy.cxx:707
TGenCollectionProxy::fKey
Value * fKey
Descriptor of the key_type.
Definition: TGenCollectionProxy.h:313
TGenCollectionProxy::StreamHelper::str
std::string * str()
Definition: TGenCollectionProxy.h:109
TGenCollectionProxy::fDestruct
Sizing_t fDestruct
Container accessors: block destruct.
Definition: TGenCollectionProxy.h:307
TGenCollectionProxy::TStaging::fSizeOf
size_t fSizeOf
size of each elements
Definition: TGenCollectionProxy.h:239
TGenCollectionProxy::StreamHelper::read_std_string_pointer
void read_std_string_pointer(TBuffer &b)
Definition: TGenCollectionProxy.h:131
TGenCollectionProxy::operator=
TGenCollectionProxy & operator=(const TGenCollectionProxy &)
TGenCollectionProxy::Value
Small helper to describe the Value_type or the key_type of an STL container.
Definition: TGenCollectionProxy.h:60
TGenCollectionProxy::fClear
Method fClear
Method cache for container accessors: clear container.
Definition: TGenCollectionProxy.h:301
TGenCollectionProxy::TStaging::~TStaging
~TStaging()
Definition: TGenCollectionProxy.h:252
TVirtualCollectionProxy::DeleteIterator_t
void(* DeleteIterator_t)(void *iter)
Definition: TVirtualCollectionProxy.h:185
malloc
#define malloc
Definition: civetweb.c:1536
TGenCollectionProxy::GetCollectionClass
virtual TClass * GetCollectionClass() const
Return a pointer to the TClass representing the container.
Definition: TGenCollectionProxy.cxx:943
TBuffer.h
TGenCollectionProxy::TStaging::SetTarget
void SetTarget(void *target)
Definition: TGenCollectionProxy.h:280
TGenCollectionProxy::fStaged
Staged_t fStaged
Optimization: Keep staged array once they were created.
Definition: TGenCollectionProxy.h:319
TGenCollectionProxy::kBIT_ISSTRING
@ kBIT_ISSTRING
Definition: TGenCollectionProxy.h:47
TGenCollectionProxy::GetFunctionDeleteTwoIterators
virtual DeleteTwoIterators_t GetFunctionDeleteTwoIterators(Bool_t read=kTRUE)
See typedef void (*DeleteTwoIterators_t)(void *begin, void *end); If the sizeof iterator is greater t...
Definition: TGenCollectionProxy.cxx:1673
TGenCollectionProxy::StreamHelper::c_str
const char * c_str()
Definition: TGenCollectionProxy.h:112
TGenCollectionProxy::GetIncrement
virtual ULong_t GetIncrement() const
Return the offset between two consecutive value_types (memory layout).
Definition: TGenCollectionProxy.cxx:962
TGenCollectionProxy::Value::fKind
EDataType fKind
kind of ROOT-fundamental type
Definition: TGenCollectionProxy.h:67
TGenCollectionProxy::PopProxy
virtual void PopProxy()
Remove the last object.
Definition: TGenCollectionProxy.cxx:1289
TGenCollectionProxy::Method::call
Call_t call
Definition: TGenCollectionProxy.h:196
Long_t
long Long_t
Definition: RtypesCore.h:54
TGenCollectionProxy::fValue
std::atomic< Value * > fValue
Descriptor of the container value type.
Definition: TGenCollectionProxy.h:311
TGenCollectionProxy::StreamHelper::flt
Float_t flt
Definition: TGenCollectionProxy.h:95
TGenCollectionProxy::ArrIterfunc_t
void *(* ArrIterfunc_t)(void *from, size_t size)
Definition: TGenCollectionProxy.h:297
TGenCollectionProxy::StreamHelper::s_longlong
Long64_t s_longlong
Definition: TGenCollectionProxy.h:94
TGenCollectionProxy::Method0::Method0
Method0(Call_t c)
Definition: TGenCollectionProxy.h:218
TGenCollectionProxy::Method::Method
Method(const Method &m)
Definition: TGenCollectionProxy.h:199
TGenCollectionProxy::At
virtual void * At(UInt_t idx)
Return the address of the value at index 'idx'.
Definition: TGenCollectionProxy.cxx:1022
TGenCollectionProxy::Allocate
virtual void * Allocate(UInt_t n, Bool_t forceDelete)
Allocate the needed space.
Definition: TGenCollectionProxy.cxx:1148
TGenCollectionProxy::StreamHelper::s_char
Char_t s_char
Definition: TGenCollectionProxy.h:90
TGenCollectionProxy::TStaging::GetTarget
void * GetTarget()
Definition: TGenCollectionProxy.h:269
TGenCollectionProxy::StreamHelper::boolean
Bool_t boolean
Definition: TGenCollectionProxy.h:89
TGenCollectionProxy::GetConversionReadMemberWiseActions
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...
Definition: TGenCollectionProxy.cxx:1697
TGenCollectionProxy::fFeed
Feedfunc_t fFeed
Container accessors: block feed.
Definition: TGenCollectionProxy.h:308
ULong_t
unsigned long ULong_t
Definition: RtypesCore.h:55
Short_t
short Short_t
Definition: RtypesCore.h:39
TGenCollectionProxy::Feedfunc_t
void *(* Feedfunc_t)(void *from, void *to, size_t size)
Definition: TGenCollectionProxy.h:295
TGenCollectionProxy::fFunctionCreateIterators
CreateIterators_t fFunctionCreateIterators
Definition: TGenCollectionProxy.h:324
TCollectionProxyFactory
TCollectionProxyFactory Interface to collection proxy and streamer generator.
Definition: TCollectionProxyFactory.h:65
TGenCollectionProxy::Sizeof
virtual UInt_t Sizeof() const
Return the sizeof the collection object.
Definition: TGenCollectionProxy.cxx:972
TGenCollectionProxy::TStaging::GetContent
void * GetContent()
Definition: TGenCollectionProxy.h:257
realloc
#define realloc
Definition: civetweb.c:1538
TGenCollectionProxy::kBIT_ISTSTRING
@ kBIT_ISTSTRING
Definition: TGenCollectionProxy.h:48
TGenCollectionProxy::fFunctionDeleteTwoIterators
DeleteTwoIterators_t fFunctionDeleteTwoIterators
Definition: TGenCollectionProxy.h:328
void
typedef void((*Func_t)())
TGenCollectionProxy::Initialize
TGenCollectionProxy * Initialize(Bool_t silent) const
Proxy initializer.
Definition: TGenCollectionProxy.cxx:772
TGenCollectionProxy::Size
virtual UInt_t Size() const
Return the current size of the container.
Definition: TGenCollectionProxy.cxx:1109
TGenCollectionProxy::InitializeEx
virtual TGenCollectionProxy * InitializeEx(Bool_t silent)
Proxy initializer.
Definition: TGenCollectionProxy.cxx:831
TGenCollectionProxy::fConstruct
ArrIterfunc_t fConstruct
Container accessors: block construct.
Definition: TGenCollectionProxy.h:306
unsigned int
TGenCollectionProxy::Method0::Method0
Method0()
Definition: TGenCollectionProxy.h:217
TGenCollectionProxy::CheckFunctions
void CheckFunctions() const
Check existence of function pointers.
Definition: TGenCollectionProxy.cxx:782
TGenCollectionProxy::fTypeinfo
Info_t fTypeinfo
Type information.
Definition: TGenCollectionProxy.h:321
TGenCollectionProxy::fResize
Sizing_t fResize
Container accessors: resize container.
Definition: TGenCollectionProxy.h:303
TGenCollectionProxy::StreamHelper
Helper class to facilitate I/O.
Definition: TGenCollectionProxy.h:88
TGenCollectionProxy::Info_t
const std::type_info & Info_t
Definition: TGenCollectionProxy.h:41
TGenCollectionProxy::TStaging::TStaging
TStaging(size_t size, size_t size_of)
Definition: TGenCollectionProxy.h:245
TGenCollectionProxy::StreamHelper::read_any_object
void read_any_object(Value *v, TBuffer &b)
Definition: TGenCollectionProxy.h:147
TGenCollectionProxy::StreamHelper::tstr
TString * tstr
Definition: TGenCollectionProxy.h:105
TVirtualCollectionProxy::CreateIterators_t
void(* CreateIterators_t)(void *collection, void **begin_arena, void **end_arena, TVirtualCollectionProxy *proxy)
Definition: TVirtualCollectionProxy.h:164
TGenCollectionProxy::Proxies_t
std::vector< EnvironBase_t * > Proxies_t
Definition: TGenCollectionProxy.h:290
TGenCollectionProxy::fName
std::string fName
Name of the class being proxied.
Definition: TGenCollectionProxy.h:299
TGenCollectionProxy::Method0
Definition: TGenCollectionProxy.h:213
TGenCollectionProxy::Method0::invoke
void * invoke() const
Definition: TGenCollectionProxy.h:221
ULong64_t
unsigned long long ULong64_t
Definition: RtypesCore.h:74
TGenCollectionProxy::fCollect
Collectfunc_t fCollect
Method to collect objects from container.
Definition: TGenCollectionProxy.h:309
Double_t
double Double_t
Definition: RtypesCore.h:59
TGenCollectionProxy::TStaging::operator=
TStaging & operator=(const TStaging &)
Not implemented.
TGenCollectionProxy::TStaging::Resize
void Resize(size_t nelement)
Definition: TGenCollectionProxy.h:273
TGenCollectionProxy::StreamHelper::kchar
char * kchar
Definition: TGenCollectionProxy.h:104
TGenCollectionProxy::Value::Value
Value(const std::string &info, Bool_t silent)
Constructor.
Definition: TGenCollectionProxy.cxx:317
TGenCollectionProxy::fSize
Method fSize
Container accessors: size of container.
Definition: TGenCollectionProxy.h:302
TGenCollectionProxy::Commit
virtual void Commit(void *env)
Commit the change.
Definition: TGenCollectionProxy.cxx:1232
TClass
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition: TClass.h:80
EDataType
EDataType
Definition: TDataType.h:28
UChar_t
unsigned char UChar_t
Definition: RtypesCore.h:38
TGenCollectionProxy::fFunctionDeleteIterator
DeleteIterator_t fFunctionDeleteIterator
Definition: TGenCollectionProxy.h:327
TVirtualCollectionProxy::DeleteTwoIterators_t
void(* DeleteTwoIterators_t)(void *begin, void *end)
Definition: TVirtualCollectionProxy.h:186
TGenCollectionProxy::fValDiff
int fValDiff
Offset between two consecutive value_types (memory layout).
Definition: TGenCollectionProxy.h:316
TGenCollectionProxy::fProxyList
Proxies_t fProxyList
Stack of recursive proxies.
Definition: TGenCollectionProxy.h:317
TGenCollectionProxy::TStaging::GetEnd
void * GetEnd()
Definition: TGenCollectionProxy.h:261
TGenCollectionProxy::Value::fType
TClassRef fType
TClass reference of Value_type in collection.
Definition: TGenCollectionProxy.h:66
TGenCollectionProxy::StreamHelper::write_std_string_pointer
void write_std_string_pointer(TBuffer &b)
Definition: TGenCollectionProxy.h:139
TGenCollectionProxy::Method0::Call_t
void *(* Call_t)()
Definition: TGenCollectionProxy.h:215
ROOT::Math::Chebyshev::T
double T(double x)
Definition: ChebyshevPol.h:34
TGenCollectionProxy
Proxy around an arbitrary container, which implements basic functionality and iteration.
Definition: TGenCollectionProxy.h:31
ROOT::NewFunc_t
void *(* NewFunc_t)(void *)
Definition: Rtypes.h:108
TVirtualCollectionProxy::Next_t
void *(* Next_t)(void *iter, const void *end)
Definition: TVirtualCollectionProxy.h:177
TGenCollectionProxy::fValOffset
int fValOffset
Offset from key to value (in maps)
Definition: TGenCollectionProxy.h:315
TGenCollectionProxy::Streamer
virtual void Streamer(TBuffer &refBuffer)
Streamer Function.
Definition: TGenCollectionProxy.cxx:1382
TClassRef
TClassRef is used to implement a permanent reference to a TClass object.
Definition: TClassRef.h:28
TGenCollectionProxy::StreamHelper::u_long
ULong_t u_long
Definition: TGenCollectionProxy.h:100
TGenCollectionProxy::StreamHelper::s_long
Long_t s_long
Definition: TGenCollectionProxy.h:93
TGenCollectionProxy::fFunctionNextIterator
Next_t fFunctionNextIterator
Definition: TGenCollectionProxy.h:326
TGenCollectionProxy::fEnv
EnvironBase_t * fEnv
Address of the currently proxied object.
Definition: TGenCollectionProxy.h:314
AnyCollectionProxy::~AnyCollectionProxy
virtual ~AnyCollectionProxy()
Definition: TGenCollectionProxy.h:482
TGenCollectionProxy::Method0::operator=
Method0 & operator=(const Method0 &m)
Definition: TGenCollectionProxy.h:220
TGenCollectionProxy::fCreateEnv
Method0 fCreateEnv
Method to allocate an Environment holder.
Definition: TGenCollectionProxy.h:310
TGenCollectionProxy::HasPointers
virtual Bool_t HasPointers() const
Return true if the content is of type 'pointer to'.
Definition: TGenCollectionProxy.cxx:980
TGenCollectionProxy::EnvironBase_t
ROOT::Detail::TCollectionProxyInfo::EnvironBase EnvironBase_t
Definition: TGenCollectionProxy.h:288
TGenCollectionProxy::TStaging::TStaging
TStaging(const TStaging &)
Not implemented.
free
#define free
Definition: civetweb.c:1539
TGenCollectionProxy::TStaging::GetSize
size_t GetSize()
Definition: TGenCollectionProxy.h:265
TStreamerInfoActions::TActionSequence
Definition: TStreamerInfoActions.h:172
TGenCollectionProxy::GetValueClass
virtual TClass * GetValueClass() const
Return a pointer to the TClass representing the content.
Definition: TGenCollectionProxy.cxx:996
Class
void Class()
Definition: Class.C:29
TGenCollectionProxy::fNext
Method fNext
Container accessors: generic iteration: next.
Definition: TGenCollectionProxy.h:305
TGenCollectionProxy::Method::operator=
Method & operator=(const Method &m)
Definition: TGenCollectionProxy.h:200
ROOT::Detail::TCollectionProxyInfo::EnvironBase
Definition: TCollectionProxyInfo.h:219
Char_t
char Char_t
Definition: RtypesCore.h:33
TGenCollectionProxy::fFirst
Method fFirst
Container accessors: generic iteration: first.
Definition: TGenCollectionProxy.h:304
TGenCollectionProxy::Value::IsValid
Bool_t IsValid()
Return true if the Value has been properly initialized.
Definition: TGenCollectionProxy.cxx:513
TGenCollectionProxy::StreamHelper::read_tstring_pointer
void read_tstring_pointer(Bool_t vsn3, TBuffer &b)
Definition: TGenCollectionProxy.h:167
TGenCollectionProxy::Method::Method
Method()
Definition: TGenCollectionProxy.h:197
TVirtualCollectionProxy
Definition: TVirtualCollectionProxy.h:38
AnyCollectionProxy
Definition: TGenCollectionProxy.h:465
TGenCollectionProxy::fOnFileClass
TClass * fOnFileClass
On file class.
Definition: TGenCollectionProxy.h:322
int
TGenCollectionProxy::Value::fDelete
ROOT::DelFunc_t fDelete
Method cache for containee delete.
Definition: TGenCollectionProxy.h:63
TGenCollectionProxy::fFunctionCopyIterator
CopyIterator_t fFunctionCopyIterator
Definition: TGenCollectionProxy.h:325