]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Changing operator= implementation, and removing now unused class
authorlaphecet <laphecet@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 29 May 2008 09:35:56 +0000 (09:35 +0000)
committerlaphecet <laphecet@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 29 May 2008 09:35:56 +0000 (09:35 +0000)
MUON/AliMUON1DMapIterator.cxx [deleted file]
MUON/AliMUON1DMapIterator.h [deleted file]
MUON/AliMUONDigitStoreV1Iterator.cxx
MUON/AliMUONTOTCAStoreIterator.cxx

diff --git a/MUON/AliMUON1DMapIterator.cxx b/MUON/AliMUON1DMapIterator.cxx
deleted file mode 100644 (file)
index bfa784b..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-/**************************************************************************
-* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
-*                                                                        *
-* Author: The ALICE Off-line Project.                                    *
-* Contributors are mentioned in the code where appropriate.              *
-*                                                                        *
-* Permission to use, copy, modify and distribute this software and its   *
-* documentation strictly for non-commercial purposes is hereby granted   *
-* without fee, provided that the above copyright notice appears in all   *
-* copies and that both the copyright notice and this permission notice   *
-* appear in the supporting documentation. The authors make no claims     *
-* about the suitability of this software for any purpose. It is          *
-* provided "as is" without express or implied warranty.                  *
-**************************************************************************/
-
-// $Id$
-
-//-----------------------------------------------------------------------------
-/// \class AliMUON1DMapIterator
-/// Implementation of TIterator for 1Dmaps
-/// 
-/// A simple implementation of iterator for 1Dmaps.
-///
-/// \author Laurent Aphecetche
-//-----------------------------------------------------------------------------
-
-#include "AliMUON1DMapIterator.h"
-#include "AliMpExMap.h"
-
-/// \cond CLASSIMP
-ClassImp(AliMUON1DMapIterator)
-/// \endcond
-
-//_____________________________________________________________________________
-AliMUON1DMapIterator::AliMUON1DMapIterator(const AliMpExMap& theMap)
-: TIterator(), 
-  fkMap(&theMap),
-  fCurrentI(-1)
-{
-  /// default ctor
-}
-
-//_____________________________________________________________________________
-AliMUON1DMapIterator::AliMUON1DMapIterator(const AliMUON1DMapIterator& rhs)
-: TIterator(rhs),
-  fkMap(rhs.fkMap),
-  fCurrentI(rhs.fCurrentI)        
-{
-    /// copy ctor
-}
-
-//_____________________________________________________________________________
-AliMUON1DMapIterator& 
-AliMUON1DMapIterator::operator=(const AliMUON1DMapIterator& rhs)
-{
-  /// assignment operator
-  if ( this != &rhs )
-  {
-    fkMap = rhs.fkMap;
-    fCurrentI = rhs.fCurrentI;
-  }
-  return *this;
-}
-
-//_____________________________________________________________________________
-TIterator& 
-AliMUON1DMapIterator::operator=(const TIterator& rhs)
-{
-  /// overriden operator= (imposed by Root definition of TIterator::operator= ?)
-  
-  if ( this != &rhs && rhs.IsA() == AliMUON1DMapIterator::Class() )
-  {
-    const AliMUON1DMapIterator& rhs1 = static_cast<const AliMUON1DMapIterator&>(rhs);
-    fkMap = rhs1.fkMap;
-    fCurrentI = rhs1.fCurrentI;
-  }
-  return *this;
-}
-
-
-//_____________________________________________________________________________
-AliMUON1DMapIterator::~AliMUON1DMapIterator()
-{
-  /// dtor
-}
-
-//_____________________________________________________________________________
-TObject*
-AliMUON1DMapIterator::Next()
-{
-  /// Return next object in iteration
-  return (++fCurrentI < fkMap->GetSize()) ? fkMap->GetObjectFast(fCurrentI) : 0x0;
-}
-
-//_____________________________________________________________________________
-void
-AliMUON1DMapIterator::Reset()
-{
-  /// rewind the iterator
-  fCurrentI = -1;
-}
diff --git a/MUON/AliMUON1DMapIterator.h b/MUON/AliMUON1DMapIterator.h
deleted file mode 100644 (file)
index 304b387..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-#ifndef ALIMUON1DMAPITERATOR_H
-#define ALIMUON1DMAPITERATOR_H
-
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
-* See cxx source for full Copyright notice                               */
-
-// $Id$
-
-/// \ingroup core
-/// \class AliMUON1DMapIterator
-/// \brief Implementation of TIterator for 1D maps
-/// 
-//  Author Laurent Aphecetche
-
-#ifndef ROOT_TObject
-#  include "TObject.h"
-#endif
-#ifndef ROOT_TExMap
-#  include "TExMap.h"
-#endif
-#ifndef ROOT_TIterator
-#  include "TIterator.h"
-#endif
-
-class AliMpExMap;
-
-//_____________________________________________________________________________
-class AliMUON1DMapIterator : public TIterator
-{
-public:
-  AliMUON1DMapIterator(const AliMpExMap& theMap);
-  AliMUON1DMapIterator(const AliMUON1DMapIterator&);
-  AliMUON1DMapIterator& operator=(const AliMUON1DMapIterator& rhs);
-  TIterator& operator=(const TIterator& iterator);  
-  virtual ~AliMUON1DMapIterator();
-  
-  /** The returned object must not be deleted by the user ! */
-  virtual TObject* Next();
-  
-  virtual void Reset(); 
-  
-  /// Return 0 as we're not really dealing with a TCollection
-  virtual const TCollection* GetCollection() const { return 0x0; }
-  
-private:
-  const AliMpExMap* fkMap; ///< Top map we iterate upon
-  Int_t fCurrentI;         ///< Current position in fMap
-  
-  ClassDef(AliMUON1DMapIterator,0) // VDataIterator for 1D maps
-};
-
-
-#endif
index b849ca655c902f3e640644841e6e350095981c83..2c003c07bd3c000317209a188b0927d92527f1d8 100644 (file)
@@ -26,6 +26,7 @@
 
 #include "AliMUONDigitStoreV1Iterator.h"
 
+#include "AliLog.h"
 #include "AliMpDEManager.h"
 #include "AliMUONVDigit.h"
 #include "TObjArray.h"
@@ -65,12 +66,20 @@ AliMUONDigitStoreV1Iterator&
 AliMUONDigitStoreV1Iterator::operator=(const TIterator& rhs)
 {
   /// overriden assignment operator (imposed by Root's definition of TIterator ?)
-  if ( this != &rhs && rhs.IsA() == AliMUONDigitStoreV1Iterator::Class()) 
+  
+  if ( this != &rhs )
   {
-    const AliMUONDigitStoreV1Iterator& rhs1 = 
-    static_cast<const AliMUONDigitStoreV1Iterator&>(rhs);
-    
-    AliMUONDigitStoreV1Iterator::operator=(rhs1);
+    if ( rhs.IsA() != AliMUONDigitStoreV1Iterator::Class() )
+    {
+      AliErrorGeneral("AliMUONDigitStoreV1Iterator::operator=","Wrong type");
+    }
+    else
+    {
+      const AliMUONDigitStoreV1Iterator& rhs1 = 
+      static_cast<const AliMUONDigitStoreV1Iterator&>(rhs);
+      
+      AliMUONDigitStoreV1Iterator::operator=(rhs1);
+    }
   }
   return *this;
 }
@@ -82,6 +91,7 @@ AliMUONDigitStoreV1Iterator::operator=(const AliMUONDigitStoreV1Iterator& rhs)
   /// assignement operator
   if ( this != &rhs ) 
   {
+    TIterator::operator=(rhs);
     fArray = rhs.fArray;
     fFirstDetElemId = rhs.fFirstDetElemId;
     fLastDetElemId = rhs.fLastDetElemId;
index f07bc60e7f59f6726dd18e443afb192c6f738e6d..36777647efc5a5a4e269fad6b9e4ab5d30f97b4a 100644 (file)
@@ -25,6 +25,7 @@
 
 #include "AliMUONTOTCAStoreIterator.h"
 
+#include "AliLog.h"
 #include <TClonesArray.h>
 #include <TObjArray.h>
 
@@ -54,12 +55,18 @@ AliMUONTOTCAStoreIterator&
 AliMUONTOTCAStoreIterator::operator=(const TIterator& rhs)
 {
   /// Overriden operator= (imposed by Root's declaration of TIterator ?)
-  if ( this != &rhs && rhs.IsA() == AliMUONTOTCAStoreIterator::Class() )
+  if ( this != &rhs )
   {
-    const AliMUONTOTCAStoreIterator& rhs1 = 
-    static_cast<const AliMUONTOTCAStoreIterator&>(rhs);
-    
-    rhs1.CopyTo(*this);
+    if ( rhs.IsA() != AliMUONTOTCAStoreIterator::Class() )
+    {
+      AliErrorGeneral("AliMUONTOTCAStoreIterator::operator=","Wrong type");
+    }
+    else
+    {
+      const AliMUONTOTCAStoreIterator& rhs1 = 
+      static_cast<const AliMUONTOTCAStoreIterator&>(rhs);
+      rhs1.CopyTo(*this);
+    }
   }
   return *this;
 }