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

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

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