-// @(#)alimdc:$Name$:$Id$
+// @(#) $Id$
// Author: Fons Rademakers 26/11/99
/**************************************************************************
}
//______________________________________________________________________________
-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) rawData = (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);
+ }
}