File indexing completed on 2025-01-18 10:11:39
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef ROOT_TEmulatedCollectionProxy
0012 #define ROOT_TEmulatedCollectionProxy
0013
0014 #include "TGenCollectionProxy.h"
0015
0016 #include <vector>
0017
0018 class TEmulatedCollectionProxy : public TGenCollectionProxy {
0019
0020
0021 friend class TCollectionProxy;
0022
0023 public:
0024
0025 typedef std::vector<char> Cont_t;
0026
0027 typedef Cont_t *PCont_t;
0028 protected:
0029
0030
0031 TGenCollectionProxy* InitializeEx(Bool_t silent) override;
0032
0033
0034 void ReadItems(int nElements, TBuffer &b);
0035
0036
0037 void WriteItems(int nElements, TBuffer &b);
0038
0039
0040 void Shrink(UInt_t nCurr, UInt_t left, Bool_t force);
0041
0042
0043 void Expand(UInt_t nCurr, UInt_t left);
0044
0045 private:
0046 TEmulatedCollectionProxy &operator=(const TEmulatedCollectionProxy &);
0047
0048 public:
0049
0050 TVirtualCollectionProxy* Generate() const override;
0051
0052
0053 TEmulatedCollectionProxy(const TEmulatedCollectionProxy& copy);
0054
0055
0056 TEmulatedCollectionProxy(const char* cl_name, Bool_t silent);
0057
0058
0059 ~TEmulatedCollectionProxy() override;
0060
0061
0062 void* New() const override { return new Cont_t; }
0063
0064
0065 void* New(void* memory) const override { return new(memory) Cont_t; }
0066
0067
0068 TClass::ObjectPtr NewObject() const override { return {new Cont_t, nullptr}; }
0069
0070
0071 TClass::ObjectPtr NewObject(void* memory) const override { return {new(memory) Cont_t, nullptr}; }
0072
0073
0074 void* NewArray(Int_t nElements) const override { return new Cont_t[nElements]; }
0075
0076
0077 void* NewArray(Int_t nElements, void* memory) const override { return new(memory) Cont_t[nElements]; }
0078
0079
0080 TClass::ObjectPtr NewObjectArray(Int_t nElements) const override { return {new Cont_t[nElements], nullptr}; }
0081
0082
0083 TClass::ObjectPtr NewObjectArray(Int_t nElements, void* memory) const override { return {new(memory) Cont_t[nElements], nullptr}; }
0084
0085
0086 void Destructor(void* p, Bool_t dtorOnly = kFALSE) const override;
0087
0088
0089 void DeleteArray(void* p, Bool_t dtorOnly = kFALSE) const override;
0090
0091
0092 UInt_t Sizeof() const override { return sizeof(Cont_t); }
0093
0094
0095 void *At(UInt_t idx) override;
0096
0097
0098 void Clear(const char *opt = "") override;
0099
0100
0101 void Resize(UInt_t n, Bool_t force_delete) override;
0102
0103
0104 UInt_t Size() const override;
0105
0106
0107 void* Allocate(UInt_t n, Bool_t forceDelete) override;
0108
0109
0110 void Commit(void* env) override;
0111
0112
0113
0114 void Insert(const void *data, void *container, size_t size) override;
0115
0116
0117 void ReadBuffer(TBuffer &buff, void *pObj) override;
0118 void ReadBuffer(TBuffer &buff, void *pObj, const TClass *onfile) override;
0119
0120
0121 void Streamer(TBuffer &refBuffer) override;
0122
0123
0124 void Streamer(TBuffer &buff, void *pObj, int siz) override
0125 {
0126 TGenCollectionProxy::Streamer(buff,pObj,siz);
0127 }
0128
0129
0130 Bool_t IsValid() const;
0131 };
0132
0133 #endif