]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Coverity 18330 solved by non-implemented private copy constructor and assignment...
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 24 Feb 2012 10:04:34 +0000 (10:04 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 24 Feb 2012 10:04:34 +0000 (10:04 +0000)
STEER/STEER/AliDCSArray.cxx
STEER/STEER/AliDCSArray.h

index 225e912e053345efc5b54b51c3b9954c6efa3925..dcb1ca456f5643659bf9ad532dd6accd8b199399 100644 (file)
@@ -212,59 +212,6 @@ AliDCSArray::AliDCSArray(Int_t nentries, TObjArray* value, Double_t timeStamp) :
        }
 }
 
-//-----------------------------------------------------------------------
-AliDCSArray::AliDCSArray(const AliDCSArray& c) :
-       TObject(c),
-       fType(c.fType),
-       fnentries(c.fnentries),
-       fBool(0x0),
-       fChar(0x0),
-       fInt(0x0),
-       fUInt(0x0),
-       fFloat(0x0),
-       fStringArray(0x0),
-       fTimeStamp(c.fTimeStamp),
-       fDouble(0x0)
-{
-       //
-       // copy constructor
-       //
-       
-       if (fType == kBool && c.fBool){
-               fBool = new Bool_t[fnentries];
-               memcpy(fBool,c.fBool,fnentries*sizeof(Bool_t));
-       } 
-       if (fType == kChar && c.fChar){
-               fChar = new Char_t[fnentries];
-               memcpy(fChar,c.fChar,fnentries*sizeof(Char_t));
-       } 
-       if (fType == kUInt && c.fUInt){
-               fUInt = new UInt_t[fnentries];
-               memcpy(fUInt,c.fUInt,fnentries*sizeof(UInt_t));
-       } 
-       if (fType == kInt && c.fInt){
-               fInt = new Int_t[fnentries];
-               memcpy(fInt,c.fInt,fnentries*sizeof(Int_t));
-       } 
-       if (fType == kFloat && c.fFloat){
-               fFloat = new Float_t[fnentries];
-               memcpy(fFloat,c.fFloat,fnentries*sizeof(Float_t));
-       } 
-       if (fType == kDouble && c.fDouble){
-               fDouble = new Double_t[fnentries];
-               memcpy(fDouble,c.fDouble,fnentries*sizeof(Double_t));
-       } 
-       if (fType == kString && c.fStringArray){
-               fStringArray = new TObjArray();
-               fStringArray->SetOwner(1);
-               for (Int_t i = 0; i<fnentries; i++){
-                       TObjString* strobj = new TObjString(*(TObjString*)(c.fStringArray->At(i)));
-                       fStringArray->Add(strobj);
-               }
-       }
-
-}
-
 //-----------------------------------------------------------------------
 AliDCSArray::~AliDCSArray()
 {
@@ -302,50 +249,6 @@ AliDCSArray::~AliDCSArray()
        }
 }
 
-//-----------------------------------------------------------------------
-AliDCSArray &AliDCSArray::operator=(const AliDCSArray &c)
-{
-       //
-       // operator = 
-       //
-       
-       if(&c == this) return *this;
-       if (fType == kBool && c.fBool){
-               fBool = new Bool_t[fnentries];
-               memcpy(fBool,c.fBool,fnentries*sizeof(Bool_t));
-       } 
-       if (fType == kChar && c.fChar){
-               fChar = new Char_t[fnentries];
-               memcpy(fChar,c.fChar,fnentries*sizeof(Char_t));
-       } 
-       if (fType == kUInt && c.fUInt){
-               fUInt = new UInt_t[fnentries];
-               memcpy(fUInt,c.fUInt,fnentries*sizeof(UInt_t));
-       } 
-       if (fType == kInt && c.fInt){
-               fInt = new Int_t[fnentries];
-               memcpy(fInt,c.fInt,fnentries*sizeof(Int_t));
-       } 
-       if (fType == kFloat && c.fFloat){
-               fFloat = new Float_t[fnentries];
-               memcpy(fFloat,c.fFloat,fnentries*sizeof(Float_t));
-       } 
-       if (fType == kDouble && c.fDouble){
-               fDouble = new Double_t[fnentries];
-               memcpy(fDouble,c.fDouble,fnentries*sizeof(Double_t));
-       } 
-       if (fType == kString && c.fStringArray){
-               fStringArray = new TObjArray();
-               fStringArray->SetOwner(1);
-               for (Int_t i = 0; i<fnentries; i++){
-                       TObjString* strobj = new TObjString(*(TObjString*)(c.fStringArray->At(i)));
-                       fStringArray->Add(strobj);
-               }
-       }
-
-       return *this;
-}
-
 //-----------------------------------------------------------------------
 void AliDCSArray::Init()
 {
index 2dd5c5190dfa191d5a8f52ec2aca8dc91a5f844f..c92223ca3d56f65e08e9474f91eb8e5d8292272d 100644 (file)
@@ -31,12 +31,9 @@ class AliDCSArray : public TObject {
        };
        
        AliDCSArray();
-       AliDCSArray(const AliDCSArray& c);
        
        virtual ~AliDCSArray();
        
-       AliDCSArray& operator=(const AliDCSArray& c);
-       
        AliDCSArray(Int_t nentries, Bool_t* value, Double_t timeStamp);
        AliDCSArray(Int_t nentries, Char_t* value, Double_t timeStamp);
        AliDCSArray(Int_t nentries, Int_t* value, Double_t timeStamp);
@@ -85,6 +82,10 @@ class AliDCSArray : public TObject {
        Double_t fTimeStamp;    // timestamp of this value
 
        Double_t* fDouble;         //[fnentries] double value
+
+ private:
+       AliDCSArray(const AliDCSArray& c);
+       AliDCSArray& operator=(const AliDCSArray& c);
        
        ClassDef(AliDCSArray, 2);
 };