| TChain.h | | TChain.h | |
|
| // @(#)root/tree:$Id: TChain.h 39635 2011-06-09 15:37:27Z pcanal $ | | // @(#)root/tree:$Id: TChain.h 41076 2011-09-30 15:31:14Z pcanal $ | |
| // Author: Rene Brun 03/02/97 | | // Author: Rene Brun 03/02/97 | |
| | | | |
| /************************************************************************* | | /************************************************************************* | |
| * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * | | * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * | |
| * All rights reserved. * | | * All rights reserved. * | |
| * * | | * * | |
| * For the licensing terms see $ROOTSYS/LICENSE. * | | * For the licensing terms see $ROOTSYS/LICENSE. * | |
| * For the list of contributors see $ROOTSYS/README/CREDITS. * | | * For the list of contributors see $ROOTSYS/README/CREDITS. * | |
| *************************************************************************/ | | *************************************************************************/ | |
| | | | |
| | | | |
| skipping to change at line 98 | | skipping to change at line 98 | |
| virtual Bool_t GetBranchStatus(const char* branchname) const; | | virtual Bool_t GetBranchStatus(const char* branchname) const; | |
| virtual Long64_t GetChainEntryNumber(Long64_t entry) const; | | virtual Long64_t GetChainEntryNumber(Long64_t entry) const; | |
| virtual TClusterIterator GetClusterIterator(Long64_t firstentry); | | virtual TClusterIterator GetClusterIterator(Long64_t firstentry); | |
| Int_t GetNtrees() const { return fNtrees; } | | Int_t GetNtrees() const { return fNtrees; } | |
| virtual Long64_t GetEntries() const; | | virtual Long64_t GetEntries() const; | |
| virtual Long64_t GetEntries(const char *sel) { return TTree::GetEntries
(sel); } | | virtual Long64_t GetEntries(const char *sel) { return TTree::GetEntries
(sel); } | |
| virtual Int_t GetEntry(Long64_t entry=0, Int_t getall=0); | | virtual Int_t GetEntry(Long64_t entry=0, Int_t getall=0); | |
| virtual Long64_t GetEntryNumber(Long64_t entry) const; | | virtual Long64_t GetEntryNumber(Long64_t entry) const; | |
| virtual Int_t GetEntryWithIndex(Int_t major, Int_t minor=0); | | virtual Int_t GetEntryWithIndex(Int_t major, Int_t minor=0); | |
| TFile *GetFile() const; | | TFile *GetFile() const; | |
|
| | | virtual TLeaf *GetLeaf(const char* branchname, const char* leafname); | |
| virtual TLeaf *GetLeaf(const char* name); | | virtual TLeaf *GetLeaf(const char* name); | |
| virtual TObjArray *GetListOfBranches(); | | virtual TObjArray *GetListOfBranches(); | |
| // Warning, GetListOfFiles returns the list of TChainElem
ents (not the list of files) | | // Warning, GetListOfFiles returns the list of TChainElem
ents (not the list of files) | |
| // see TChain::AddFile to see how to get the correspondin
g TFile objects | | // see TChain::AddFile to see how to get the correspondin
g TFile objects | |
| TObjArray *GetListOfFiles() const {return fFiles;} | | TObjArray *GetListOfFiles() const {return fFiles;} | |
| virtual TObjArray *GetListOfLeaves(); | | virtual TObjArray *GetListOfLeaves(); | |
| virtual const char *GetAlias(const char *aliasName) const; | | virtual const char *GetAlias(const char *aliasName) const; | |
| virtual Double_t GetMaximum(const char *columname); | | virtual Double_t GetMaximum(const char *columname); | |
| virtual Double_t GetMinimum(const char *columname); | | virtual Double_t GetMinimum(const char *columname); | |
| virtual Int_t GetNbranches(); | | virtual Int_t GetNbranches(); | |
| | | | |
End of changes. 2 change blocks. |
| 1 lines changed or deleted | | 2 lines changed or added | |
|
| TPerfStats.h | | TPerfStats.h | |
|
| // @(#)root/proofplayer:$Id: TPerfStats.h 40188 2011-07-11 13:13:11Z ganis
$ | | // @(#)root/proofplayer:$Id: TPerfStats.h 41406 2011-10-16 08:56:43Z ganis
$ | |
| // Author: Kristjan Gulbrandsen 11/05/04 | | // Author: Kristjan Gulbrandsen 11/05/04 | |
| | | | |
| /************************************************************************* | | /************************************************************************* | |
| * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers. * | | * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers. * | |
| * All rights reserved. * | | * All rights reserved. * | |
| * * | | * * | |
| * For the licensing terms see $ROOTSYS/LICENSE. * | | * For the licensing terms see $ROOTSYS/LICENSE. * | |
| * For the list of contributors see $ROOTSYS/README/CREDITS. * | | * For the list of contributors see $ROOTSYS/README/CREDITS. * | |
| *************************************************************************/ | | *************************************************************************/ | |
| | | | |
| | | | |
| skipping to change at line 40 | | skipping to change at line 40 | |
| #ifndef ROOT_TTimeStamp | | #ifndef ROOT_TTimeStamp | |
| #include "TTimeStamp.h" | | #include "TTimeStamp.h" | |
| #endif | | #endif | |
| #ifndef ROOT_TString | | #ifndef ROOT_TString | |
| #include "TString.h" | | #include "TString.h" | |
| #endif | | #endif | |
| #ifndef ROOT_TVirtualPerfStats | | #ifndef ROOT_TVirtualPerfStats | |
| #include "TVirtualPerfStats.h" | | #include "TVirtualPerfStats.h" | |
| #endif | | #endif | |
| | | | |
|
| class TTree; | | class TDSet; | |
| class TH1D; | | class TH1D; | |
| class TH2D; | | class TH2D; | |
| class TList; | | class TList; | |
|
| | | class TTree; | |
| | | | |
| class TPerfEvent : public TObject { | | class TPerfEvent : public TObject { | |
| | | | |
| public: | | public: | |
| TString fEvtNode; // node on which the event was
generated | | TString fEvtNode; // node on which the event was
generated | |
| TTimeStamp fTimeStamp; // time offset from start of r
un | | TTimeStamp fTimeStamp; // time offset from start of r
un | |
| TVirtualPerfStats::EEventType fType; | | TVirtualPerfStats::EEventType fType; | |
| TString fSlaveName; | | TString fSlaveName; | |
| TString fNodeName; | | TString fNodeName; | |
| TString fFileName; | | TString fFileName; | |
| | | | |
| skipping to change at line 77 | | skipping to change at line 78 | |
| | | | |
| Bool_t IsSortable() const { return kTRUE; } | | Bool_t IsSortable() const { return kTRUE; } | |
| Int_t Compare(const TObject *obj) const; | | Int_t Compare(const TObject *obj) const; | |
| void Print(Option_t *option="") const; | | void Print(Option_t *option="") const; | |
| | | | |
| ClassDef(TPerfEvent,3) // Class holding TProof Event Info | | ClassDef(TPerfEvent,3) // Class holding TProof Event Info | |
| }; | | }; | |
| | | | |
| class TPerfStats : public TVirtualPerfStats { | | class TPerfStats : public TVirtualPerfStats { | |
| | | | |
|
| | | friend class TProofMonSender; | |
| | | | |
| private: | | private: | |
| TTree *fTrace; //!TTree with trace events | | TTree *fTrace; //!TTree with trace events | |
| TTimeStamp fTzero; //!start time of this run | | TTimeStamp fTzero; //!start time of this run | |
| TPerfEvent *fPerfEvent; //!TPerfEvent used to fill tree | | TPerfEvent *fPerfEvent; //!TPerfEvent used to fill tree | |
| TH1D *fPacketsHist; //!histogram of packets processed per slav
e | | TH1D *fPacketsHist; //!histogram of packets processed per slav
e | |
| TH1D *fEventsHist; //!histogram of events processed per slave | | TH1D *fEventsHist; //!histogram of events processed per slave | |
| TH1D *fNodeHist; //!histogram of slaves per file serving no
de | | TH1D *fNodeHist; //!histogram of slaves per file serving no
de | |
| TH2D *fLatencyHist; //!histogram of latency due to packet requ
ests | | TH2D *fLatencyHist; //!histogram of latency due to packet requ
ests | |
| TH2D *fProcTimeHist; //!histogram of real time spent processing
packets | | TH2D *fProcTimeHist; //!histogram of real time spent processing
packets | |
| TH2D *fCpuTimeHist; //!histogram of cpu time spent processing
packets | | TH2D *fCpuTimeHist; //!histogram of cpu time spent processing
packets | |
| | | | |
| skipping to change at line 101 | | skipping to change at line 104 | |
| Long64_t fNumEvents; //!total number of events to be processed | | Long64_t fNumEvents; //!total number of events to be processed | |
| Int_t fSlaves; //!number of active slaves | | Int_t fSlaves; //!number of active slaves | |
| | | | |
| Bool_t fDoHist; //!Fill histos | | Bool_t fDoHist; //!Fill histos | |
| Bool_t fDoTrace; //!Trace details in master | | Bool_t fDoTrace; //!Trace details in master | |
| Bool_t fDoTraceRate; //!Trace processing rate in master | | Bool_t fDoTraceRate; //!Trace processing rate in master | |
| Bool_t fDoSlaveTrace; //!Full tracing in workers | | Bool_t fDoSlaveTrace; //!Full tracing in workers | |
| Bool_t fDoQuota; //!Save stats on SQL server for quota mana
gement | | Bool_t fDoQuota; //!Save stats on SQL server for quota mana
gement | |
| | | | |
| Bool_t fMonitorPerPacket; //!Whether to send the full entry per
each packet | | Bool_t fMonitorPerPacket; //!Whether to send the full entry per
each packet | |
|
| Int_t fMonitorInfo; //!Controls what information to monitor | | | |
| | | | |
|
| TObjArray fMonitoringWriters; //!Monitoring engines | | TObjArray fMonSenders; //!Monitoring engines | |
| | | | |
| TString fDataSet; //!Dataset string | | TString fDataSet; //!Dataset string | |
| Int_t fDataSetLen; //!Maximum size of the dataset string fDat
aSet | | Int_t fDataSetLen; //!Maximum size of the dataset string fDat
aSet | |
| Int_t fDataSetSize; //!# of files in the dataset | | Int_t fDataSetSize; //!# of files in the dataset | |
|
| | | TDSet *fDSet; //!Saved pointer to the TDSet object | |
| TList *fOutput; //!Saved pointer to the output list | | TList *fOutput; //!Saved pointer to the output list | |
| | | | |
| static Long_t fgVirtMemMax; //! Max virtual memory used by this proce
ss | | static Long_t fgVirtMemMax; //! Max virtual memory used by this proce
ss | |
| static Long_t fgResMemMax; //! Max resident memory used by this proc
ess | | static Long_t fgResMemMax; //! Max resident memory used by this proc
ess | |
| | | | |
| TPerfStats(TList *input, TList *output); | | TPerfStats(TList *input, TList *output); | |
| void WriteQueryLog(); | | void WriteQueryLog(); | |
| | | | |
| public: | | public: | |
|
| virtual ~TPerfStats() {} | | virtual ~TPerfStats(); | |
| | | | |
| void SimpleEvent(EEventType type); | | void SimpleEvent(EEventType type); | |
| void PacketEvent(const char *slave, const char *slavename, const char *f
ilename, | | void PacketEvent(const char *slave, const char *slavename, const char *f
ilename, | |
| Long64_t eventsprocessed, Double_t latency, | | Long64_t eventsprocessed, Double_t latency, | |
| Double_t proctime, Double_t cputime, Long64_t bytesRead
); | | Double_t proctime, Double_t cputime, Long64_t bytesRead
); | |
| void FileEvent(const char *slave, const char *slavename, const char *nod
ename, const char *filename, | | void FileEvent(const char *slave, const char *slavename, const char *nod
ename, const char *filename, | |
| Bool_t isStart); | | Bool_t isStart); | |
| | | | |
| void FileOpenEvent(TFile *file, const char *filename, Double_t start); | | void FileOpenEvent(TFile *file, const char *filename, Double_t start); | |
| void FileReadEvent(TFile *file, Int_t len, Double_t start); | | void FileReadEvent(TFile *file, Int_t len, Double_t start); | |
| | | | |
End of changes. 8 change blocks. |
| 5 lines changed or deleted | | 8 lines changed or added | |
|
| TSQLMonitoring.h | | TSQLMonitoring.h | |
|
| // @(#)root/net:$Id: TSQLMonitoring.h 23091 2008-04-09 15:04:27Z rdm $ | | // @(#)root/net:$Id: TSQLMonitoring.h 41406 2011-10-16 08:56:43Z ganis $ | |
| // Author: J.F. Grosse-Oetringhaus, G.Ganis | | // Author: J.F. Grosse-Oetringhaus, G.Ganis | |
| | | | |
| /************************************************************************* | | /************************************************************************* | |
| * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. * | | * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. * | |
| * All rights reserved. * | | * All rights reserved. * | |
| * * | | * * | |
| * For the licensing terms see $ROOTSYS/LICENSE. * | | * For the licensing terms see $ROOTSYS/LICENSE. * | |
| * For the list of contributors see $ROOTSYS/README/CREDITS. * | | * For the list of contributors see $ROOTSYS/README/CREDITS. * | |
| *************************************************************************/ | | *************************************************************************/ | |
| | | | |
| | | | |
| skipping to change at line 38 | | skipping to change at line 38 | |
| #endif | | #endif | |
| | | | |
| class TSQLServer; | | class TSQLServer; | |
| | | | |
| class TSQLMonitoringWriter : public TVirtualMonitoringWriter { | | class TSQLMonitoringWriter : public TVirtualMonitoringWriter { | |
| | | | |
| private: | | private: | |
| TSQLServer *fDB; // SQL database where to write | | TSQLServer *fDB; // SQL database where to write | |
| TString fTable; // SQL table name | | TString fTable; // SQL table name | |
| | | | |
|
| | | Long64_t fMaxBulkSize; // Max packet size for insertions | |
| | | | |
| | | Bool_t fVerbose; // Verbosity toggle | |
| | | | |
| TSQLMonitoringWriter(const TSQLMonitoringWriter&); // not imp
lemented | | TSQLMonitoringWriter(const TSQLMonitoringWriter&); // not imp
lemented | |
| TSQLMonitoringWriter& operator=(const TSQLMonitoringWriter&); // not imp
lemented | | TSQLMonitoringWriter& operator=(const TSQLMonitoringWriter&); // not imp
lemented | |
| | | | |
| public: | | public: | |
| TSQLMonitoringWriter(const char *serv, const char *user, const char *pas
s, const char *table); | | TSQLMonitoringWriter(const char *serv, const char *user, const char *pas
s, const char *table); | |
| virtual ~TSQLMonitoringWriter(); | | virtual ~TSQLMonitoringWriter(); | |
| | | | |
| Bool_t SendParameters(TList *values, const char * /*identifier*/); | | Bool_t SendParameters(TList *values, const char * /*identifier*/); | |
| | | | |
|
| | | void Verbose(Bool_t onoff) { fVerbose = onoff; } | |
| | | | |
| ClassDef(TSQLMonitoringWriter, 0) // Sending monitoring data to a SQL
DB | | ClassDef(TSQLMonitoringWriter, 0) // Sending monitoring data to a SQL
DB | |
| }; | | }; | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 3 change blocks. |
| 1 lines changed or deleted | | 7 lines changed or added | |
|
| TTree.h | | TTree.h | |
|
| // @(#)root/tree:$Id: TTree.h 39643 2011-06-09 17:32:22Z pcanal $ | | // @(#)root/tree:$Id: TTree.h 41076 2011-09-30 15:31:14Z pcanal $ | |
| // Author: Rene Brun 12/01/96 | | // Author: Rene Brun 12/01/96 | |
| | | | |
| /************************************************************************* | | /************************************************************************* | |
| * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * | | * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * | |
| * All rights reserved. * | | * All rights reserved. * | |
| * * | | * * | |
| * For the licensing terms see $ROOTSYS/LICENSE. * | | * For the licensing terms see $ROOTSYS/LICENSE. * | |
| * For the list of contributors see $ROOTSYS/README/CREDITS. * | | * For the list of contributors see $ROOTSYS/README/CREDITS. * | |
| *************************************************************************/ | | *************************************************************************/ | |
| | | | |
| | | | |
| skipping to change at line 162 | | skipping to change at line 162 | |
| void AddClone(TTree*); | | void AddClone(TTree*); | |
| virtual void KeepCircular(); | | virtual void KeepCircular(); | |
| virtual TBranch *BranchImp(const char* branchname, const char* classname
, TClass* ptrClass, void* addobj, Int_t bufsize, Int_t splitlevel); | | virtual TBranch *BranchImp(const char* branchname, const char* classname
, TClass* ptrClass, void* addobj, Int_t bufsize, Int_t splitlevel); | |
| virtual TBranch *BranchImp(const char* branchname, TClass* ptrClass, voi
d* addobj, Int_t bufsize, Int_t splitlevel); | | virtual TBranch *BranchImp(const char* branchname, TClass* ptrClass, voi
d* addobj, Int_t bufsize, Int_t splitlevel); | |
| virtual TBranch *BranchImpRef(const char* branchname, const char* classn
ame, TClass* ptrClass, void* addobj, Int_t bufsize, Int_t splitlevel); | | virtual TBranch *BranchImpRef(const char* branchname, const char* classn
ame, TClass* ptrClass, void* addobj, Int_t bufsize, Int_t splitlevel); | |
| virtual TBranch *BranchImpRef(const char* branchname, TClass* ptrClass,
EDataType datatype, void* addobj, Int_t bufsize, Int_t splitlevel); | | virtual TBranch *BranchImpRef(const char* branchname, TClass* ptrClass,
EDataType datatype, void* addobj, Int_t bufsize, Int_t splitlevel); | |
| virtual Int_t CheckBranchAddressType(TBranch* branch, TClass* ptrClas
s, EDataType datatype, Bool_t ptr); | | virtual Int_t CheckBranchAddressType(TBranch* branch, TClass* ptrClas
s, EDataType datatype, Bool_t ptr); | |
| virtual TBranch *BronchExec(const char* name, const char* classname, voi
d* addobj, Bool_t isptrptr, Int_t bufsize, Int_t splitlevel); | | virtual TBranch *BronchExec(const char* name, const char* classname, voi
d* addobj, Bool_t isptrptr, Int_t bufsize, Int_t splitlevel); | |
| friend TBranch *TTreeBranchImpRef(TTree *tree, const char* branchname,
TClass* ptrClass, EDataType datatype, void* addobj, Int_t bufsize, Int_t sp
litlevel); | | friend TBranch *TTreeBranchImpRef(TTree *tree, const char* branchname,
TClass* ptrClass, EDataType datatype, void* addobj, Int_t bufsize, Int_t sp
litlevel); | |
| Int_t SetBranchAddressImp(TBranch *branch, void* addr, TBranch** ptr)
; | | Int_t SetBranchAddressImp(TBranch *branch, void* addr, TBranch** ptr)
; | |
|
| | | virtual TLeaf *GetLeafImpl(const char* branchname, const char* leafnam
e); | |
| | | | |
| char GetNewlineValue(istream &inputStream); | | char GetNewlineValue(istream &inputStream); | |
| void ImportClusterRanges(TTree *fromtree); | | void ImportClusterRanges(TTree *fromtree); | |
| | | | |
| class TFriendLock { | | class TFriendLock { | |
| // Helper class to prevent infinite recursion in the | | // Helper class to prevent infinite recursion in the | |
| // usage of TTree Friends. Implemented in TTree.cxx. | | // usage of TTree Friends. Implemented in TTree.cxx. | |
| TTree *fTree; // Pointer to the locked tree | | TTree *fTree; // Pointer to the locked tree | |
| UInt_t fMethodBit; // BIT for the locked method | | UInt_t fMethodBit; // BIT for the locked method | |
| Bool_t fPrevious; // Previous value of the BIT. | | Bool_t fPrevious; // Previous value of the BIT. | |
| | | | |
| skipping to change at line 386 | | skipping to change at line 387 | |
| TEventList *GetEventList() const { return fEventList; } | | TEventList *GetEventList() const { return fEventList; } | |
| virtual TEntryList *GetEntryList(); | | virtual TEntryList *GetEntryList(); | |
| virtual Long64_t GetEntryNumber(Long64_t entry) const; | | virtual Long64_t GetEntryNumber(Long64_t entry) const; | |
| virtual Int_t GetFileNumber() const { return fFileNumber; } | | virtual Int_t GetFileNumber() const { return fFileNumber; } | |
| virtual TTree *GetFriend(const char*) const; | | virtual TTree *GetFriend(const char*) const; | |
| virtual const char *GetFriendAlias(TTree*) const; | | virtual const char *GetFriendAlias(TTree*) const; | |
| TH1 *GetHistogram() { return GetPlayer()->GetHistogra
m(); } | | TH1 *GetHistogram() { return GetPlayer()->GetHistogra
m(); } | |
| virtual Int_t *GetIndex() { return &fIndex.fArray[0]; } | | virtual Int_t *GetIndex() { return &fIndex.fArray[0]; } | |
| virtual Double_t *GetIndexValues() { return &fIndexValues.fArray[0
]; } | | virtual Double_t *GetIndexValues() { return &fIndexValues.fArray[0
]; } | |
| virtual TIterator *GetIteratorOnAllLeaves(Bool_t dir = kIterForward
); | | virtual TIterator *GetIteratorOnAllLeaves(Bool_t dir = kIterForward
); | |
|
| | | virtual TLeaf *GetLeaf(const char* branchname, const char* leaf
name); | |
| virtual TLeaf *GetLeaf(const char* name); | | virtual TLeaf *GetLeaf(const char* name); | |
| virtual TList *GetListOfClones() { return fClones; } | | virtual TList *GetListOfClones() { return fClones; } | |
| virtual TObjArray *GetListOfBranches() { return &fBranches; } | | virtual TObjArray *GetListOfBranches() { return &fBranches; } | |
| virtual TObjArray *GetListOfLeaves() { return &fLeaves; } | | virtual TObjArray *GetListOfLeaves() { return &fLeaves; } | |
| virtual TList *GetListOfFriends() const { return fFriends; } | | virtual TList *GetListOfFriends() const { return fFriends; } | |
| virtual TList *GetListOfAliases() const { return fAliases; } | | virtual TList *GetListOfAliases() const { return fAliases; } | |
| | | | |
| // GetMakeClass is left non-virtual for efficiency reason. | | // GetMakeClass is left non-virtual for efficiency reason. | |
| // Making it virtual affects the performance of the I/O | | // Making it virtual affects the performance of the I/O | |
| Int_t GetMakeClass() const { return fMakeClass; } | | Int_t GetMakeClass() const { return fMakeClass; } | |
| | | | |
End of changes. 3 change blocks. |
| 1 lines changed or deleted | | 3 lines changed or added | |
|
| TVirtualArray.h | | TVirtualArray.h | |
|
| // @(#)root/io:$Id: TVirtualArray.h 25450 2008-09-18 21:13:42Z pcanal $ | | // @(#)root/io:$Id: TVirtualArray.h 41523 2011-10-20 22:53:47Z pcanal $ | |
| // Author: Philippe Canal July, 2008 | | // Author: Philippe Canal July, 2008 | |
| | | | |
| /************************************************************************* | | /************************************************************************* | |
| * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * | | * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * | |
| * All rights reserved. * | | * All rights reserved. * | |
| * * | | * * | |
| * For the licensing terms see $ROOTSYS/LICENSE. * | | * For the licensing terms see $ROOTSYS/LICENSE. * | |
| * For the list of contributors see $ROOTSYS/README/CREDITS. * | | * For the list of contributors see $ROOTSYS/README/CREDITS. * | |
| *************************************************************************
/ | | *************************************************************************
/ | |
| | | | |
| | | | |
| skipping to change at line 29 | | skipping to change at line 29 | |
| // Wrapper around an object and giving indirect access to its content // | | // Wrapper around an object and giving indirect access to its content // | |
| // even if the object is not of a class in the Cint/Reflex dictionary. // | | // even if the object is not of a class in the Cint/Reflex dictionary. // | |
| // // | | // // | |
| ////////////////////////////////////////////////////////////////////////// | | ////////////////////////////////////////////////////////////////////////// | |
| | | | |
| #include "TClassRef.h" | | #include "TClassRef.h" | |
| | | | |
| class TVirtualArray { | | class TVirtualArray { | |
| public: | | public: | |
| TClassRef fClass; | | TClassRef fClass; | |
|
| | | UInt_t fCapacity; | |
| UInt_t fSize; | | UInt_t fSize; | |
| char *fArray; //[fSize] | | char *fArray; //[fSize] | |
| | | | |
|
| TVirtualArray( TClass *cl, UInt_t size ) : fClass(cl), fSize(size), fArr
ay( (char*)( cl ? cl->NewArray(size) : 0) ) {}; | | TVirtualArray( TClass *cl, UInt_t size ) : fClass(cl), fCapacity(size),
fSize(size), fArray( (char*)( cl ? cl->NewArray(size) : 0) ) {}; | |
| ~TVirtualArray() { if (fClass) fClass->DeleteArray( fArray ); } | | ~TVirtualArray() { if (fClass) fClass->DeleteArray( fArray ); } | |
| | | | |
| TClass *GetClass() { return fClass; } | | TClass *GetClass() { return fClass; } | |
| char *operator[](UInt_t ind) const { return GetObjectAt(ind); } | | char *operator[](UInt_t ind) const { return GetObjectAt(ind); } | |
| char *GetObjectAt(UInt_t ind) const { return fArray+fClass->Size()*ind;
} | | char *GetObjectAt(UInt_t ind) const { return fArray+fClass->Size()*ind;
} | |
| | | | |
|
| | | void SetSize(UInt_t size) { | |
| | | // Set the used size of this array to 'size'. If size is greater th | |
| | | an the existing | |
| | | // capacity, reallocate the array BUT no data is preserved. | |
| | | fSize = size; | |
| | | if (fSize > fCapacity && fClass) { | |
| | | fClass->DeleteArray( fArray ); | |
| | | fArray = (char*)fClass->NewArray(fSize); | |
| | | fCapacity = fSize; | |
| | | } | |
| | | } | |
| | | | |
| }; | | }; | |
| | | | |
| #endif // ROOT_TVirtualArray | | #endif // ROOT_TVirtualArray | |
| | | | |
End of changes. 4 change blocks. |
| 2 lines changed or deleted | | 15 lines changed or added | |
|