ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Friends | List of all members
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 16 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, kBOOL_t = 21 }
 
typedef const std::type_info & Info_t
 
- Public Types inherited from TVirtualCollectionProxy
enum  EProperty { kIsAssociative = BIT(2), kIsEmulated = BIT(3), kNeedDelete = BIT(4) }
 
typedef void(* CreateIterators_t )(void *collection, void **begin_arena, void **end_arena, TVirtualCollectionProxy *proxy)
 
typedef void *(* CopyIterator_t )(void *dest, const void *source)
 
typedef void *(* Next_t )(void *iter, const void *end)
 
typedef void(* DeleteIterator_t )(void *iter)
 
typedef void(* DeleteTwoIterators_t )(void *begin, void *end)
 

Public Member Functions

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

virtual TGenCollectionProxyInitializeEx (Bool_t silent)
 Proxy initializer. More...
 
void ReadItems (int nElements, TBuffer &b)
 
void WriteItems (int nElements, TBuffer &b)
 
void Shrink (UInt_t nCurr, UInt_t left, Bool_t force)
 
void Expand (UInt_t nCurr, UInt_t left)
 
- Protected Member Functions inherited from TGenCollectionProxy
TGenCollectionProxyInitialize (Bool_t silent) const
 Proxy initializer. More...
 
virtual void DeleteItem (Bool_t force, void *ptr) const
 Call to delete/destruct individual item. More...
 
void CheckFunctions () const
 Check existence of function pointers. More...
 
virtual void UpdateValueClass (const TClass *oldcl, TClass *newcl)
 Update the internal ValueClass when a TClass constructor need to replace an emulated TClass by the real TClass. More...
 

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
ROOT::Detail::TCollectionProxyInfo::Environ
< char[64]> 
Env_t
 
typedef
ROOT::Detail::TCollectionProxyInfo::EnvironBase 
EnvironBase_t
 
typedef std::vector< TStaging * > Staged_t
 Collection of pre-allocated staged array for associative containers. More...
 
typedef std::vector
< EnvironBase_t * > 
Proxies_t
 
typedef void(* Sizing_t )(void *obj, size_t size)
 
typedef void *(* Feedfunc_t )(void *from, void *to, size_t size)
 
typedef void *(* Collectfunc_t )(void *from, void *to)
 
typedef void *(* ArrIterfunc_t )(void *from, size_t size)
 
- Protected Attributes inherited from TGenCollectionProxy
TObjArrayfReadMemberWise
 Array of bundle of TStreamerInfoActions to stream out (read) More...
 
std::map< std::string,
TObjArray * > * 
fConversionReadMemberWise
 Array of bundle of TStreamerInfoActions to stream out (read) derived from another class. More...
 
TStreamerInfoActions::TActionSequencefWriteMemberWise
 
std::string fName
 Name of the class being proxied. More...
 
Bool_t fPointers
 Flag to indicate if containee has pointers (key or value) More...
 
Method fClear
 Method cache for container accessors: clear container. More...
 
Method fSize
 Container accessors: size of container. More...
 
Sizing_t fResize
 Container accessors: resize container. More...
 
Method fFirst
 Container accessors: generic iteration: first. More...
 
Method fNext
 Container accessors: generic iteration: next. More...
 
ArrIterfunc_t fConstruct
 Container accessors: block construct. More...
 
Sizing_t fDestruct
 Container accessors: block destruct. More...
 
Feedfunc_t fFeed
 Container accessors: block feed. More...
 
Collectfunc_t fCollect
 Method to collect objects from container. More...
 
Method0 fCreateEnv
 Method to allocate an Environment holder. More...
 
std::atomic< Value * > fValue
 Descriptor of the container value type. More...
 
ValuefVal
 Descriptor of the Value_type. More...
 
ValuefKey
 Descriptor of the key_type. More...
 
EnvironBase_tfEnv
 Address of the currently proxied object. More...
 
int fValOffset
 Offset from key to value (in maps) More...
 
int fValDiff
 Offset between two consecutive value_types (memory layout). More...
 
Proxies_t fProxyList
 Stack of recursive proxies. More...
 
Proxies_t fProxyKept
 Optimization: Keep proxies once they were created. More...
 
Staged_t fStaged
 Optimization: Keep staged array once they were created. More...
 
int fSTL_type
 STL container type. More...
 
Info_t fTypeinfo
 Type information. More...
 
TClassfOnFileClass
 On file class. More...
 
CreateIterators_t fFunctionCreateIterators
 
CopyIterator_t fFunctionCopyIterator
 
Next_t fFunctionNextIterator
 
DeleteIterator_t fFunctionDeleteIterator
 
DeleteTwoIterators_t fFunctionDeleteTwoIterators
 
- Protected Attributes inherited from TVirtualCollectionProxy
TClassRef fClass
 
UInt_t fProperties
 

#include <TEmulatedCollectionProxy.h>

Inheritance diagram for TEmulatedCollectionProxy:
[legend]

Member Typedef Documentation

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

Definition at line 23 of file TEmulatedCollectionProxy.h.

Definition at line 25 of file TEmulatedCollectionProxy.h.

Constructor & Destructor Documentation

TEmulatedCollectionProxy::TEmulatedCollectionProxy ( const TEmulatedCollectionProxy copy)

Definition at line 45 of file TEmulatedCollectionProxy.cxx.

Referenced by Generate().

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

Definition at line 52 of file TEmulatedCollectionProxy.cxx.

TEmulatedCollectionProxy::~TEmulatedCollectionProxy ( )
virtual

Definition at line 64 of file TEmulatedCollectionProxy.cxx.

Member Function Documentation

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 442 of file TEmulatedCollectionProxy.cxx.

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 427 of file TEmulatedCollectionProxy.cxx.

Referenced by ReadItems(), and WriteItems().

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

Clear the emulated collection.

Reimplemented from TGenCollectionProxy.

Definition at line 216 of file TEmulatedCollectionProxy.cxx.

Referenced by Destructor(), and ~TEmulatedCollectionProxy().

void TEmulatedCollectionProxy::Commit ( void env)
virtual

Commit the change.

Reimplemented from TGenCollectionProxy.

Definition at line 459 of file TEmulatedCollectionProxy.cxx.

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

Reimplemented from TVirtualCollectionProxy.

Definition at line 99 of file TEmulatedCollectionProxy.cxx.

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

Reimplemented from TVirtualCollectionProxy.

Definition at line 80 of file TEmulatedCollectionProxy.cxx.

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

Definition at line 327 of file TEmulatedCollectionProxy.cxx.

Referenced by Resize().

TVirtualCollectionProxy * TEmulatedCollectionProxy::Generate ( ) const
virtual

Virtual copy constructor.

Reimplemented from TGenCollectionProxy.

Reimplemented in TEmulatedMapProxy.

Definition at line 72 of file TEmulatedCollectionProxy.cxx.

TGenCollectionProxy * TEmulatedCollectionProxy::InitializeEx ( Bool_t  silent)
protectedvirtual

Proxy initializer.

Reimplemented from TGenCollectionProxy.

Definition at line 111 of file TEmulatedCollectionProxy.cxx.

Referenced by TEmulatedCollectionProxy().

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 454 of file TEmulatedCollectionProxy.cxx.

Bool_t TEmulatedCollectionProxy::IsValid ( ) const

Definition at line 199 of file TEmulatedCollectionProxy.cxx.

virtual void* TEmulatedCollectionProxy::New ( ) const
inlinevirtual

Reimplemented from TVirtualCollectionProxy.

Definition at line 60 of file TEmulatedCollectionProxy.h.

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

Reimplemented from TVirtualCollectionProxy.

Definition at line 63 of file TEmulatedCollectionProxy.h.

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

Reimplemented from TVirtualCollectionProxy.

Definition at line 66 of file TEmulatedCollectionProxy.h.

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

Reimplemented from TVirtualCollectionProxy.

Definition at line 69 of file TEmulatedCollectionProxy.h.

TEmulatedCollectionProxy& TEmulatedCollectionProxy::operator= ( const TEmulatedCollectionProxy )
private
void TEmulatedCollectionProxy::ReadBuffer ( TBuffer buff,
void pObj 
)
virtual

Reimplemented from TGenCollectionProxy.

Reimplemented in TEmulatedMapProxy.

Definition at line 567 of file TEmulatedCollectionProxy.cxx.

Referenced by ReadBuffer().

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

Reimplemented from TGenCollectionProxy.

Reimplemented in TEmulatedMapProxy.

Definition at line 559 of file TEmulatedCollectionProxy.cxx.

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

Definition at line 463 of file TEmulatedCollectionProxy.cxx.

Referenced by ReadBuffer(), and Streamer().

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

Resize the container.

Reimplemented from TGenCollectionProxy.

Definition at line 406 of file TEmulatedCollectionProxy.cxx.

Referenced by Allocate(), Clear(), TEmulatedMapProxy::ReadBuffer(), ReadBuffer(), TEmulatedMapProxy::Streamer(), and Streamer().

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

Definition at line 222 of file TEmulatedCollectionProxy.cxx.

Referenced by Resize().

UInt_t TEmulatedCollectionProxy::Size ( ) const
virtual

Return the current size of the container.

Reimplemented from TGenCollectionProxy.

Reimplemented in TEmulatedMapProxy.

Definition at line 205 of file TEmulatedCollectionProxy.cxx.

Referenced by Resize(), and Streamer().

virtual UInt_t TEmulatedCollectionProxy::Sizeof ( ) const
inlinevirtual

Return the sizeof the collection object.

Reimplemented from TGenCollectionProxy.

Definition at line 78 of file TEmulatedCollectionProxy.h.

void TEmulatedCollectionProxy::Streamer ( TBuffer refBuffer)
virtual

Streamer Function.

Reimplemented from TGenCollectionProxy.

Reimplemented in TEmulatedMapProxy.

Definition at line 582 of file TEmulatedCollectionProxy.cxx.

Referenced by TEmulatedMapProxy::Streamer(), and WriteItems().

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

Streamer I/O overload.

Reimplemented from TGenCollectionProxy.

Reimplemented in TEmulatedMapProxy.

Definition at line 110 of file TEmulatedCollectionProxy.h.

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

Definition at line 513 of file TEmulatedCollectionProxy.cxx.

Referenced by Streamer().

Friends And Related Function Documentation

friend class TCollectionProxy
friend

Definition at line 19 of file TEmulatedCollectionProxy.h.

Collaboration diagram for TEmulatedCollectionProxy:
[legend]

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