GSI Object Oriented Online Offline (Go4)  GO4-5.3.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4Queue.h
Go to the documentation of this file.
1 // $Id: TGo4Queue.h 888 2012-11-11 18:34:35Z linev $
2 //-----------------------------------------------------------------------
3 // The GSI Online Offline Object Oriented (Go4) Project
4 // Experiment Data Processing at EE department, GSI
5 //-----------------------------------------------------------------------
6 // Copyright (C) 2000- GSI Helmholtzzentrum f�r Schwerionenforschung GmbH
7 // Planckstr. 1, 64291 Darmstadt, Germany
8 // Contact: http://go4.gsi.de
9 //-----------------------------------------------------------------------
10 // This software can be used under the license agreements as stated
11 // in Go4License.txt file which is part of the distribution.
12 //-----------------------------------------------------------------------
13 
14 #ifndef TGO4QUEUE_H
15 #define TGO4QUEUE_H
16 
17 #include "TNamed.h"
18 
19 class TCondition;
20 class TList;
21 class TMutex;
22 
31 class TGo4Queue : public TNamed {
32  public:
33  TGo4Queue(const char* name = 0);
34 
35  virtual ~TGo4Queue();
36 
37  virtual void Clear(Option_t* opt="");
38 
39  virtual void Wake();
40 
41  Bool_t IsEmpty();
42 
43  Int_t GetEntries() const { return fiEntries; }
44 
45  void SetMaxEntries(Int_t max) { fiMaxEntries = max; }
46 
47  protected:
48  TObject* Next();
49  TObject* Wait();
50  void Add(TObject* ob);
51 
52  private:
53  TMutex* fxMutex;
54  TCondition* fxCondition;
55  TList* fxList;
56  Int_t fiEntries;
57  Int_t fiMaxEntries;
58  Bool_t fbWakeUpCall;
59 };
60 
61 #endif //TGO4QUEUE_H
void Add(TObject *ob)
Definition: TGo4Queue.cxx:70
TGo4Queue(const char *name=0)
Definition: TGo4Queue.cxx:24
void SetMaxEntries(Int_t max)
Definition: TGo4Queue.h:45
virtual void Wake()
Definition: TGo4Queue.cxx:94
Bool_t fbWakeUpCall
Definition: TGo4Queue.h:58
virtual ~TGo4Queue()
Definition: TGo4Queue.cxx:35
TMutex * fxMutex
Definition: TGo4Queue.h:53
Bool_t IsEmpty()
Definition: TGo4Queue.cxx:88
Int_t GetEntries() const
Definition: TGo4Queue.h:43
TCondition * fxCondition
Definition: TGo4Queue.h:54
Int_t fiEntries
Definition: TGo4Queue.h:56
Int_t fiMaxEntries
Definition: TGo4Queue.h:57
TObject * Wait()
Definition: TGo4Queue.cxx:51
TList * fxList
Definition: TGo4Queue.h:55
virtual void Clear(Option_t *opt="")
Definition: TGo4Queue.cxx:45
TObject * Next()
Definition: TGo4Queue.cxx:64