00001 // $Id: TGo4BufferQueue.h 695 2011-01-19 15:16:14Z linev $ 00002 //----------------------------------------------------------------------- 00003 // The GSI Online Offline Object Oriented (Go4) Project 00004 // Experiment Data Processing at EE department, GSI 00005 //----------------------------------------------------------------------- 00006 // Copyright (C) 2000- GSI Helmholtzzentrum für Schwerionenforschung GmbH 00007 // Planckstr. 1, 64291 Darmstadt, Germany 00008 // Contact: http://go4.gsi.de 00009 //----------------------------------------------------------------------- 00010 // This software can be used under the license agreements as stated 00011 // in Go4License.txt file which is part of the distribution. 00012 //----------------------------------------------------------------------- 00013 00014 #ifndef TGO4BUFFERQUEUE_H 00015 #define TGO4BUFFERQUEUE_H 00016 00017 #include "TGo4Queue.h" 00018 00019 class TMutex; 00020 class TIterator; 00021 class TList; 00022 00027 class TGo4BufferQueue : public TGo4Queue { 00028 00029 public: 00030 00031 TGo4BufferQueue() ; 00032 00033 TGo4BufferQueue(const char* name); 00034 00040 void AddBufferFromObject(TObject * object); 00041 00047 void AddBuffer(TBuffer * buffer, Bool_t clone=kFALSE); 00048 00056 void FreeBuffer(TBuffer * buffer); 00057 00059 virtual void Clear(Option_t* opt=""); 00060 00065 TBuffer * WaitBuffer(); 00066 00072 TObject * WaitObjectFromBuffer(); 00073 00074 virtual ~TGo4BufferQueue() ; 00075 00083 static TBuffer* CreateValueBuffer(UInt_t val); 00084 00092 static Int_t DecodeValueBuffer(TBuffer* buf); 00093 00094 00098 static const Int_t fgiISOWNER; 00099 00100 private: 00104 void InitBuffers(); 00105 00109 void Realloc(TBuffer* buffer, Int_t oldsize, Int_t newsize); 00110 00114 TBuffer* NewEntry(); 00115 00116 00117 00129 TList* fxBufferList; 00130 00132 TList* fxFreeList; 00133 TMutex * fxBufferMutex; 00134 Int_t fiOverflowcount; 00135 00140 Int_t fiMaxBuffers; 00141 00142 }; 00143 00144 #endif //TGO4BUFFERQUEUE_H