00001 // $Id: TGo4Queue.h 478 2009-10-29 12:26:09Z 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(); 00034 00035 TGo4Queue(const char* name); 00036 00037 virtual ~TGo4Queue(); 00038 00039 virtual void Clear(Option_t* opt=""); 00040 00041 virtual void Wake(); 00042 00043 Bool_t IsEmpty(); 00044 00045 00046 Int_t GetEntries() const { return fiEntries; } 00047 00048 void SetMaxEntries(Int_t max) { fiMaxEntries = max; } 00049 00050 protected: 00051 TObject* Next(); 00052 TObject* Wait(); 00053 void Add(TObject* ob); 00054 00055 00056 00057 private: 00058 TMutex* fxMutex; 00059 TCondition* fxCondition; 00060 TList* fxList; 00061 Int_t fiEntries; 00062 Int_t fiMaxEntries; 00063 Bool_t fbWakeUpCall; 00064 }; 00065 00066 #endif //TGO4QUEUE_H