Updating
[u/mrichter/AliRoot.git] / HBTAN / AliHBTEventBuffer.cxx
CommitLineData
bed069a4 1#include "AliHBTEventBuffer.h"
2
3ClassImp(AliHBTEventBuffer)
4
5//______________________________________________________
6////////////////////////////////////////////////////////
7//
8// class AliHBTEventBuffer
9//
10// FIFO type event buffer
11
12AliHBTEventBuffer::AliHBTEventBuffer():
13 fSize(-1),fEvents(),fIter(&fEvents)
14{
15 //ctor
16}
17/***********************************************************/
18AliHBTEventBuffer::AliHBTEventBuffer(Int_t size):
19 fSize(size),fEvents(),fIter(&fEvents)
20{
21 //ctor
22}
23
24AliHBTEvent* AliHBTEventBuffer::Push(AliHBTEvent* event)
25{
26 //adds a new event, and returns old of do not fit in size
27 if (fSize == 0) return event;
28
29 AliHBTEvent* ret = 0x0;
30
31 if (fSize == fEvents.GetSize())
32 ret = dynamic_cast<AliHBTEvent*>(fEvents.Remove(fEvents.Last()));
33 if (event) fEvents.AddFirst(event);
34 return ret;
35}
36