#ifndef Root_TVirtualCollectionProxy
#define Root_TVirtualCollectionProxy
#include "TClassRef.h"
#include "TDataType.h"
class TClass;
class TVirtualCollectionProxy {
private:
TVirtualCollectionProxy(const TVirtualCollectionProxy&);
TVirtualCollectionProxy& operator=(const TVirtualCollectionProxy&);
protected:
TClassRef fClass;
virtual void SetValueClass(TClass *newcl) = 0;
friend class TClass;
public:
class TPushPop {
public:
TVirtualCollectionProxy *fProxy;
inline TPushPop(TVirtualCollectionProxy *proxy,
void *objectstart) : fProxy(proxy) { fProxy->PushProxy(objectstart); }
inline ~TPushPop() { fProxy->PopProxy(); }
private:
TPushPop(const TPushPop&);
TPushPop& operator=(const TPushPop&);
};
TVirtualCollectionProxy() : fClass() {};
TVirtualCollectionProxy(TClass *cl) : fClass(cl) {};
virtual TVirtualCollectionProxy* Generate() const = 0;
virtual ~TVirtualCollectionProxy() {};
virtual TClass *GetCollectionClass() { return fClass; }
virtual void *New() const {
return fClass.GetClass()==0 ? 0 : fClass->New();
}
virtual void *New(void *arena) const {
return fClass.GetClass()==0 ? 0 : fClass->New(arena);
}
virtual void *NewArray(Int_t nElements) const {
return fClass.GetClass()==0 ? 0 : fClass->NewArray(nElements);
}
virtual void *NewArray(Int_t nElements, void *arena) const {
return fClass.GetClass()==0 ? 0 : fClass->NewArray(nElements, arena);
}
virtual void Destructor(void *p, Bool_t dtorOnly = kFALSE) {
TClass* cl = fClass.GetClass();
if (cl) cl->Destructor(p, dtorOnly);
}
virtual void DeleteArray(void *p, Bool_t dtorOnly = kFALSE) {
TClass* cl = fClass.GetClass();
if (cl) cl->DeleteArray(p, dtorOnly);
}
virtual UInt_t Sizeof() const = 0;
virtual void PushProxy(void *objectstart) = 0;
virtual void PopProxy() = 0;
virtual Bool_t HasPointers() const = 0;
virtual TClass *GetValueClass() = 0;
virtual EDataType GetType() = 0;
virtual void *At(UInt_t idx) = 0;
virtual void Clear(const char *opt = "") = 0;
virtual UInt_t Size() const = 0;
virtual void* Allocate(UInt_t n, Bool_t forceDelete) = 0;
virtual void Commit(void*) = 0;
char *operator[](UInt_t idx) const { return (char*)(const_cast<TVirtualCollectionProxy*>(this))->At(idx); }
};
#endif
TVirtualCollectionProxy.h:1 TVirtualCollectionProxy.h:2 TVirtualCollectionProxy.h:3 TVirtualCollectionProxy.h:4 TVirtualCollectionProxy.h:5 TVirtualCollectionProxy.h:6 TVirtualCollectionProxy.h:7 TVirtualCollectionProxy.h:8 TVirtualCollectionProxy.h:9 TVirtualCollectionProxy.h:10 TVirtualCollectionProxy.h:11 TVirtualCollectionProxy.h:12 TVirtualCollectionProxy.h:13 TVirtualCollectionProxy.h:14 TVirtualCollectionProxy.h:15 TVirtualCollectionProxy.h:16 TVirtualCollectionProxy.h:17 TVirtualCollectionProxy.h:18 TVirtualCollectionProxy.h:19 TVirtualCollectionProxy.h:20 TVirtualCollectionProxy.h:21 TVirtualCollectionProxy.h:22 TVirtualCollectionProxy.h:23 TVirtualCollectionProxy.h:24 TVirtualCollectionProxy.h:25 TVirtualCollectionProxy.h:26 TVirtualCollectionProxy.h:27 TVirtualCollectionProxy.h:28 TVirtualCollectionProxy.h:29 TVirtualCollectionProxy.h:30 TVirtualCollectionProxy.h:31 TVirtualCollectionProxy.h:32 TVirtualCollectionProxy.h:33 TVirtualCollectionProxy.h:34 TVirtualCollectionProxy.h:35 TVirtualCollectionProxy.h:36 TVirtualCollectionProxy.h:37 TVirtualCollectionProxy.h:38 TVirtualCollectionProxy.h:39 TVirtualCollectionProxy.h:40 TVirtualCollectionProxy.h:41 TVirtualCollectionProxy.h:42 TVirtualCollectionProxy.h:43 TVirtualCollectionProxy.h:44 TVirtualCollectionProxy.h:45 TVirtualCollectionProxy.h:46 TVirtualCollectionProxy.h:47 TVirtualCollectionProxy.h:48 TVirtualCollectionProxy.h:49 TVirtualCollectionProxy.h:50 TVirtualCollectionProxy.h:51 TVirtualCollectionProxy.h:52 TVirtualCollectionProxy.h:53 TVirtualCollectionProxy.h:54 TVirtualCollectionProxy.h:55 TVirtualCollectionProxy.h:56 TVirtualCollectionProxy.h:57 TVirtualCollectionProxy.h:58 TVirtualCollectionProxy.h:59 TVirtualCollectionProxy.h:60 TVirtualCollectionProxy.h:61 TVirtualCollectionProxy.h:62 TVirtualCollectionProxy.h:63 TVirtualCollectionProxy.h:64 TVirtualCollectionProxy.h:65 TVirtualCollectionProxy.h:66 TVirtualCollectionProxy.h:67 TVirtualCollectionProxy.h:68 TVirtualCollectionProxy.h:69 TVirtualCollectionProxy.h:70 TVirtualCollectionProxy.h:71 TVirtualCollectionProxy.h:72 TVirtualCollectionProxy.h:73 TVirtualCollectionProxy.h:74 TVirtualCollectionProxy.h:75 TVirtualCollectionProxy.h:76 TVirtualCollectionProxy.h:77 TVirtualCollectionProxy.h:78 TVirtualCollectionProxy.h:79 TVirtualCollectionProxy.h:80 TVirtualCollectionProxy.h:81 TVirtualCollectionProxy.h:82 TVirtualCollectionProxy.h:83 TVirtualCollectionProxy.h:84 TVirtualCollectionProxy.h:85 TVirtualCollectionProxy.h:86 TVirtualCollectionProxy.h:87 TVirtualCollectionProxy.h:88 TVirtualCollectionProxy.h:89 TVirtualCollectionProxy.h:90 TVirtualCollectionProxy.h:91 TVirtualCollectionProxy.h:92 TVirtualCollectionProxy.h:93 TVirtualCollectionProxy.h:94 TVirtualCollectionProxy.h:95 TVirtualCollectionProxy.h:96 TVirtualCollectionProxy.h:97 TVirtualCollectionProxy.h:98 TVirtualCollectionProxy.h:99 TVirtualCollectionProxy.h:100 TVirtualCollectionProxy.h:101 TVirtualCollectionProxy.h:102