GSI Object Oriented Online Offline (Go4)  GO4-6.1.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4ObjectQueue.cxx
Go to the documentation of this file.
1 // $Id: TGo4ObjectQueue.cxx 2627 2019-10-01 08:02:45Z 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 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 = 0;
46  if (clone && (object != 0)) {
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 = 0;
58  if (buffer != 0) {
59  buffer->SetReadMode();
60  buffer->Reset();
61  buffer->InitMap();
62  TClass *cl = buffer->ReadClass();
63  // std::cout <<"object queue: read class " << cl << std::endl;
64  // if(cl)
65  // std::cout <<"object queue: class name " << cl->GetName() << std::endl;
66  buffer->Reset();
67  entry = buffer->ReadObject(cl);
68 
69  // std::cout <<"object queue: read object " << entry << std::endl;
70  // if(entry)
71  // std::cout <<"object queue: classname " << entry->ClassName() << std::endl;
72  }
73  Add(entry);
74 }
void Add(TObject *ob)
Definition: TGo4Queue.cxx:69
void AddObject(TObject *object, Bool_t clone=kFALSE)
virtual ~TGo4ObjectQueue()
TObject * WaitObject()
void AddObjectFromBuffer(TBuffer *buffer)
#define GO4TRACE(X)
Definition: TGo4Log.h:26
TObject * Wait()
Definition: TGo4Queue.cxx:50