#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
Last change: Wed Jun 25 08:54:44 2008
Last generated: 2008-06-25 08:54
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.