]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/MUON/AliHLTMUONDataBlockReader.h
Getting rid of effC++ warnings about missing copy constructor and assignment operator.
[u/mrichter/AliRoot.git] / HLT / MUON / AliHLTMUONDataBlockReader.h
index 5b69058aa854d00e6ac81166f79d198d1d65af5e..ce604c61c0c1a3137b3d18b7a0e731d845a846de 100644 (file)
@@ -90,6 +90,31 @@ public:
        {
                assert( buffer != NULL );
        }
+       
+       /**
+        * Copy constructor that performs a shallow copy.
+        * Since this class does not take direct ownership of the buffer, never
+        * allocates or deallocates memory, this can be allowed.
+        */
+       AliHLTMUONDataBlockReader(const AliHLTMUONDataBlockReader& reader)
+       {
+               fSize = reader.fSize;
+               fBlock = reader.fBlock;
+               fData = reader.fData;
+       }
+       
+       /**
+        * Assignment operator performs a shallow copy.
+        * This is OK because this class does not take direct ownership of the
+        * output memory buffer.
+        */
+       AliHLTMUONDataBlockReader& operator = (const AliHLTMUONDataBlockReader& reader)
+       {
+               fSize = reader.fSize;
+               fBlock = reader.fBlock;
+               fData = reader.fData;
+               return *this;
+       }
 
        /**
         * Checks that the size of the buffer storing the data block is correct.