]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
reverting r39713 due to problems it caused with some compilers
authorrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 17 Mar 2010 12:22:56 +0000 (12:22 +0000)
committerrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 17 Mar 2010 12:22:56 +0000 (12:22 +0000)
HLT/BASE/AliHLTDataBuffer.cxx
HLT/BASE/AliHLTDataBuffer.h

index 86bf6d5156985bab1021291f88d539b718caecb0..36a9d83f2982dc17796e50e6487e100f47fed016 100644 (file)
     @brief  Handling of Data Buffers for HLT components.
 */
 
-// see header file for class documentation
-// or
-// refer to README to build package
-// or
-// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
-
 #if __GNUC__>= 3
 using namespace std;
 #endif
@@ -848,7 +842,6 @@ AliHLTDataBuffer::AliHLTRawBuffer::AliHLTRawBuffer(AliHLTUInt32_t size, AliHLTUI
 
 AliHLTDataBuffer::AliHLTRawBuffer::~AliHLTRawBuffer()
 {
-  // see header file for class documentation
   if (fExternalPtr==NULL && fPtr) {
     free(fPtr);
   }
@@ -857,40 +850,40 @@ AliHLTDataBuffer::AliHLTRawBuffer::~AliHLTRawBuffer()
   fTotalSize=0;
 }
 
-int AliHLTDataBuffer::AliHLTRawBuffer::operator==(const void* ptr) const
+int AliHLTDataBuffer::AliHLTRawBuffer::operator==(void* ptr) const
 {
   // see header file for function documentation
-  return fPtr == static_cast<const AliHLTUInt8_t*>(ptr);
+  return fPtr == static_cast<AliHLTUInt8_t*>(ptr);
 }
 
-int AliHLTDataBuffer::AliHLTRawBuffer::operator<(const void* ptr) const
+int AliHLTDataBuffer::AliHLTRawBuffer::operator<(void* ptr) const
 {
   // see header file for function documentation
-  int iResult=fPtr < static_cast<const AliHLTUInt8_t*>(ptr);
+  int iResult=fPtr < static_cast<AliHLTUInt8_t*>(ptr);
   //printf("%p: %p <= %p (%d)\n", this, fPtr, ptr, iResult);
   return iResult;
 }
 
-int AliHLTDataBuffer::AliHLTRawBuffer::operator<=(const void* ptr) const
+int AliHLTDataBuffer::AliHLTRawBuffer::operator<=(void* ptr) const
 {
   // see header file for function documentation
-  int iResult=fPtr <= static_cast<const AliHLTUInt8_t*>(ptr);
+  int iResult=fPtr <= static_cast<AliHLTUInt8_t*>(ptr);
   //printf("%p: %p <= %p (%d)\n", this, fPtr, ptr, iResult);
   return iResult;
 }
 
-int AliHLTDataBuffer::AliHLTRawBuffer::operator>(const void* ptr) const
+int AliHLTDataBuffer::AliHLTRawBuffer::operator>(void* ptr) const
 {
   // see header file for function documentation
-  int iResult=fPtr+fSize > static_cast<const AliHLTUInt8_t*>(ptr);
+  int iResult=fPtr+fSize > static_cast<AliHLTUInt8_t*>(ptr);
   //printf("%p: %p + %d > %p (%d)\n", this, fPtr, fSize, ptr, iResult);
   return iResult;
 }
 
-int AliHLTDataBuffer::AliHLTRawBuffer::operator-(const void* ptr) const
+int AliHLTDataBuffer::AliHLTRawBuffer::operator-(void* ptr) const
 {
   // see header file for function documentation
-  return static_cast<int>(static_cast<const AliHLTUInt8_t*>(ptr)-fPtr);
+  return static_cast<int>(static_cast<AliHLTUInt8_t*>(ptr)-fPtr);
 }
 
 int AliHLTDataBuffer::AliHLTRawBuffer::operator<(const AliHLTRawBuffer& op) const
@@ -1191,7 +1184,7 @@ int AliHLTDataBuffer::AliHLTRawPage::Free(AliHLTRawBuffer* pBuffer)
   return 1;
 }
 
-int AliHLTDataBuffer::AliHLTRawPage::SetSize(const AliHLTDataBuffer::AliHLTRawBuffer* pBuffer, AliHLTUInt32_t size)
+int AliHLTDataBuffer::AliHLTRawPage::SetSize(AliHLTDataBuffer::AliHLTRawBuffer* pBuffer, AliHLTUInt32_t size)
 {
   /// set the size of a raw buffer and release the remaining part
   int iResult=0;
@@ -1218,7 +1211,7 @@ int AliHLTDataBuffer::AliHLTRawPage::SetSize(const AliHLTDataBuffer::AliHLTRawBu
   return 1;
 }
 
-bool AliHLTDataBuffer::AliHLTRawPage::HasBuffer(const AliHLTDataBuffer::AliHLTRawBuffer* pBuffer)
+bool AliHLTDataBuffer::AliHLTRawPage::HasBuffer(AliHLTDataBuffer::AliHLTRawBuffer* pBuffer)
 {
   /// check if the buffer is in this page
   for (AliHLTRawBufferPList::iterator iter=fUsedBuffers.begin();
@@ -1349,7 +1342,7 @@ int AliHLTDataBuffer::AliHLTRawPage::GlobalClean()
   return 0;
 }
 
-AliHLTDataBuffer::AliHLTRawPage* AliHLTDataBuffer::AliHLTRawPage::NextPage(const AliHLTDataBuffer::AliHLTRawPage* prev)
+AliHLTDataBuffer::AliHLTRawPage* AliHLTDataBuffer::AliHLTRawPage::NextPage(AliHLTDataBuffer::AliHLTRawPage* prev)
 {
   // get next global page
   vector<AliHLTDataBuffer::AliHLTRawPage*>::iterator page=fgGlobalPages.begin();
index b8f7402fd8392376435b18da596f6c04d41f4cc1..4c7af5aa022781b511b2799f129965013da5f768 100644 (file)
@@ -1,11 +1,9 @@
-//-*- Mode: C++ -*-
-// $Id$
+// @(#) $Id$
 
 #ifndef ALIHLTDATABUFFER_H
 #define ALIHLTDATABUFFER_H
-//* This file is property of and copyright by the ALICE HLT Project        * 
-//* ALICE Experiment at CERN, All rights reserved.                         *
-//* See cxx source for full Copyright notice                               *
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
 
 /** @file   AliHLTDataBuffer.h
     @author Matthias Richter
@@ -245,6 +243,8 @@ class AliHLTDataBuffer : public TObject, public AliHLTLogging
    * @brief  Descriptor of a data segment within the buffer.
    */
   class AliHLTDataSegment {
+    friend class AliHLTDataBuffer;
+    friend class AliHLTConsumerDescriptor;
   public:
     AliHLTDataSegment()
       :
@@ -269,7 +269,7 @@ class AliHLTDataBuffer : public TObject, public AliHLTLogging
     AliHLTDataSegment(void* ptr, AliHLTUInt32_t offset, AliHLTUInt32_t size) 
       :
       fDataType(kAliHLTVoidDataType),
-      fPtr(reinterpret_cast<AliHLTUInt8_t*>(ptr)),
+      fPtr((AliHLTUInt8_t*)ptr),
       fSegmentOffset(offset),
       fSegmentSize(size),
       fSpecification(0)
@@ -279,7 +279,7 @@ class AliHLTDataBuffer : public TObject, public AliHLTLogging
     AliHLTDataSegment(void* ptr, AliHLTUInt32_t offset, AliHLTUInt32_t size, AliHLTComponentDataType dt, AliHLTUInt32_t spec)
       :
       fDataType(dt),
-      fPtr(reinterpret_cast<AliHLTUInt8_t*>(ptr)),
+      fPtr((AliHLTUInt8_t*)ptr),
       fSegmentOffset(offset),
       fSegmentSize(size),
       fSpecification(spec)
@@ -307,8 +307,6 @@ class AliHLTDataBuffer : public TObject, public AliHLTLogging
     AliHLTUInt32_t fSegmentSize;                                   // see above
     /** data specification */
     AliHLTUInt32_t fSpecification;                                 // see above
-
-    friend class AliHLTDataBuffer; // TODO: implement some getters/setters
   };
 
   class AliHLTRawBuffer;
@@ -337,16 +335,16 @@ class AliHLTDataBuffer : public TObject, public AliHLTLogging
     /** adjust global page size */
     static void SetGlobalPageSize(AliHLTUInt32_t size) {fgGlobalPageSize=size;}
     /** find next page after prev, or first page */
-    static AliHLTRawPage* NextPage(const AliHLTRawPage* prev=NULL);
+    static AliHLTRawPage* NextPage(AliHLTRawPage* prev=NULL);
 
     /** alloc a buffer of specified size */
     AliHLTRawBuffer* Alloc(AliHLTUInt32_t size);
     /** free a buffer and merge consecutive free buffers */
     int Free(AliHLTRawBuffer* pBuffer);
     /** set the size of a raw buffer and release the remaining part */
-    int SetSize(const AliHLTRawBuffer* pBuffer, AliHLTUInt32_t size);
+    int SetSize(AliHLTRawBuffer* pBuffer, AliHLTUInt32_t size);
     /// check if the buffer is in this page
-    bool HasBuffer(const AliHLTRawBuffer* pBuffer);
+    bool HasBuffer(AliHLTRawBuffer* pBuffer);
 
     AliHLTUInt32_t Size() const {return fSize;}
     AliHLTUInt32_t Capacity() const;
@@ -460,15 +458,15 @@ class AliHLTDataBuffer : public TObject, public AliHLTLogging
      */
     void Print(const char* option);
 
-    int operator==(const void* ptr) const;
-    int operator==(const AliHLTUInt8_t* ptr) const {return fPtr==ptr;}
-    int operator<(const void* ptr) const;
-    int operator<=(const void* ptr) const;
-    int operator>(const void* ptr) const;
-    int operator-(const void* ptr) const;
-    int operator<(const AliHLTRawBuffer& op) const;
-    int operator<=(const AliHLTRawBuffer& op) const;
-    int operator>(const AliHLTRawBuffer& op) const;
+    int operator==(void*) const;
+    int operator==(AliHLTUInt8_t* ptr) const {return fPtr==ptr;}
+    int operator<(void*) const;
+    int operator<=(void*) const;
+    int operator>(void*) const;
+    int operator-(void*) const;
+    int operator<(const AliHLTRawBuffer&) const;
+    int operator<=(const AliHLTRawBuffer&) const;
+    int operator>(const AliHLTRawBuffer&) const;
 
     operator void*() const {return fPtr;}
     operator AliHLTUInt8_t*() const {return fPtr;}