GSI Object Oriented Online Offline (Go4)  GO4-5.3.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4ObjectQueue.cxx
Go to the documentation of this file.
1 // $Id: TGo4ObjectQueue.cxx 1844 2016-02-12 12:42:48Z adamczew $
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 #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  {
48  entry=object->Clone();
49  }
50  else
51  {
52  entry=object;
53  }
54  Add(entry);
55 
56 }
57 
59 {
60  GO4TRACE((12,"TGo4ObjectQueue::AddObjectFromBuffer(TBuffer*)", __LINE__, __FILE__));
61  TObject* entry=0;
62  if(buffer!=0)
63  {
64  buffer->SetReadMode();
65  buffer->Reset();
66  buffer->InitMap();
67  TClass* cl= buffer->ReadClass();
68 // std::cout <<"object queue: read class " << cl << std::endl;
69 // if(cl)
70 // std::cout <<"object queue: class name " << cl->GetName() << std::endl;
71  buffer->Reset();
72  entry = buffer->ReadObject(cl);
73 
74 // std::cout <<"object queue: read object " << entry << std::endl;
75 // if(entry)
76 // std::cout <<"object queue: classname " << entry->ClassName() << std::endl;
77  }
78  else
79  {
80 // std::cout <<"object queue: zero buffer" << std::endl;
81  }
82  Add(entry);
83 }
void Add(TObject *ob)
Definition: TGo4Queue.cxx:70
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:51