Changeset 2619 in Sophya for trunk/SophyaLib/HiStats/histerr.cc
- Timestamp:
- Sep 15, 2004, 5:36:54 PM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/HiStats/histerr.cc
r2615 r2619 44 44 HistoErr::~HistoErr(void) 45 45 { 46 if(mNData) {delete [] mNData; mNData=NULL;} 47 } 46 Delete(); 47 } 48 48 49 /********* Methode *********/ 49 50 /*! Allocation du tableau mNData */ … … 56 57 57 58 /********* Methode *********/ 59 /*! Delete des tableaux */ 60 void HistoErr::Delete(void) 61 { 62 Histo::Delete(); 63 if(mNData) {delete [] mNData; mNData=NULL;} 64 } 65 66 /********* Methode *********/ 58 67 /*! 59 68 Remise a zero … … 61 70 void HistoErr::Zero(void) 62 71 { 63 if(mNData != NULL) memset(mNData,0,mBins*sizeof(uint_4));64 72 Histo::Zero(); 73 if(mNData) memset(mNData,0,mBins*sizeof(uint_4)); 65 74 } 66 75 … … 172 181 } 173 182 183 /********* Methode *********/ 184 /*! 185 Operateur egal HistoErr = HistoErr 186 */ 187 HistoErr& HistoErr::operator = (const HistoErr& h) 188 { 189 if(this==&h) return *this; 190 Delete(); 191 if(h.mBins<=0) return *this; 192 193 // Copy the "Histo" part 194 (Histo)(*this) = Histo::operator=(h); 195 // Copy the "entries by bin" table 196 allocate_mNData(h.mBins); 197 memcpy(mNData,h.mNData,mBins*sizeof(uint_4)); 198 199 return *this; 200 } 201 174 202 /////////////////////////////////////////////////////////// 175 203 // --------------------------------------------------------
Note:
See TracChangeset
for help on using the changeset viewer.