// class AliHBTEventBuffer
//
// FIFO type event buffer
+//
+// Piotr.Skowronski@cern.ch
+//
+////////////////////////////////////////////////////////
AliHBTEventBuffer::AliHBTEventBuffer():
fSize(-1),fEvents(),fIter(&fEvents)
//ctor
}
/***********************************************************/
+
AliHBTEventBuffer::AliHBTEventBuffer(Int_t size):
fSize(size),fEvents(),fIter(&fEvents)
{
//ctor
}
+/***********************************************************/
+
+AliHBTEventBuffer::~AliHBTEventBuffer()
+{
+ //dtor -- TList::IsOwner(1) does not work - Valgrind says that there is mem leak
+ //take care owerseves
+ if (fEvents.IsOwner())
+ {
+ AliHBTEvent* e=0x0;
+ while (( e=RemoveLast() )) delete e;
+ }
+}
+/***********************************************************/
AliHBTEvent* AliHBTEventBuffer::Push(AliHBTEvent* event)
{
#ifndef ALIHBTEVENTBUFFER_H
#define ALIHBTEVENTBUFFER_H
+//______________________________________________________
+////////////////////////////////////////////////////////
+//
+// class AliHBTEventBuffer
+//
+// FIFO type event buffer
+//
+// Piotr.Skowronski@cern.ch
+//
+////////////////////////////////////////////////////////
#include <TObject.h>
#include <TList.h>
public:
AliHBTEventBuffer();
AliHBTEventBuffer(Int_t size);
- virtual ~AliHBTEventBuffer(){}
+ virtual ~AliHBTEventBuffer();
AliHBTEvent* Push(AliHBTEvent* event);//adds a new event, and returns old of do not fit in size
AliHBTEvent* RemoveLast(){return dynamic_cast<AliHBTEvent*>(fEvents.Remove(fEvents.Last()));}