Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

/Go4Queue/TGo4ObjectQueue.cxx

Go to the documentation of this file.
00001 //---------------------------------------------------------------
00002 //        Go4 Release Package v2.10-5 (build 21005) 
00003 //                      03-Nov-2005
00004 //---------------------------------------------------------------
00005 //       The GSI Online Offline Object Oriented (Go4) Project
00006 //       Experiment Data Processing at DVEE 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 <iostream.h>
00019 
00020 #include "TBuffer.h"
00021 
00022 #include "Go4Log/TGo4Log.h"
00023 
00024 TGo4ObjectQueue::TGo4ObjectQueue()
00025    : TGo4Queue("Default object queue")
00026 {
00027    TRACE((14,"TGo4ObjectQueue::TGo4ObjectQueue()", __LINE__, __FILE__));
00028 }
00029 
00030 TGo4ObjectQueue::TGo4ObjectQueue(const char* name)
00031    : TGo4Queue(name)
00032 {
00033    TRACE((14,"TGo4ObjectQueue::TGo4ObjectQueue(const char*)", __LINE__, __FILE__));
00034 }
00035 
00036 TGo4ObjectQueue::~TGo4ObjectQueue()
00037 {
00038    TRACE((14,"TGo4ObjectQueue::~TTGo4ObjectQueue()", __LINE__, __FILE__));
00039 }
00040 
00041 TObject* TGo4ObjectQueue::WaitObject()
00042 {
00043    TRACE((12,"TGo4ObjectQueue::WaitObject()", __LINE__, __FILE__));
00044    return (Wait());
00045 }
00046 
00047 void TGo4ObjectQueue::AddObject(TObject * object, Bool_t clone)
00048 {
00049    TRACE((12,"TGo4ObjectQueue::AddObject(TObject*, Bool_t)", __LINE__, __FILE__));
00050    TObject* entry=0;
00051    if(clone && (object!=0))
00052       {
00053          entry=object->Clone();
00054       }
00055    else
00056       {
00057          entry=object;
00058       }
00059    Add(entry);
00060 
00061 }
00062 
00063 void TGo4ObjectQueue::AddObjectFromBuffer(TBuffer* buffer)
00064 {
00065    TRACE((12,"TGo4ObjectQueue::AddObjectFromBuffer(TBuffer*)", __LINE__, __FILE__));
00066    TObject* entry=0;
00067    if(buffer!=0)
00068       {
00069          buffer->SetReadMode();
00070          buffer->Reset();
00071          buffer->InitMap();
00072          TClass* cl= buffer->ReadClass();
00073 //         cout <<"object queue: read class "  << cl << endl;
00074 //         if(cl)
00075 //            cout <<"object queue: class name "  << cl->GetName() << endl;
00076          buffer->Reset();
00077          entry = buffer->ReadObject(cl);
00078 
00079 //         cout <<"object queue: read object "  << entry << endl;
00080 //         if(entry)
00081 //            cout <<"object queue: classname "  << entry->ClassName() << endl;
00082       }
00083    else
00084       {
00085 //              cout <<"object queue: zero buffer"  << endl;
00086       }
00087    Add(entry);
00088 }
00089 
00090 //----------------------------END OF GO4 SOURCE FILE ---------------------

Generated on Tue Nov 8 10:56:04 2005 for Go4-v2.10-5 by doxygen1.2.15