GSI Object Oriented Online Offline (Go4)  GO4-6.3.0
TGo4ObjectQueue.cxx
Go to the documentation of this file.
1 // $Id$
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 fuer 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 #include "TGo4ObjectQueue.h"
15 #include "TBuffer.h"
16 
17 #include "TGo4Log.h"
18 
20  TGo4Queue("Default object queue")
21 {
22  GO4TRACE((14,"TGo4ObjectQueue::TGo4ObjectQueue()", __LINE__, __FILE__));
23 }
24 
26  TGo4Queue(name)
27 {
28  GO4TRACE((14,"TGo4ObjectQueue::TGo4ObjectQueue(const char *)", __LINE__, __FILE__));
29 }
30 
32 {
33  GO4TRACE((14,"TGo4ObjectQueue::~TTGo4ObjectQueue()", __LINE__, __FILE__));
34 }
35 
37 {
38  GO4TRACE((12,"TGo4ObjectQueue::WaitObject()", __LINE__, __FILE__));
39  return Wait();
40 }
41 
42 void TGo4ObjectQueue::AddObject(TObject *object, Bool_t clone)
43 {
44  GO4TRACE((12, "TGo4ObjectQueue::AddObject(TObject *, Bool_t)", __LINE__, __FILE__));
45  TObject *entry = nullptr;
46  if (clone && object) {
47  entry = object->Clone();
48  } else {
49  entry = object;
50  }
51  Add(entry);
52 }
53 
55 {
56  GO4TRACE((12,"TGo4ObjectQueue::AddObjectFromBuffer(TBuffer *)", __LINE__, __FILE__));
57  TObject *entry = nullptr;
58  if (buffer) {
59  buffer->SetReadMode();
60  buffer->Reset();
61  buffer->InitMap();
62  TClass *cl = buffer->ReadClass();
63  buffer->Reset();
64  entry = buffer->ReadObject(cl);
65  }
66  Add(entry);
67 }
void Add(TObject *ob)
Definition: TGo4Queue.cxx:67
void AddObject(TObject *object, Bool_t clone=kFALSE)
virtual ~TGo4ObjectQueue()
TObject * WaitObject()
void AddObjectFromBuffer(TBuffer *buffer)
#define GO4TRACE(X)
Definition: TGo4Log.h:25
TObject * Wait()
Definition: TGo4Queue.cxx:49