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

/Go4EventServer/TGo4BackStoreParameter.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 "TGo4BackStoreParameter.h"
00017 
00018 #include <iostream.h>
00019 
00020 #include "Go4StatusBase/TGo4Status.h"
00021 #include "Go4Log/TGo4Log.h"
00022 
00023 TGo4BackStoreParameter::TGo4BackStoreParameter(const char* name,
00024                                               Int_t splitlevel,
00025                                               Int_t bufsize)
00026 : TGo4EventStoreParameter(name, GO4EV_BACK),
00027    fiSplit(splitlevel), fiBufsize(bufsize)
00028 {
00029    TRACE((14,"TGo4FileStoreParameter::TGo4FileStoreParameter(const char*,...)", __LINE__, __FILE__));
00030    SetTitle(name);
00031 }
00032 
00033 TGo4BackStoreParameter::TGo4BackStoreParameter()
00034 : TGo4EventStoreParameter("Default Go4 FileStore", GO4EV_BACK),
00035    fiSplit(99), fiBufsize(64000)
00036 {
00037    TRACE((14,"TGo4FileStoreParameter::TGo4FileStoreParameter()", __LINE__, __FILE__));
00038    SetTitle("Go4FileStore-Tree");
00039 }
00040 
00041 TGo4BackStoreParameter::~TGo4BackStoreParameter()
00042 {
00043    TRACE((14,"TGo4FileStoreParameter::~TGo4FileStoreParameter()", __LINE__, __FILE__));
00044 }
00045 
00046 Int_t TGo4BackStoreParameter::PrintParameter(Text_t* buffer, Int_t buflen)
00047 {
00048  TRACE((12,"TGo4FileStoreParameter::PrintParameter()",__LINE__, __FILE__));
00049    Int_t locallen=128000;
00050    Text_t localbuf[locallen];
00051    if(buflen<0 && buffer!=0)
00052       return 0;
00053    Int_t size=0;
00054    Int_t restlen=locallen;
00055    Text_t* current=localbuf;
00056    Int_t delta=TGo4EventStoreParameter::PrintParameter(current,restlen);
00057    restlen-=delta;
00058    current+=delta;
00059    current=TGo4Status::PrintIndent(current,restlen);
00060    current=TGo4Status::PrintBuffer(current,restlen, "  Split level: \t%d \n",fiSplit);
00061    current=TGo4Status::PrintIndent(current,restlen);
00062    current=TGo4Status::PrintBuffer(current,restlen, "  Buffer size: \t%d bytes \n",fiBufsize);
00063    if(buffer==0)
00064       {
00065           cout << localbuf << endl;
00066       }
00067    else
00068       {
00069          size=locallen-restlen;
00070          if(size>buflen-1)
00071             size=buflen-1;
00072          strncpy(buffer,localbuf,size);
00073       }
00074    return size;
00075 }
00076 
00077 Bool_t TGo4BackStoreParameter::UpdateFrom(TGo4Parameter* rhs)
00078 {
00079    TRACE((12,"TGo4BackStoreParameter::UpdateFrom()",__LINE__, __FILE__));
00080    if(rhs && rhs->InheritsFrom("TGo4BackStoreParameter"))
00081       {
00082          TGo4BackStoreParameter* backpar=dynamic_cast<TGo4BackStoreParameter*>(rhs);
00083          if(!backpar) return kFALSE;
00084          if(!TGo4EventStoreParameter::UpdateFrom(rhs)) return kFALSE;
00085          SetSplitlevel(backpar->GetSplitlevel());
00086          SetBufsize(backpar->GetBufsize());
00087          return kTRUE;
00088       }
00089    else
00090       {
00091           return kFALSE;
00092       }
00093    return kFALSE;
00094 }
00095 
00096 ClassImp(TGo4BackStoreParameter)
00097 
00098 //----------------------------END OF GO4 SOURCE FILE ---------------------

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