Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/TParallelMergingFile.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // @(#)root/net:$Id$
0002 // Author: Philippe Canal October 2011.
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2011, Rene Brun, Fons Rademakers and al.           *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 #ifndef ROOT_TParallelMergingFile
0013 #define ROOT_TParallelMergingFile
0014 
0015 
0016 //////////////////////////////////////////////////////////////////////////
0017 //                                                                      //
0018 // TParallelMergingFile                                                 //
0019 //                                                                      //
0020 // Specialization of TMemFile to connect to a parallel file merger.     //
0021 // Upon a call to UploadAndReset, the content already written to the    //
0022 // file is upload to the server and the object implementing the function//
0023 // ResetAfterMerge (like TTree) are reset.                              //
0024 // The parallel file merger will then collate the information coming    //
0025 // from this client and any other client in to the file described by    //
0026 // the filename of this object.                                         //
0027 //                                                                      //
0028 //////////////////////////////////////////////////////////////////////////
0029 
0030 #include "TMemFile.h"
0031 #include "TMessage.h"
0032 #include "TUrl.h"
0033 
0034 
0035 class TSocket;
0036 class TArrayC;
0037 
0038 class TParallelMergingFile : public TMemFile
0039 {
0040 private:
0041    TSocket *fSocket;         // Socket to the parallel file merger server.
0042    TUrl     fServerLocation; // Url of the server.
0043    Int_t    fServerIdx;      // Index of this socket/file on the server.
0044    Int_t    fServerVersion;  // Protocol version used by the server.
0045    TArrayC *fClassSent;      // Record which StreamerInfo we already sent.
0046    TMessage fMessage;
0047 
0048 public:
0049    TParallelMergingFile(const char *filename, Option_t *option = "", const char *ftitle = "", Int_t compress = ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault);
0050    ~TParallelMergingFile();
0051 
0052    void   Close(Option_t *option="") override;
0053    Bool_t UploadAndReset();
0054    Int_t  Write(const char *name=nullptr, Int_t opt=0, Int_t bufsiz=0) override;
0055    Int_t  Write(const char *name=nullptr, Int_t opt=0, Int_t bufsiz=0) const override;
0056    void   WriteStreamerInfo() override;
0057 
0058    ClassDefOverride(TParallelMergingFile, 0);  // TFile specialization that will semi-automatically upload its content to a merging server.
0059 };
0060 
0061 #endif // ROOT_TParallelMergingFile