Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

TGo4ObjectQueue.cxx

Go to the documentation of this file.
00001 //-------------------------------------------------------------
00002 //        Go4 Release Package v3.04-01 (build 30401)
00003 //                      28-November-2008
00004 //---------------------------------------------------------------
00005 //   The GSI Online Offline Object Oriented (Go4) Project
00006 //   Experiment Data Processing at EE department, GSI
00007 //---------------------------------------------------------------
00008 //
00009 //Copyright (C) 2000- Gesellschaft f. Schwerionenforschung, GSI
00010 //                    Planckstr. 1, 64291 Darmstadt, Germany
00011 //Contact:            http://go4.gsi.de
00012 //----------------------------------------------------------------
00013 //This software can be used under the license agreements as stated
00014 //in Go4License.txt file which is part of the distribution.
00015 //----------------------------------------------------------------
00016 #include "TGo4ObjectQueue.h"
00017 
00018 #include "Riostream.h"
00019 
00020 #include "TGo4Log.h"
00021 
00022 TGo4ObjectQueue::TGo4ObjectQueue()
00023    : TGo4Queue("Default object queue")
00024 {
00025    TRACE((14,"TGo4ObjectQueue::TGo4ObjectQueue()", __LINE__, __FILE__));
00026 }
00027 
00028 TGo4ObjectQueue::TGo4ObjectQueue(const char* name)
00029    : TGo4Queue(name)
00030 {
00031    TRACE((14,"TGo4ObjectQueue::TGo4ObjectQueue(const char*)", __LINE__, __FILE__));
00032 }
00033 
00034 TGo4ObjectQueue::~TGo4ObjectQueue()
00035 {
00036    TRACE((14,"TGo4ObjectQueue::~TTGo4ObjectQueue()", __LINE__, __FILE__));
00037 }
00038 
00039 TObject* TGo4ObjectQueue::WaitObject()
00040 {
00041    TRACE((12,"TGo4ObjectQueue::WaitObject()", __LINE__, __FILE__));
00042    return (Wait());
00043 }
00044 
00045 void TGo4ObjectQueue::AddObject(TObject * object, Bool_t clone)
00046 {
00047    TRACE((12,"TGo4ObjectQueue::AddObject(TObject*, Bool_t)", __LINE__, __FILE__));
00048    TObject* entry=0;
00049    if(clone && (object!=0))
00050       {
00051          entry=object->Clone();
00052       }
00053    else
00054       {
00055          entry=object;
00056       }
00057    Add(entry);
00058 
00059 }
00060 
00061 void TGo4ObjectQueue::AddObjectFromBuffer(TBuffer* buffer)
00062 {
00063    TRACE((12,"TGo4ObjectQueue::AddObjectFromBuffer(TBuffer*)", __LINE__, __FILE__));
00064    TObject* entry=0;
00065    if(buffer!=0)
00066       {
00067          buffer->SetReadMode();
00068          buffer->Reset();
00069          buffer->InitMap();
00070          TClass* cl= buffer->ReadClass();
00071 //         cout <<"object queue: read class "  << cl << endl;
00072 //         if(cl)
00073 //            cout <<"object queue: class name "  << cl->GetName() << endl;
00074          buffer->Reset();
00075          entry = buffer->ReadObject(cl);
00076 
00077 //         cout <<"object queue: read object "  << entry << endl;
00078 //         if(entry)
00079 //            cout <<"object queue: classname "  << entry->ClassName() << endl;
00080       }
00081    else
00082       {
00083 //              cout <<"object queue: zero buffer"  << endl;
00084       }
00085    Add(entry);
00086 }
00087 
00088 //----------------------------END OF GO4 SOURCE FILE ---------------------

Generated on Fri Nov 28 12:59:28 2008 for Go4-v3.04-1 by  doxygen 1.4.2