]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - RAW/AliRawEquipment.cxx
- Derive value types from TObject so that they can be used in CINT
[u/mrichter/AliRoot.git] / RAW / AliRawEquipment.cxx
index 22647bbc768d8d16da1bd338fcf71a6eb43972be..0384978696d616d97a6520ebf2a129370558b0c0 100644 (file)
@@ -86,40 +86,43 @@ AliRawData *AliRawEquipment::GetRawData()
 }
 
 //______________________________________________________________________________
-void AliRawEquipment::Reset()
+AliRawEquipment::~AliRawEquipment()
 {
-   // Reset the equipment in case it needs to be re-used (avoiding costly
-   // new/delete cycle). We reset the size marker for the AliRawData
-   // object.
+   // Clean up event object. Delete also, possible, private raw data.
 
-   if (fEqpHdr) fEqpHdr->Reset();
-   GetRawData()->SetSize(0);
-   fRawDataRef = NULL;
+   delete fEqpHdr;
+   delete fRawData;
 }
 
 //______________________________________________________________________________
-AliRawEquipment::~AliRawEquipment()
+void AliRawEquipment::CloneRawData(const AliRawData *rawData)
 {
-   // Clean up event object. Delete also, possible, private raw data.
+  // Clone the input raw data and
+  // flush the TRef
 
-   delete fEqpHdr;
-   delete fRawData;
+  fRawDataRef = NULL;
+  if (rawData) fRawData = (AliRawData*)rawData->Clone();
 }
 
 //______________________________________________________________________________
-void AliRawEquipment::SetRawDataRef(AliRawDataArray *array)
+void AliRawEquipment::Streamer(TBuffer &R__b)
 {
-  // Set the TRef to the raw-data container
-  // before writing it to the branch
-  if (fRawData) {
-    fRawDataRef = fRawData;
-    array->Add(fRawData);
-    fRawData = NULL;
-    return;
-  }
-  else {
-    Error("SetRawDataRef", "Raw-data payload does not exist! Can not set a reference to it!");    
-    fRawDataRef = NULL;
-    return;
-  }
+   // Stream an object of class AliRawEquipment.
+
+   UInt_t R__s, R__c;
+   if (R__b.IsReading()) {
+      Version_t R__v = R__b.ReadVersion(&R__s, &R__c); if (R__v) { }
+      TObject::Streamer(R__b);
+      R__b >> fEqpHdr;
+      R__b >> fRawData;
+      fRawDataRef.Streamer(R__b);
+      R__b.CheckByteCount(R__s, R__c, AliRawEquipment::IsA());
+   } else {
+      R__c = R__b.WriteVersion(AliRawEquipment::IsA(), kTRUE);
+      TObject::Streamer(R__b);
+      R__b << fEqpHdr;
+      R__b << fRawData;
+      fRawDataRef.Streamer(R__b);
+      R__b.SetByteCount(R__c, kTRUE);
+   }
 }