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

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

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