00001 // $Id: TGo4Queue.h 888 2012-11-11 18:34:35Z 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 TGO4QUEUE_H 00015 #define TGO4QUEUE_H 00016 00017 #include "TNamed.h" 00018 00019 class TCondition; 00020 class TList; 00021 class TMutex; 00022 00031 class TGo4Queue : public TNamed { 00032 public: 00033 TGo4Queue(const char* name = 0); 00034 00035 virtual ~TGo4Queue(); 00036 00037 virtual void Clear(Option_t* opt=""); 00038 00039 virtual void Wake(); 00040 00041 Bool_t IsEmpty(); 00042 00043 Int_t GetEntries() const { return fiEntries; } 00044 00045 void SetMaxEntries(Int_t max) { fiMaxEntries = max; } 00046 00047 protected: 00048 TObject* Next(); 00049 TObject* Wait(); 00050 void Add(TObject* ob); 00051 00052 private: 00053 TMutex* fxMutex; 00054 TCondition* fxCondition; 00055 TList* fxList; 00056 Int_t fiEntries; 00057 Int_t fiMaxEntries; 00058 Bool_t fbWakeUpCall; 00059 }; 00060 00061 #endif //TGO4QUEUE_H