Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TEmulatedCollectionProxy Class Reference

Streamer around an arbitrary STL like container, which implements basic container functionality.

Note:

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 18 of file TEmulatedCollectionProxy.h.

Public Types

typedef std::vector< char > Cont_t
 
typedef Cont_tPCont_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)
 
typedef void(* CreateIterators_t) (void *collection, void **begin_arena, void **end_arena, TVirtualCollectionProxy *proxy)
 
typedef void(* DeleteIterator_t) (void *iter)
 
typedef void(* DeleteTwoIterators_t) (void *begin, void *end)
 
enum  EProperty { kIsAssociative = BIT(2) , kIsEmulated = BIT(3) , kNeedDelete = BIT(4) , kCustomAlloc = BIT(5) }
 
typedef void *(* Next_t) (void *iter, const void *end)
 

Public Member Functions

 TEmulatedCollectionProxy (const char *cl_name, Bool_t silent)
 
 TEmulatedCollectionProxy (const TEmulatedCollectionProxy &copy)
 
virtual ~TEmulatedCollectionProxy ()
 
virtual voidAllocate (UInt_t n, Bool_t forceDelete)
 Allocate the needed space.
 
virtual voidAt (UInt_t idx)
 Return the address of the value at index 'idx'.
 
virtual void Clear (const char *opt="")
 Clear the emulated collection.
 
virtual void Commit (void *env)
 Commit the change.
 
virtual void DeleteArray (void *p, Bool_t dtorOnly=kFALSE) const
 
virtual void Destructor (void *p, Bool_t dtorOnly=kFALSE) const
 
virtual TVirtualCollectionProxyGenerate () const
 Virtual copy constructor.
 
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 collection of the given size.
 
Bool_t IsValid () const
 
virtual voidNew () const
 
virtual voidNew (void *memory) const
 
virtual voidNewArray (Int_t nElements) const
 
virtual voidNewArray (Int_t nElements, void *memory) const
 
virtual TClass::ObjectPtr NewObject () const
 
virtual TClass::ObjectPtr NewObject (void *memory) const
 
virtual TClass::ObjectPtr NewObjectArray (Int_t nElements) const
 
virtual TClass::ObjectPtr NewObjectArray (Int_t nElements, void *memory) const
 
virtual void ReadBuffer (TBuffer &buff, void *pObj)
 
virtual void ReadBuffer (TBuffer &buff, void *pObj, const TClass *onfile)
 
virtual void Resize (UInt_t n, Bool_t force_delete)
 Resize the container.
 
virtual UInt_t Size () const
 Return the current size of the container.
 
virtual UInt_t Sizeof () const
 Return the sizeof the collection object.
 
virtual void Streamer (TBuffer &buff, void *pObj, int siz)
 Streamer I/O overload.
 
virtual void Streamer (TBuffer &refBuffer)
 Streamer Function.
 
- 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 &copy)
 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'.
 
virtual ~TGenCollectionProxy ()
 Standard destructor.
 
virtual TClassGetCollectionClass () const
 Return a pointer to the TClass representing the container.
 
virtual Int_t GetCollectionType () const
 Return the type of collection see TClassEdit::ESTLType.
 
virtual TStreamerInfoActions::TActionSequenceGetConversionReadMemberWiseActions (TClass *oldClass, Int_t version)
 Return the set of action necessary to stream in this collection member-wise coming from the old value class layout refered to by 'version'.
 
virtual CopyIterator_t GetFunctionCopyIterator (Bool_t read=kTRUE)
 See typedef void (*CopyIterator_t)(void *&dest, const void *source); Copy the iterator source, into dest.
 
virtual CreateIterators_t GetFunctionCreateIterators (Bool_t read=kTRUE)
 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.
 
virtual DeleteIterator_t GetFunctionDeleteIterator (Bool_t read=kTRUE)
 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.
 
virtual DeleteTwoIterators_t GetFunctionDeleteTwoIterators (Bool_t read=kTRUE)
 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.
 
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 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.
 
virtual ULong_t GetIncrement () const
 Return the offset between two consecutive value_types (memory layout).
 
virtual TClassGetOnFileClass () const
 
virtual TStreamerInfoActions::TActionSequenceGetReadMemberWiseActions (Int_t version)
 Return the set of action necessary to stream in this collection member-wise coming from the old value class layout refered to by 'version'.
 
virtual EDataType GetType () const
 If the content is a simple numerical value, return its type (see TDataType)
 
virtual TClassGetValueClass () const
 Return a pointer to the TClass representing the content.
 
virtual TStreamerInfoActions::TActionSequenceGetWriteMemberWiseActions ()
 Return the set of action necessary to stream out this collection member-wise.
 
virtual Bool_t HasPointers () const
 Return true if the content is of type 'pointer to'.
 
virtual void operator() (TBuffer &refBuffer, void *pObject)
 TClassStreamer IO overload.
 
virtual void PopProxy ()
 Remove the last object.
 
virtual void PushProxy (void *objstart)
 Add an object.
 
virtual Bool_t Reset ()
 Reset the info gathered from StreamerInfos and value's TClass.
 
virtual void SetOnFileClass (TClass *cl)
 
- Public Member Functions inherited from TVirtualCollectionProxy
 TVirtualCollectionProxy ()
 
 TVirtualCollectionProxy (TClass *cl)
 
virtual ~TVirtualCollectionProxy ()
 
virtual Int_t GetProperties () const
 
char * operator[] (UInt_t idx) const
 

Protected Member Functions

void Expand (UInt_t nCurr, UInt_t left)
 
virtual TGenCollectionProxyInitializeEx (Bool_t silent)
 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.
 
TGenCollectionProxyInitialize (Bool_t silent) const
 Proxy initializer.
 

Private Member Functions

TEmulatedCollectionProxyoperator= (const TEmulatedCollectionProxy &)
 

Friends

class TCollectionProxy
 

Additional Inherited Members

- Static Public Attributes inherited from TVirtualCollectionProxy
static const Int_t fgIteratorArenaSize = 16
 
- 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_tfEnv
 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
 
ValuefKey
 Descriptor of the key_type.
 
std::string fName
 Name of the class being proxied.
 
Method fNext
 Container accessors: generic iteration: next.
 
TClassfOnFileClass
 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.
 
TObjArrayfReadMemberWise
 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.
 
ValuefVal
 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::TActionSequencefWriteMemberWise
 
- Protected Attributes inherited from TVirtualCollectionProxy
TClassRef fClass
 
UInt_t fProperties
 

#include <TEmulatedCollectionProxy.h>

Inheritance diagram for TEmulatedCollectionProxy:
[legend]

Member Typedef Documentation

◆ Cont_t

typedef std::vector<char> TEmulatedCollectionProxy::Cont_t

Definition at line 25 of file TEmulatedCollectionProxy.h.

◆ PCont_t

Constructor & Destructor Documentation

◆ TEmulatedCollectionProxy() [1/2]

TEmulatedCollectionProxy::TEmulatedCollectionProxy ( const TEmulatedCollectionProxy copy)

Definition at line 43 of file TEmulatedCollectionProxy.cxx.

◆ TEmulatedCollectionProxy() [2/2]

TEmulatedCollectionProxy::TEmulatedCollectionProxy ( const char *  cl_name,
Bool_t  silent 
)

Definition at line 50 of file TEmulatedCollectionProxy.cxx.

◆ ~TEmulatedCollectionProxy()

TEmulatedCollectionProxy::~TEmulatedCollectionProxy ( )
virtual

Definition at line 62 of file TEmulatedCollectionProxy.cxx.

Member Function Documentation

◆ Allocate()

void * TEmulatedCollectionProxy::Allocate ( UInt_t  n,
Bool_t  forceDelete 
)
virtual

Allocate the needed space.

For associative collection, this returns a TStaging object that need to be deleted manually or returned by calling Commit(TStaging*)

Reimplemented from TGenCollectionProxy.

Definition at line 486 of file TEmulatedCollectionProxy.cxx.

◆ At()

void * TEmulatedCollectionProxy::At ( UInt_t  idx)
virtual

Return the address of the value at index 'idx'.

Reimplemented from TGenCollectionProxy.

Reimplemented in TEmulatedMapProxy.

Definition at line 471 of file TEmulatedCollectionProxy.cxx.

◆ Clear()

void TEmulatedCollectionProxy::Clear ( const char *  opt = "")
virtual

Clear the emulated collection.

Reimplemented from TGenCollectionProxy.

Definition at line 260 of file TEmulatedCollectionProxy.cxx.

◆ Commit()

void TEmulatedCollectionProxy::Commit ( void env)
virtual

Commit the change.

Reimplemented from TGenCollectionProxy.

Definition at line 503 of file TEmulatedCollectionProxy.cxx.

◆ DeleteArray()

void TEmulatedCollectionProxy::DeleteArray ( void p,
Bool_t  dtorOnly = kFALSE 
) const
virtual

Reimplemented from TVirtualCollectionProxy.

Definition at line 97 of file TEmulatedCollectionProxy.cxx.

◆ Destructor()

void TEmulatedCollectionProxy::Destructor ( void p,
Bool_t  dtorOnly = kFALSE 
) const
virtual

Reimplemented from TVirtualCollectionProxy.

Definition at line 78 of file TEmulatedCollectionProxy.cxx.

◆ Expand()

void TEmulatedCollectionProxy::Expand ( UInt_t  nCurr,
UInt_t  left 
)
protected

Definition at line 371 of file TEmulatedCollectionProxy.cxx.

◆ Generate()

TVirtualCollectionProxy * TEmulatedCollectionProxy::Generate ( ) const
virtual

Virtual copy constructor.

Reimplemented from TGenCollectionProxy.

Reimplemented in TEmulatedMapProxy.

Definition at line 70 of file TEmulatedCollectionProxy.cxx.

◆ InitializeEx()

TGenCollectionProxy * TEmulatedCollectionProxy::InitializeEx ( Bool_t  silent)
protectedvirtual

Proxy initializer.

Reimplemented from TGenCollectionProxy.

Definition at line 109 of file TEmulatedCollectionProxy.cxx.

◆ Insert()

void TEmulatedCollectionProxy::Insert ( const void data,
void container,
size_t  size 
)
virtual

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>.

Reimplemented from TGenCollectionProxy.

Definition at line 498 of file TEmulatedCollectionProxy.cxx.

◆ IsValid()

Bool_t TEmulatedCollectionProxy::IsValid ( ) const

Definition at line 243 of file TEmulatedCollectionProxy.cxx.

◆ New() [1/2]

virtual void * TEmulatedCollectionProxy::New ( ) const
inlinevirtual

Reimplemented from TVirtualCollectionProxy.

Definition at line 62 of file TEmulatedCollectionProxy.h.

◆ New() [2/2]

virtual void * TEmulatedCollectionProxy::New ( void memory) const
inlinevirtual

Reimplemented from TVirtualCollectionProxy.

Definition at line 65 of file TEmulatedCollectionProxy.h.

◆ NewArray() [1/2]

virtual void * TEmulatedCollectionProxy::NewArray ( Int_t  nElements) const
inlinevirtual

Reimplemented from TVirtualCollectionProxy.

Definition at line 74 of file TEmulatedCollectionProxy.h.

◆ NewArray() [2/2]

virtual void * TEmulatedCollectionProxy::NewArray ( Int_t  nElements,
void memory 
) const
inlinevirtual

Reimplemented from TVirtualCollectionProxy.

Definition at line 77 of file TEmulatedCollectionProxy.h.

◆ NewObject() [1/2]

virtual TClass::ObjectPtr TEmulatedCollectionProxy::NewObject ( ) const
inlinevirtual

Reimplemented from TVirtualCollectionProxy.

Definition at line 68 of file TEmulatedCollectionProxy.h.

◆ NewObject() [2/2]

virtual TClass::ObjectPtr TEmulatedCollectionProxy::NewObject ( void memory) const
inlinevirtual

Reimplemented from TVirtualCollectionProxy.

Definition at line 71 of file TEmulatedCollectionProxy.h.

◆ NewObjectArray() [1/2]

virtual TClass::ObjectPtr TEmulatedCollectionProxy::NewObjectArray ( Int_t  nElements) const
inlinevirtual

Reimplemented from TVirtualCollectionProxy.

Definition at line 80 of file TEmulatedCollectionProxy.h.

◆ NewObjectArray() [2/2]

virtual TClass::ObjectPtr TEmulatedCollectionProxy::NewObjectArray ( Int_t  nElements,
void memory 
) const
inlinevirtual

Reimplemented from TVirtualCollectionProxy.

Definition at line 83 of file TEmulatedCollectionProxy.h.

◆ operator=()

TEmulatedCollectionProxy & TEmulatedCollectionProxy::operator= ( const TEmulatedCollectionProxy )
private

◆ ReadBuffer() [1/2]

void TEmulatedCollectionProxy::ReadBuffer ( TBuffer buff,
void pObj 
)
virtual

Reimplemented from TGenCollectionProxy.

Reimplemented in TEmulatedMapProxy.

Definition at line 609 of file TEmulatedCollectionProxy.cxx.

◆ ReadBuffer() [2/2]

void TEmulatedCollectionProxy::ReadBuffer ( TBuffer buff,
void pObj,
const TClass onfile 
)
virtual

Reimplemented from TGenCollectionProxy.

Reimplemented in TEmulatedMapProxy.

Definition at line 601 of file TEmulatedCollectionProxy.cxx.

◆ ReadItems()

void TEmulatedCollectionProxy::ReadItems ( int  nElements,
TBuffer b 
)
protected

Definition at line 507 of file TEmulatedCollectionProxy.cxx.

◆ Resize()

void TEmulatedCollectionProxy::Resize ( UInt_t  n,
Bool_t  force_delete 
)
virtual

Resize the container.

Reimplemented from TGenCollectionProxy.

Definition at line 450 of file TEmulatedCollectionProxy.cxx.

◆ Shrink()

void TEmulatedCollectionProxy::Shrink ( UInt_t  nCurr,
UInt_t  left,
Bool_t  force 
)
protected

Definition at line 266 of file TEmulatedCollectionProxy.cxx.

◆ Size()

UInt_t TEmulatedCollectionProxy::Size ( ) const
virtual

Return the current size of the container.

Reimplemented from TGenCollectionProxy.

Reimplemented in TEmulatedMapProxy.

Definition at line 249 of file TEmulatedCollectionProxy.cxx.

◆ Sizeof()

virtual UInt_t TEmulatedCollectionProxy::Sizeof ( ) const
inlinevirtual

Return the sizeof the collection object.

Reimplemented from TGenCollectionProxy.

Definition at line 92 of file TEmulatedCollectionProxy.h.

◆ Streamer() [1/2]

virtual void TEmulatedCollectionProxy::Streamer ( TBuffer refBuffer,
void pObject,
int  siz 
)
inlinevirtual

Streamer I/O overload.

Reimplemented from TGenCollectionProxy.

Reimplemented in TEmulatedMapProxy.

Definition at line 124 of file TEmulatedCollectionProxy.h.

◆ Streamer() [2/2]

void TEmulatedCollectionProxy::Streamer ( TBuffer refBuffer)
virtual

Streamer Function.

Reimplemented from TGenCollectionProxy.

Reimplemented in TEmulatedMapProxy.

Definition at line 624 of file TEmulatedCollectionProxy.cxx.

◆ WriteItems()

void TEmulatedCollectionProxy::WriteItems ( int  nElements,
TBuffer b 
)
protected

Definition at line 556 of file TEmulatedCollectionProxy.cxx.

Friends And Related Symbol Documentation

◆ TCollectionProxy

friend class TCollectionProxy
friend

Definition at line 21 of file TEmulatedCollectionProxy.h.

Libraries for TEmulatedCollectionProxy:

The documentation for this class was generated from the following files: