Streamer around an arbitrary STL like container, which implements basic container functionality.
Although this class contains all the setup necessary to deal with maps, the map-like functionality is NOT supported. For optimization reasons this functionality is put into the class TEmulatedMapProxy.
Definition at line 20 of file TEmulatedCollectionProxy.h.
Classes | |
| struct | AlignedStorage |
| Storage type whose alignment matches Align bytes. More... | |
Public Types | |
| using | Cont1024_t = std::vector<AlignedStorage<1024>> |
| using | Cont128_t = std::vector<AlignedStorage< 128>> |
| using | Cont16_t = std::vector<AlignedStorage< 16>> |
| using | Cont1_t = std::vector<AlignedStorage< 1>> |
| using | Cont2048_t = std::vector<AlignedStorage<2048>> |
| using | Cont256_t = std::vector<AlignedStorage< 256>> |
| using | Cont2_t = std::vector<AlignedStorage< 2>> |
| using | Cont32_t = std::vector<AlignedStorage< 32>> |
| using | Cont4096_t = std::vector<AlignedStorage<4096>> |
| using | Cont4_t = std::vector<AlignedStorage< 4>> |
| using | Cont512_t = std::vector<AlignedStorage< 512>> |
| using | Cont64_t = std::vector<AlignedStorage< 64>> |
| using | Cont8_t = std::vector<AlignedStorage< 8>> |
| using | Cont_t = std::vector<char> |
| using | PCont_t = Cont_t * |
Public Types inherited from TGenCollectionProxy | |
| enum | { kBIT_ISSTRING = 0x20000000 , kBIT_ISTSTRING = 0x40000000 } |
| typedef const std::type_info & | Info_t |
Public Types inherited from TVirtualCollectionProxy | |
| typedef void *(* | CopyIterator_t) (void *dest, const void *source) |
Copy the iterator source into dest. | |
| typedef void(* | CreateIterators_t) (void *collection, void **begin_arena, void **end_arena, TVirtualCollectionProxy *proxy) |
*begin_arena and *end_arena should contain the location of a memory arena of size fgIteratorArenaSize. | |
| typedef void(* | DeleteIterator_t) (void *iter) |
If the size of the iterator is greater than fgIteratorArenaSize, call delete on the addresses; otherwise, just call the iterator's destructor. | |
| typedef void(* | DeleteTwoIterators_t) (void *begin, void *end) |
| enum | EProperty { kIsAssociative = (1ULL << ( 2 )) , kIsEmulated = (1ULL << ( 3 )) , kNeedDelete = (1ULL << ( 4 )) , kCustomAlloc = (1ULL << ( 5 )) } |
| typedef void *(* | Next_t) (void *iter, const void *end) |
iter and end should be pointers to an iterator to be incremented and an iterator that points to the end of the collection, respectively. | |
Public Member Functions | |
| TEmulatedCollectionProxy (const char *cl_name, Bool_t silent) | |
| TEmulatedCollectionProxy (const TEmulatedCollectionProxy ©) | |
| ~TEmulatedCollectionProxy () override | |
| void * | Allocate (UInt_t n, Bool_t forceDelete) override |
Allocates space for storing at least n elements. | |
| void * | At (UInt_t idx) override |
Return the address of the value at index idx | |
| void | Clear (const char *opt="") override |
| Clear the container. | |
| void | Commit (void *env) override |
| Commits pending elements in a staging area (see Allocate() for more information). | |
| void | DeleteArray (void *p, Bool_t dtorOnly=kFALSE) const override |
| Execute the container array destructor. | |
| void | Destructor (void *p, Bool_t dtorOnly=kFALSE) const override |
| Execute the container destructor. | |
| TVirtualCollectionProxy * | Generate () const override |
| Returns a clean object of the actual class that derives from TVirtualCollectionProxy. | |
| 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 collection of the given size. | |
| Bool_t | IsValid () const |
| void * | New () const override |
| Construct a new container object and return its address. | |
| void * | New (void *memory) const override |
Construct a new container object at the address given by arena | |
| void * | NewArray (Int_t nElements) const override |
Construct an array of nElements container objects and return the base address of the array. | |
| void * | NewArray (Int_t nElements, void *memory) const override |
Construct an array of nElements container objects at the address given by arena | |
| TClass::ObjectPtr | NewObject () const override |
| Construct a new container object and return its address. | |
| TClass::ObjectPtr | NewObject (void *memory) const override |
Construct a new container object at the address given by arena | |
| TClass::ObjectPtr | NewObjectArray (Int_t nElements) const override |
Construct an array of nElements container objects and return the base address of the array. | |
| TClass::ObjectPtr | NewObjectArray (Int_t nElements, void *memory) const override |
Construct an array of nElements container objects at the address given by arena | |
| void | ReadBuffer (TBuffer &buff, void *pObj) override |
| void | ReadBuffer (TBuffer &buff, void *pObj, const TClass *onfile) override |
| void | Resize (UInt_t n, Bool_t force_delete) override |
| Resize the container. | |
| UInt_t | Size () const override |
| Return the current number of elements in the container. | |
| UInt_t | Sizeof () const override |
Return the sizeof() of the collection object. | |
| void | Streamer (TBuffer &buff, void *pObj, int siz) override |
| Streamer I/O overload. | |
| void | Streamer (TBuffer &refBuffer) override |
| Streamer Function. | |
| template<typename F > | |
| void | WithCont (void *obj, F &&fn) const |
| Invoke fn(typed_ptr, elemSize) where typed_ptr is the container pointer cast to the correct AlignedStorage<N>* for the value class alignment. | |
Public Member Functions inherited from TGenCollectionProxy | |
| TGenCollectionProxy (const ROOT::Detail::TCollectionProxyInfo &info, TClass *cl) | |
| Build a proxy for a collection whose type is described by 'collectionClass'. | |
| TGenCollectionProxy (const TGenCollectionProxy ©) | |
| Build a proxy for an emulated container. | |
| TGenCollectionProxy (Info_t typ, size_t iter_size) | |
| Build a proxy for a collection whose type is described by 'collectionClass'. | |
| ~TGenCollectionProxy () override | |
| Standard destructor. | |
| void * | Allocate (UInt_t n, Bool_t forceDelete) override |
| Allocate the needed space. | |
| void * | At (UInt_t idx) override |
| Return the address of the value at index 'idx'. | |
| void | Clear (const char *opt="") override |
| Clear the emulated collection. | |
| void | Commit (void *env) override |
| Commit the change. | |
| TVirtualCollectionProxy * | Generate () const override |
| Virtual copy constructor. | |
| TClass * | GetCollectionClass () const override |
| Return a pointer to the TClass representing the container. | |
| Int_t | GetCollectionType () const override |
| Return the type of collection see TClassEdit::ESTLType. | |
| TStreamerInfoActions::TActionSequence * | GetConversionReadMemberWiseActions (TClass *oldClass, Int_t version) override |
| Return the set of action necessary to stream in this collection member-wise coming from the old value class layout refered to by 'version'. | |
| CopyIterator_t | GetFunctionCopyIterator (Bool_t read=kTRUE) override |
| See typedef void (*CopyIterator_t)(void *&dest, const void *source); Copy the iterator source, into dest. | |
| CreateIterators_t | GetFunctionCreateIterators (Bool_t read=kTRUE) override |
| See typedef void (*CreateIterators_t)(void *collection, void *&begin_arena, void *&end_arena); begin_arena and end_arena should contain the location of memory arena of size fgIteratorSize. | |
| DeleteIterator_t | GetFunctionDeleteIterator (Bool_t read=kTRUE) override |
| See typedef void (*DeleteIterator_t)(void *iter); If the sizeof iterator is greater than fgIteratorArenaSize, call delete on the addresses, Otherwise just call the iterator's destructor. | |
| DeleteTwoIterators_t | GetFunctionDeleteTwoIterators (Bool_t read=kTRUE) override |
| See typedef void (*DeleteTwoIterators_t)(void *begin, void *end); If the sizeof iterator is greater than fgIteratorArenaSize, call delete on the addresses, Otherwise just call the iterator's destructor. | |
| Next_t | GetFunctionNext (Bool_t read=kTRUE) override |
| See typedef void* (*Next_t)(void *iter, void *end); iter and end should be pointer to respectively an iterator to be incremented and the result of colleciton.end() 'Next' will increment the iterator 'iter' and return 0 if the iterator reached the end. | |
| ULong_t | GetIncrement () const override |
| Return the offset between two consecutive value_types (memory layout). | |
| virtual TClass * | GetOnFileClass () const |
| TStreamerInfoActions::TActionSequence * | GetReadMemberWiseActions (Int_t version) override |
| Return the set of action necessary to stream in this collection member-wise coming from the old value class layout refered to by 'version'. | |
| EDataType | GetType () const override |
| If the content is a simple numerical value, return its type (see TDataType) | |
| TClass * | GetValueClass () const override |
| Return a pointer to the TClass representing the content. | |
| TStreamerInfoActions::TActionSequence * | GetWriteMemberWiseActions () override |
| Return the set of action necessary to stream out this collection member-wise. | |
| Bool_t | HasPointers () const override |
| Return true if the content is of type 'pointer to'. | |
| 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 collection of the given size. | |
| virtual void | operator() (TBuffer &refBuffer, void *pObject) |
| TClassStreamer IO overload. | |
| void | PopProxy () override |
| Remove the last object. | |
| void | PushProxy (void *objstart) override |
| Add an object. | |
| Bool_t | Reset () override |
| Reset the info gathered from StreamerInfos and value's TClass. | |
| virtual void | SetOnFileClass (TClass *cl) |
| UInt_t | Size () const override |
| Return the current size of the container. | |
| UInt_t | Sizeof () const override |
| Return the sizeof the collection object. | |
Public Member Functions inherited from TVirtualCollectionProxy | |
| TVirtualCollectionProxy () | |
| TVirtualCollectionProxy (TClass *cl) | |
| virtual | ~TVirtualCollectionProxy () |
| virtual Int_t | GetProperties () const |
| Return miscallenous properties of the proxy (see TVirtualCollectionProxy::EProperty) | |
| char * | operator[] (UInt_t idx) const |
Return the address of the value at index idx | |
Protected Member Functions | |
| void | Expand (UInt_t nCurr, UInt_t left) |
| TGenCollectionProxy * | InitializeEx (Bool_t silent) override |
| Proxy initializer. | |
| void | ReadItems (int nElements, TBuffer &b) |
| void | Shrink (UInt_t nCurr, UInt_t left, Bool_t force) |
| void | WriteItems (int nElements, TBuffer &b) |
Protected Member Functions inherited from TGenCollectionProxy | |
| void | CheckFunctions () const |
| Check existence of function pointers. | |
| virtual void | DeleteItem (Bool_t force, void *ptr) const |
| Call to delete/destruct individual item. | |
| TGenCollectionProxy * | Initialize (Bool_t silent) const |
| Proxy initializer. | |
Private Member Functions | |
| TEmulatedCollectionProxy & | operator= (const TEmulatedCollectionProxy &) |
Friends | |
| class | TCollectionProxy |
Additional Inherited Members | |
Static Public Attributes inherited from TVirtualCollectionProxy | |
| static const Int_t | fgIteratorArenaSize = 16 |
| The size of a small buffer that can be allocated on the stack to store iterator-specific information. | |
Protected Types inherited from TGenCollectionProxy | |
| typedef void *(* | ArrIterfunc_t) (void *from, size_t size) |
| typedef void *(* | Collectfunc_t) (void *from, void *to) |
| typedef ROOT::Detail::TCollectionProxyInfo::Environ< char[64]> | Env_t |
| typedef ROOT::Detail::TCollectionProxyInfo::EnvironBase | EnvironBase_t |
| typedef void *(* | Feedfunc_t) (void *from, void *to, size_t size) |
| typedef std::vector< EnvironBase_t * > | Proxies_t |
| typedef void(* | Sizing_t) (void *obj, size_t size) |
| typedef std::vector< TStaging * > | Staged_t |
| Collection of pre-allocated staged array for associative containers. | |
Protected Attributes inherited from TGenCollectionProxy | |
| Method | fClear |
| Method cache for container accessors: clear container. | |
| Collectfunc_t | fCollect |
| Method to collect objects from container. | |
| ArrIterfunc_t | fConstruct |
| Container accessors: block construct. | |
| std::map< std::string, TObjArray * > * | fConversionReadMemberWise |
| Array of bundle of TStreamerInfoActions to stream out (read) derived from another class. | |
| Method0 | fCreateEnv |
| Method to allocate an Environment holder. | |
| Sizing_t | fDestruct |
| Container accessors: block destruct. | |
| EnvironBase_t * | fEnv |
| Address of the currently proxied object. | |
| Feedfunc_t | fFeed |
| Container accessors: block feed. | |
| Method | fFirst |
| Container accessors: generic iteration: first. | |
| CopyIterator_t | fFunctionCopyIterator |
| CreateIterators_t | fFunctionCreateIterators |
| DeleteIterator_t | fFunctionDeleteIterator |
| DeleteTwoIterators_t | fFunctionDeleteTwoIterators |
| Next_t | fFunctionNextIterator |
| Value * | fKey |
| Descriptor of the key_type. | |
| std::string | fName |
| Name of the class being proxied. | |
| Method | fNext |
| Container accessors: generic iteration: next. | |
| TClass * | fOnFileClass |
| On file class. | |
| Bool_t | fPointers |
| Flag to indicate if containee has pointers (key or value) | |
| Proxies_t | fProxyKept |
| Optimization: Keep proxies once they were created. | |
| Proxies_t | fProxyList |
| Stack of recursive proxies. | |
| TObjArray * | fReadMemberWise |
| Array of bundle of TStreamerInfoActions to stream out (read) | |
| Sizing_t | fResize |
| Container accessors: resize container. | |
| Method | fSize |
| Container accessors: size of container. | |
| Staged_t | fStaged |
| Optimization: Keep staged array once they were created. | |
| int | fSTL_type |
| STL container type. | |
| Info_t | fTypeinfo |
| Type information. | |
| Value * | fVal |
| Descriptor of the Value_type. | |
| int | fValDiff |
| Offset between two consecutive value_types (memory layout). | |
| int | fValOffset |
| Offset from key to value (in maps) | |
| std::atomic< Value * > | fValue |
| Descriptor of the container value type. | |
| TStreamerInfoActions::TActionSequence * | fWriteMemberWise |
Protected Attributes inherited from TVirtualCollectionProxy | |
| TClassRef | fClass |
| UInt_t | fProperties |
#include <TEmulatedCollectionProxy.h>
| using TEmulatedCollectionProxy::Cont1024_t = std::vector<AlignedStorage<1024>> |
Definition at line 44 of file TEmulatedCollectionProxy.h.
| using TEmulatedCollectionProxy::Cont128_t = std::vector<AlignedStorage< 128>> |
Definition at line 41 of file TEmulatedCollectionProxy.h.
| using TEmulatedCollectionProxy::Cont16_t = std::vector<AlignedStorage< 16>> |
Definition at line 38 of file TEmulatedCollectionProxy.h.
| using TEmulatedCollectionProxy::Cont1_t = std::vector<AlignedStorage< 1>> |
Definition at line 34 of file TEmulatedCollectionProxy.h.
| using TEmulatedCollectionProxy::Cont2048_t = std::vector<AlignedStorage<2048>> |
Definition at line 45 of file TEmulatedCollectionProxy.h.
| using TEmulatedCollectionProxy::Cont256_t = std::vector<AlignedStorage< 256>> |
Definition at line 42 of file TEmulatedCollectionProxy.h.
| using TEmulatedCollectionProxy::Cont2_t = std::vector<AlignedStorage< 2>> |
Definition at line 35 of file TEmulatedCollectionProxy.h.
| using TEmulatedCollectionProxy::Cont32_t = std::vector<AlignedStorage< 32>> |
Definition at line 39 of file TEmulatedCollectionProxy.h.
| using TEmulatedCollectionProxy::Cont4096_t = std::vector<AlignedStorage<4096>> |
Definition at line 46 of file TEmulatedCollectionProxy.h.
| using TEmulatedCollectionProxy::Cont4_t = std::vector<AlignedStorage< 4>> |
Definition at line 36 of file TEmulatedCollectionProxy.h.
| using TEmulatedCollectionProxy::Cont512_t = std::vector<AlignedStorage< 512>> |
Definition at line 43 of file TEmulatedCollectionProxy.h.
| using TEmulatedCollectionProxy::Cont64_t = std::vector<AlignedStorage< 64>> |
Definition at line 40 of file TEmulatedCollectionProxy.h.
| using TEmulatedCollectionProxy::Cont8_t = std::vector<AlignedStorage< 8>> |
Definition at line 37 of file TEmulatedCollectionProxy.h.
| using TEmulatedCollectionProxy::Cont_t = std::vector<char> |
Definition at line 50 of file TEmulatedCollectionProxy.h.
| using TEmulatedCollectionProxy::PCont_t = Cont_t * |
Definition at line 51 of file TEmulatedCollectionProxy.h.
| TEmulatedCollectionProxy::TEmulatedCollectionProxy | ( | const TEmulatedCollectionProxy & | copy | ) |
Definition at line 43 of file TEmulatedCollectionProxy.cxx.
Definition at line 50 of file TEmulatedCollectionProxy.cxx.
|
override |
Definition at line 62 of file TEmulatedCollectionProxy.cxx.
Allocates space for storing at least n elements.
This function returns a pointer to the actual object on which insertions should take place. For associative collections, this function returns a pointer to a temporary buffer known as the staging area. If the insertion happened in a staging area (i.e. the returned pointer != proxied object), Commit() should be called on the value returned by this function.
Implements TVirtualCollectionProxy.
Definition at line 491 of file TEmulatedCollectionProxy.cxx.
|
overridevirtual |
Return the address of the value at index idx
Implements TVirtualCollectionProxy.
Reimplemented in TEmulatedMapProxy.
Definition at line 476 of file TEmulatedCollectionProxy.cxx.
|
overridevirtual |
Clear the container.
Implements TVirtualCollectionProxy.
Definition at line 261 of file TEmulatedCollectionProxy.cxx.
|
overridevirtual |
Commits pending elements in a staging area (see Allocate() for more information).
Implements TVirtualCollectionProxy.
Definition at line 508 of file TEmulatedCollectionProxy.cxx.
|
overridevirtual |
Execute the container array destructor.
Reimplemented from TVirtualCollectionProxy.
Definition at line 100 of file TEmulatedCollectionProxy.cxx.
|
overridevirtual |
Execute the container destructor.
Reimplemented from TVirtualCollectionProxy.
Definition at line 78 of file TEmulatedCollectionProxy.cxx.
Definition at line 374 of file TEmulatedCollectionProxy.cxx.
|
overridevirtual |
Returns a clean object of the actual class that derives from TVirtualCollectionProxy.
The caller is responsible for deleting the returned object.
Implements TVirtualCollectionProxy.
Reimplemented in TEmulatedMapProxy.
Definition at line 70 of file TEmulatedCollectionProxy.cxx.
|
overrideprotectedvirtual |
Proxy initializer.
Reimplemented from TGenCollectionProxy.
Definition at line 112 of file TEmulatedCollectionProxy.cxx.
|
overridevirtual |
Insert data into the container where data is a C-style array of the actual type contained in the collection of the given size.
For associative container (map, etc.), the data type is the pair<key,value>.
Implements TVirtualCollectionProxy.
Definition at line 503 of file TEmulatedCollectionProxy.cxx.
| Bool_t TEmulatedCollectionProxy::IsValid | ( | ) | const |
Definition at line 244 of file TEmulatedCollectionProxy.cxx.
|
inlineoverridevirtual |
Construct a new container object and return its address.
Reimplemented from TVirtualCollectionProxy.
Definition at line 144 of file TEmulatedCollectionProxy.h.
|
inlineoverridevirtual |
Construct a new container object at the address given by arena
Reimplemented from TVirtualCollectionProxy.
Definition at line 152 of file TEmulatedCollectionProxy.h.
|
inlineoverridevirtual |
Construct an array of nElements container objects and return the base address of the array.
Reimplemented from TVirtualCollectionProxy.
Definition at line 165 of file TEmulatedCollectionProxy.h.
|
inlineoverridevirtual |
Construct an array of nElements container objects at the address given by arena
Reimplemented from TVirtualCollectionProxy.
Definition at line 175 of file TEmulatedCollectionProxy.h.
|
inlineoverridevirtual |
Construct a new container object and return its address.
Reimplemented from TVirtualCollectionProxy.
Definition at line 159 of file TEmulatedCollectionProxy.h.
|
inlineoverridevirtual |
Construct a new container object at the address given by arena
Reimplemented from TVirtualCollectionProxy.
Definition at line 162 of file TEmulatedCollectionProxy.h.
|
inlineoverridevirtual |
Construct an array of nElements container objects and return the base address of the array.
Reimplemented from TVirtualCollectionProxy.
Definition at line 184 of file TEmulatedCollectionProxy.h.
|
inlineoverridevirtual |
Construct an array of nElements container objects at the address given by arena
Reimplemented from TVirtualCollectionProxy.
Definition at line 187 of file TEmulatedCollectionProxy.h.
|
private |
|
overridevirtual |
Reimplemented from TGenCollectionProxy.
Reimplemented in TEmulatedMapProxy.
Definition at line 614 of file TEmulatedCollectionProxy.cxx.
|
overridevirtual |
Reimplemented from TGenCollectionProxy.
Reimplemented in TEmulatedMapProxy.
Definition at line 606 of file TEmulatedCollectionProxy.cxx.
Definition at line 512 of file TEmulatedCollectionProxy.cxx.
Resize the container.
Reimplemented from TGenCollectionProxy.
Definition at line 455 of file TEmulatedCollectionProxy.cxx.
Definition at line 267 of file TEmulatedCollectionProxy.cxx.
|
overridevirtual |
Return the current number of elements in the container.
Implements TVirtualCollectionProxy.
Reimplemented in TEmulatedMapProxy.
Definition at line 250 of file TEmulatedCollectionProxy.cxx.
|
inlineoverridevirtual |
Return the sizeof() of the collection object.
Implements TVirtualCollectionProxy.
Definition at line 199 of file TEmulatedCollectionProxy.h.
|
inlineoverridevirtual |
Streamer I/O overload.
Reimplemented from TGenCollectionProxy.
Reimplemented in TEmulatedMapProxy.
Definition at line 231 of file TEmulatedCollectionProxy.h.
|
overridevirtual |
Streamer Function.
Reimplemented from TGenCollectionProxy.
Reimplemented in TEmulatedMapProxy.
Definition at line 629 of file TEmulatedCollectionProxy.cxx.
Invoke fn(typed_ptr, elemSize) where typed_ptr is the container pointer cast to the correct AlignedStorage<N>* for the value class alignment.
fn receives the element size (N) as a second argument so it can convert byte counts to element counts.
Definition at line 58 of file TEmulatedCollectionProxy.h.
Definition at line 561 of file TEmulatedCollectionProxy.cxx.
|
friend |
Definition at line 23 of file TEmulatedCollectionProxy.h.