Effective C++ mods
authorcvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 18 Sep 2006 14:46:38 +0000 (14:46 +0000)
committercvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 18 Sep 2006 14:46:38 +0000 (14:46 +0000)
21 files changed:
RAW/AliFstream.cxx
RAW/AliFstream.h
RAW/AliHoughFilter.cxx
RAW/AliHoughFilter.h
RAW/AliMDC.cxx
RAW/AliRawDB.cxx
RAW/AliRawData.cxx
RAW/AliRawData.h
RAW/AliRawDataHeader.h
RAW/AliRawEquipment.cxx
RAW/AliRawEvent.cxx
RAW/AliRawEventHeaderBase.cxx
RAW/AliRawEventHeaderBase.h
RAW/AliRawReaderFile.cxx
RAW/AliRawReaderFile.h
RAW/AliRawReaderMemory.cxx
RAW/AliRunDB.cxx
RAW/AliStats.cxx
RAW/AliTagDB.cxx
RAW/AliVMERawStream.cxx
RAW/AliVMERawStream.h

index 6b1b8d345457a6c5413e92dd4dab1cf748aa08e2..21a54babf2c9904440598c2b91543c5dbbab968c 100644 (file)
@@ -67,28 +67,6 @@ AliFstream::AliFstream(const char *fileName):
   if (!ptemp[0]) fSwap = kTRUE;
 }
 
-//______________________________________________________________________________
-AliFstream::AliFstream(const AliFstream &source):
-  TObject(source)
-{
-  // Copy constructor
-  //
-  AliFatal("Copy constructor not implemented !");
-}
-
-//______________________________________________________________________________
-AliFstream &AliFstream::operator =(const AliFstream& source)
-{
-  // assignment operator
-  //
-  if(this==&source) return *this;
-  ((TObject *)this)->operator=(source);
-
-  AliFatal("Assigment operator not implemented !");
-
-  return *this;
-}
-
 //______________________________________________________________________________
 AliFstream::~AliFstream()
 {
index 0a5bf1ae454f38e1e6f822d9e4f1b1b43758709f..bdb805694b3dc886761590af48eea7d82c3af0b3 100644 (file)
@@ -19,8 +19,6 @@ class AliFstream : public TObject {
 public:
   AliFstream();
   AliFstream(const char *fileName);
-  AliFstream(const AliFstream &source);
-  AliFstream& operator= (const AliFstream &source);
   virtual ~AliFstream();
 
   void   Seekp(UInt_t position);
@@ -29,6 +27,9 @@ public:
 
 private:
 
+  AliFstream(const AliFstream &source);
+  AliFstream &operator =(const AliFstream& source);
+
   fstream *fFile;       // Output file stream
   UChar_t *fBuffer;     // Pointer to the internal buffer
   UInt_t   fBufferSize; // Internal buffer size
index 7064e0b49791c1d21e3c236209c72551178803b4..80dc23b9ac73721c0e223f5a9525ee5a4f71c625 100644 (file)
@@ -43,7 +43,9 @@
 ClassImp(AliHoughFilter)
 
 //_____________________________________________________________________________
-AliHoughFilter::AliHoughFilter()
+AliHoughFilter::AliHoughFilter():
+fPtmin(0),
+fITSgeom(NULL)
 {
 // default constructor
 
index 19871045e05e202f7fc570e31ae5afeb90f5813b..d00664cbe9a00711c73b9a7caa595a7817ebef6c 100644 (file)
@@ -27,6 +27,9 @@ public:
   void                 RunTPCtracking(AliRawEvent* event, AliESD* esd);
   void                 RunITStracking(AliESD* esd, TTree *treeClusters);
 private:
+  AliHoughFilter(const AliHoughFilter&);
+  AliHoughFilter &operator=(const AliHoughFilter&);
+
   Float_t fPtmin;        //Low limit on Pt
 
   AliITSgeom *fITSgeom;  //Pointer to the ITS geometry
index 879d0053d727a85fb550efdc8a129307acfed3e4..415b369b231c2477818184449b451ac2a9c0ea3d 100644 (file)
@@ -174,24 +174,6 @@ AliMDC::~AliMDC()
   delete fEvent;
 }
  
-//______________________________________________________________________________
-AliMDC::AliMDC(const AliMDC& mdc): TObject(mdc)
-{
-// copy constructor
-
-  Fatal("AliMDC", "copy constructor not implemented");
-}
-
-//______________________________________________________________________________
-AliMDC& AliMDC::operator = (const AliMDC& /*mdc*/)
-{
-// assignment operator
-
-  Fatal("operator =", "assignment operator not implemented");
-  return *this;
-}
-
-
 //______________________________________________________________________________
 Int_t AliMDC::Open(EWriteMode mode, const char* fileName)
 {
index 6c41d5fa9b0cc5e19f9fd4bdd26c6e407c3b14f8..973491d69af34c913c852a0d80cdfea5536dd88b 100644 (file)
@@ -64,23 +64,6 @@ AliRawDB::AliRawDB(AliRawEvent *event,
    }
 }
 
-//______________________________________________________________________________
-AliRawDB::AliRawDB(const AliRawDB& rawDB): TObject(rawDB)
-{
-// copy constructor
-
-  Fatal("AliRawDB", "copy constructor not implemented");
-}
-
-//______________________________________________________________________________
-AliRawDB& AliRawDB::operator = (const AliRawDB& /*rawDB*/)
-{
-// assignment operator
-
-  Fatal("operator =", "assignment operator not implemented");
-  return *this;
-}
-
 //______________________________________________________________________________
 Bool_t AliRawDB::FSHasSpace(const char *fs) const
 {
index 9fb4683c032e849ac7b77c2e61005c0a55d8b4e8..322bfc24333a39807d0fe1839d8bd349662e6c4c 100644 (file)
 
 
 ClassImp(AliRawData)
+
+AliRawData::AliRawData():
+fSize(0),
+fBufSize(0),
+fRawData(NULL),
+fOwner(kTRUE)
+{
+  // Default constructor
+}
index abf4dc44ddc00b5de99e2c50f4289b18c7324184..8ea7e307ac0cb5be5cec29126e5c0ea0c70020ab 100644 (file)
@@ -20,7 +20,7 @@
 class AliRawData : public TObject {
 
 public:
-   AliRawData() { fSize = fBufSize = 0; fRawData = 0; fOwner = kTRUE; }
+   AliRawData();
    virtual ~AliRawData() { if (fOwner) delete [] fRawData; }
 
    inline void SetSize(Int_t size);
index 4a1abb463df0bdb11ee072c6ce7f46322113850d..55b3026c610dabfd118d7b741f1d63202b67faad 100644 (file)
@@ -17,6 +17,8 @@ struct AliRawDataHeader {
     fROIHigh(0)
   {}
 
+  virtual ~AliRawDataHeader() {};
+
   UShort_t  GetEventID1() const
     {return (fEventID1 & 0xFFF);};
 
index 2b9417ac6589006cccd6ed523eb68e7045a2a1a8..7b0f3ec3bde57014ef3e2cf9c5b1c1c12493d9c0 100644 (file)
@@ -50,29 +50,12 @@ ClassImp(AliRawEquipment)
 
 
 //______________________________________________________________________________
-AliRawEquipment::AliRawEquipment()
+AliRawEquipment::AliRawEquipment():
+fEqpHdr(NULL),
+fRawData(NULL)
 {
    // Create ALICE equipment object.
 
-   fEqpHdr     = 0;
-   fRawData    = 0;
-}
-
-//______________________________________________________________________________
-AliRawEquipment::AliRawEquipment(const AliRawEquipment& rawEquipment): TObject(rawEquipment)
-{
-// copy constructor
-
-  Fatal("AliRawEquipment", "copy constructor not implemented");
-}
-
-//______________________________________________________________________________
-AliRawEquipment& AliRawEquipment::operator = (const AliRawEquipment& /*rawEquipment*/)
-{
-// assignment operator
-
-  Fatal("operator =", "assignment operator not implemented");
-  return *this;
 }
 
 //______________________________________________________________________________
index 47c6f284fde7010d533cbb455a0fb4dce0de32a6..662f7510c169689f3d3e9b24ca1b1306550d1262 100644 (file)
@@ -54,33 +54,16 @@ ClassImp(AliRawEvent)
 
 
 //______________________________________________________________________________
-AliRawEvent::AliRawEvent()
+AliRawEvent::AliRawEvent():
+fNEquipments(0),
+fNSubEvents(0),
+fEvtHdr(NULL),
+fEquipments(NULL),
+fSubEvents(NULL)
 {
    // Create ALICE event object. If ownData is kFALSE we will use a static
    // raw data object, otherwise a private copy will be made.
 
-   fNEquipments = 0;
-   fNSubEvents  = 0;
-   fEvtHdr      = 0;
-   fEquipments  = 0;
-   fSubEvents   = 0;
-}
-
-//______________________________________________________________________________
-AliRawEvent::AliRawEvent(const AliRawEvent& rawEvent): TObject(rawEvent)
-{
-// copy constructor
-
-  Fatal("AliRawEvent", "copy constructor not implemented");
-}
-
-//______________________________________________________________________________
-AliRawEvent& AliRawEvent::operator = (const AliRawEvent& /*rawEvent*/)
-{
-// assignment operator
-
-  Fatal("operator =", "assignment operator not implemented");
-  return *this;
 }
 
 //______________________________________________________________________________
index a4ba528a88243d113a08f8fffd95970e16608c20..a4053d745be63c9ca7cd6bfeb90a6ca9222629f9 100644 (file)
 
 ClassImp(AliRawEventHeaderBase)
 
+//______________________________________________________________________________
+AliRawEventHeaderBase::AliRawEventHeaderBase():
+fSize(0),
+fMagic(0),
+fHeadSize(0),
+fVersion(0),
+fExtendedDataSize(0),
+fExtendedData(NULL),
+fIsSwapped(kFALSE)
+{
+  // Default constructor
+}
 
 //______________________________________________________________________________
 void *AliRawEventHeaderBase::HeaderBegin()
index bf0dba3fcaa7a83a94a1a7d9964e0a4de9dd9af9..3edb26d811f07fde39908be7f27719ec1c20f52e 100644 (file)
@@ -19,7 +19,7 @@
 class AliRawEventHeaderBase : public TObject {
 
 public:
-   AliRawEventHeaderBase() { fSize=fMagic=fHeadSize=fVersion=fExtendedDataSize=0; fExtendedData = 0x0; fIsSwapped = kFALSE; }
+   AliRawEventHeaderBase();
    virtual ~AliRawEventHeaderBase() { if (fExtendedData) delete [] fExtendedData; }
 
    void         *HeaderBaseBegin() { return (void *) &fSize; }
@@ -68,6 +68,9 @@ public:
    };
 
 private:
+   AliRawEventHeaderBase(const AliRawEventHeaderBase&);
+   AliRawEventHeaderBase& operator=(const AliRawEventHeaderBase&);
+
    UInt_t fSize;          // size of event in bytes
    UInt_t fMagic;         // magic number used for consistency check
    UInt_t fHeadSize;      // size of header in bytes
index cab31b8b516669bd88708d623667a4403e97f056..ff8c5301c5a95d4c0eceba33977f0c55cb26fbee 100644 (file)
@@ -70,19 +70,6 @@ AliRawReaderFile::AliRawReaderFile(const char* dirName, Int_t eventNumber) :
   fHeader = new AliRawDataHeader;
 }
 
-AliRawReaderFile::AliRawReaderFile(const AliRawReaderFile& rawReader) :
-  AliRawReader(rawReader)
-{
-  Fatal("AliRawReaderFile", "copy constructor not implemented");
-}
-
-AliRawReaderFile& AliRawReaderFile::operator = (const AliRawReaderFile& 
-                                             /* rawReader */)
-{
-  Fatal("operator =", "assignment operator not implemented");
-  return *this;
-}
-
 AliRawReaderFile::~AliRawReaderFile()
 {
 // close the input file
index a3e25190488f3fd3831c6de87578d7589cdcecf6..6c42cad8d50e841d328f62c1794f5336dbe7e915 100644 (file)
@@ -24,8 +24,6 @@ class AliRawReaderFile: public AliRawReader {
   public :
     AliRawReaderFile(Int_t eventNumber = -1);
     AliRawReaderFile(const char* dirName, Int_t eventNumber = -1);
-    AliRawReaderFile(const AliRawReaderFile& rawReader);
-    AliRawReaderFile& operator = (const AliRawReaderFile& rawReader);
     virtual ~AliRawReaderFile();
 
     virtual void     RequireHeader(Bool_t required);
@@ -69,6 +67,10 @@ class AliRawReaderFile: public AliRawReader {
     UChar_t*         fBuffer;      // buffer for payload
     Int_t            fBufferSize;  // size of fBuffer in bytes
 
+  private :
+    AliRawReaderFile(const AliRawReaderFile& rawReader);
+    AliRawReaderFile& operator = (const AliRawReaderFile& rawReader);
+
     ClassDef(AliRawReaderFile, 0) // class for reading raw digits from a file
 };
 
index 392517bc691fd3c54f489db6ffc83e8185c5648d..c35df703fd5bef16f7ed2b7212002aa14177d297 100644 (file)
@@ -31,7 +31,8 @@ ClassImp(AliRawReaderMemory)
 AliRawReaderMemory::AliRawReaderMemory() :
   fBuffer(NULL),
   fBufferSize(0),
-  fPosition(0)
+  fPosition(0),
+  fEquipmentId(-1)
 {
 // create an object to read digits from
 // the given memory location
@@ -42,7 +43,8 @@ AliRawReaderMemory::AliRawReaderMemory() :
 AliRawReaderMemory::AliRawReaderMemory(UChar_t* memory, UInt_t size) :
   fBuffer(memory),
   fBufferSize(size),
-  fPosition(0)
+  fPosition(0),
+  fEquipmentId(-1)
 {
 // create an object to read digits from the given memory
 
@@ -56,20 +58,6 @@ AliRawReaderMemory::~AliRawReaderMemory()
   delete fHeader;
 }
 
-
-AliRawReaderMemory::AliRawReaderMemory(const AliRawReaderMemory& rawReader) :
-  AliRawReader(rawReader)
-{
-  Fatal("AliRawReaderMemory", "copy constructor not implemented");
-}
-
-AliRawReaderMemory& AliRawReaderMemory::operator = (const AliRawReaderMemory& 
-                                             /* rawReader */)
-{
-  Fatal("operator =", "assignment operator not implemented");
-  return *this;
-}
-
 void AliRawReaderMemory::RequireHeader(Bool_t required)
 {
   // Reading of raw data in case of missing
index fc45171d62c600f54602bd03848da895ad6a7561..6c0591895beb0b92b64338eb73ae3a4a0cd3fcde 100644 (file)
@@ -83,23 +83,6 @@ AliRunDB::AliRunDB(const char* localFS, Bool_t rdbms,
    }
 }
 
-//______________________________________________________________________________
-AliRunDB::AliRunDB(const AliRunDB& runDB): TObject(runDB)
-{
-// copy constructor
-
-  Fatal("AliRunDB", "copy constructor not implemented");
-}
-
-//______________________________________________________________________________
-AliRunDB& AliRunDB::operator = (const AliRunDB& /*runDB*/)
-{
-// assignment operator
-
-  Fatal("operator =", "assignment operator not implemented");
-  return *this;
-}
-
 //______________________________________________________________________________
 void AliRunDB::Update(AliStats *stats)
 {
index 676583394ce5a621f7fdb5d82c2612eb7656851a..22ba72dd045516046a3bd6f3ad98571437acaad9 100644 (file)
@@ -32,28 +32,46 @@ ClassImp(AliStats)
 
 
 //______________________________________________________________________________
-AliStats::AliStats(const char *filename, Int_t compmode, Bool_t filter)
+AliStats::AliStats(const char *filename, Int_t compmode, Bool_t filter):
+fEvents(0),
+fFirstRun(0),
+fFirstEvent(0),
+fLastRun(0),
+fLastEvent(0),
+fBegin(),
+fEnd(),
+fFileName(filename),
+fFileSize(0),
+fCompFactor(0),
+fCompMode(compmode),
+fFilter(filter),
+fRTHist(NULL),
+fChunk(-0.5)
 {
    // Create statistics object.
 
-   fEvents     = 0;
-   fFirstRun   = 0;
-   fFirstEvent = 0;
-   fLastRun    = 0;
-   fLastEvent  = 0;
-   fChunk      = -0.5;
-   fFileName   = filename;
-   fCompMode   = compmode;
-   fFilter     = filter;
-   fRTHist     = 0;
 }
 
 //______________________________________________________________________________
-AliStats::AliStats(const AliStats &rhs): TObject(rhs)
+AliStats::AliStats(const AliStats &rhs):
+TObject(rhs),
+fEvents(rhs.fEvents),
+fFirstRun(rhs.fFirstRun),
+fFirstEvent(rhs.fFirstEvent),
+fLastRun(rhs.fLastRun),
+fLastEvent(rhs.fLastEvent),
+fBegin(rhs.fBegin),
+fEnd(rhs.fEnd),
+fFileName(rhs.fFileName),
+fFileSize(rhs.fFileSize),
+fCompFactor(rhs.fCompFactor),
+fCompMode(rhs.fCompMode),
+fFilter(rhs.fFilter),
+fRTHist(rhs.fRTHist ? (TH1F*) rhs.fRTHist->Clone() : 0),
+fChunk(rhs.fChunk)
 {
-   // AliStats copy constructor.
+  // AliStats copy constructor.
 
-   operator=(rhs);
 }
 
 //______________________________________________________________________________
index 581a39ce2aaa37b21f57e56c6b0802c1f41e8ec9..f5450b6134fb192d2aeaa45f18ab9ad72078302d 100644 (file)
@@ -53,23 +53,6 @@ AliTagDB::AliTagDB(AliRawEventHeaderBase *header, const char* fileName) :
    }
 }
 
-//______________________________________________________________________________
-AliTagDB::AliTagDB(const AliTagDB& tagDB): TObject(tagDB)
-{
-// copy constructor
-
-  Fatal("AliTagDB", "copy constructor not implemented");
-}
-
-//______________________________________________________________________________
-AliTagDB& AliTagDB::operator = (const AliTagDB& /*tagDB*/)
-{
-// assignment operator
-
-  Fatal("operator =", "assignment operator not implemented");
-  return *this;
-}
-
 //______________________________________________________________________________
 Bool_t AliTagDB::Create(const char* fileName)
 {
index f35d81e2b9300f2c3dc391e38a0d449cbe52b998..df86fba0cd9a1365ecb8b81d6e14fcd4fff6420d 100644 (file)
@@ -50,20 +50,6 @@ AliVMERawStream::AliVMERawStream(AliRawReader* rawReader) :
   fRawReader->SelectEquipment(551, 38, 38);
 }
 
-AliVMERawStream::AliVMERawStream(const AliVMERawStream& stream) :
-  TObject(stream)
-{
-  Fatal("AliVMERawStream", "copy constructor not implemented");
-}
-
-AliVMERawStream& AliVMERawStream::operator = (const AliVMERawStream& 
-                                             /* stream */)
-{
-  Fatal("operator =", "assignment operator not implemented");
-  return *this;
-}
-
-
 Bool_t AliVMERawStream::Next()
 {
 // read the next raw digit
index f806c0516ec02e0180c30f2adf5d4b42f806d9fb..3f4c7fd50774f79227cae4a3c017889cb21b3ffb 100644 (file)
@@ -19,8 +19,6 @@ class AliRawReader;
 class AliVMERawStream: public TObject {
   public :
     AliVMERawStream(AliRawReader* rawReader);
-    AliVMERawStream(const AliVMERawStream& stream);
-    AliVMERawStream& operator = (const AliVMERawStream& stream);
     virtual ~AliVMERawStream() {};
 
     virtual Bool_t   Next();
@@ -39,6 +37,9 @@ class AliVMERawStream: public TObject {
     UInt_t           GetTimeMuSec() const {return fTimeMuSec;};
 
   private :
+    AliVMERawStream(const AliVMERawStream& stream);
+    AliVMERawStream& operator = (const AliVMERawStream& stream);
+
     Bool_t           CheckString(const char* str) const;
     Bool_t           ReadTDC();
     Bool_t           ReadTime();