ROOT logo
// $Id: XrdFileCloseReporterTree.h 2801 2012-06-29 06:46:22Z matevz $

// Copyright (C) 1999-2008, Matevz Tadel. All rights reserved.
// This file is part of GLED, released under GNU General Public License version 2.
// For the licensing terms see $GLEDSYS/LICENSE or http://www.gnu.org/.

#ifndef XrdMon_XrdFileCloseReporterTree_H
#define XrdMon_XrdFileCloseReporterTree_H

#include <Glasses/XrdFileCloseReporter.h>

class ZLog;

class SXrdFileInfo;
class SXrdUserInfo;
class SXrdServerInfo;

class TFile;
class TTree;
class TBranch;


class XrdFileCloseReporterTree : public XrdFileCloseReporter
{
  MAC_RNR_FRIENDS(XrdFileCloseReporterTree);

private:
  void _init();

protected:
  Int_t                   mAutoSaveEntries;  // X{GS} 7 Value(-range=>[0, 1000000, 1])
  Int_t                   mAutoSaveMinutes;  // X{GS} 7 Value(-range=>[0, 14400, 1])
  GTime                   mLastAutoSave;     //!X{GR} 7 TimeOut()
  Int_t                   mRotateMinutes;    // X{GS} 7 Value(-range=>[0, 14400, 1])
  Bool_t                  bRotateAtMidnight; // X{GS} 7 Bool()
  GTime                   mLastFileOpen;     //!X{GR} 7 TimeOut()

  Bool_t                  bForceAutoSave;    //!
  Bool_t                  bForceRotate;      //!

  Bool_t                  bFileIdxAlways;    // X{GS} 7 Bool()
  TString                 mFilePrefix;       // X{GS} 7 Textor()
  TString                 mTreeName;         // X{GS} 7 Textor()
  TString                 mFileNameTrue;     //!
  TString                 mFileLastDate;     //!
  Int_t                   mFileLastIdx;      //!
  TFile                  *mFile;             //!
  TTree                  *mTree;             //!
  TBranch                *mBranchF;          //!
  TBranch                *mBranchU;          //!
  TBranch                *mBranchS;          //!

  SXrdFileInfo           *mXrdF;             //!
  SXrdUserInfo           *mXrdU;             //!
  SXrdServerInfo         *mXrdS;             //!

  void open_file_create_tree();
  void write_tree_close_file();

  void check_file_rotate();

  virtual void ReportLoopInit();
  virtual void ReportFileClosed(FileUserServer& fus);
  virtual void ReportCondWaitTimeout();
  virtual void ReportLoopFinalize();

public:
  XrdFileCloseReporterTree(const Text_t* n="XrdFileCloseReporterTree", const Text_t* t=0);
  virtual ~XrdFileCloseReporterTree();

  void RotateTree();   // X{E}  7 MButt()
  void AutoSaveTree(); // X{E}  7 MButt()

#include "XrdFileCloseReporterTree.h7"
  ClassDef(XrdFileCloseReporterTree, 1);
}; // endclass XrdFileCloseReporterTree

#endif
 XrdFileCloseReporterTree.h:1
 XrdFileCloseReporterTree.h:2
 XrdFileCloseReporterTree.h:3
 XrdFileCloseReporterTree.h:4
 XrdFileCloseReporterTree.h:5
 XrdFileCloseReporterTree.h:6
 XrdFileCloseReporterTree.h:7
 XrdFileCloseReporterTree.h:8
 XrdFileCloseReporterTree.h:9
 XrdFileCloseReporterTree.h:10
 XrdFileCloseReporterTree.h:11
 XrdFileCloseReporterTree.h:12
 XrdFileCloseReporterTree.h:13
 XrdFileCloseReporterTree.h:14
 XrdFileCloseReporterTree.h:15
 XrdFileCloseReporterTree.h:16
 XrdFileCloseReporterTree.h:17
 XrdFileCloseReporterTree.h:18
 XrdFileCloseReporterTree.h:19
 XrdFileCloseReporterTree.h:20
 XrdFileCloseReporterTree.h:21
 XrdFileCloseReporterTree.h:22
 XrdFileCloseReporterTree.h:23
 XrdFileCloseReporterTree.h:24
 XrdFileCloseReporterTree.h:25
 XrdFileCloseReporterTree.h:26
 XrdFileCloseReporterTree.h:27
 XrdFileCloseReporterTree.h:28
 XrdFileCloseReporterTree.h:29
 XrdFileCloseReporterTree.h:30
 XrdFileCloseReporterTree.h:31
 XrdFileCloseReporterTree.h:32
 XrdFileCloseReporterTree.h:33
 XrdFileCloseReporterTree.h:34
 XrdFileCloseReporterTree.h:35
 XrdFileCloseReporterTree.h:36
 XrdFileCloseReporterTree.h:37
 XrdFileCloseReporterTree.h:38
 XrdFileCloseReporterTree.h:39
 XrdFileCloseReporterTree.h:40
 XrdFileCloseReporterTree.h:41
 XrdFileCloseReporterTree.h:42
 XrdFileCloseReporterTree.h:43
 XrdFileCloseReporterTree.h:44
 XrdFileCloseReporterTree.h:45
 XrdFileCloseReporterTree.h:46
 XrdFileCloseReporterTree.h:47
 XrdFileCloseReporterTree.h:48
 XrdFileCloseReporterTree.h:49
 XrdFileCloseReporterTree.h:50
 XrdFileCloseReporterTree.h:51
 XrdFileCloseReporterTree.h:52
 XrdFileCloseReporterTree.h:53
 XrdFileCloseReporterTree.h:54
 XrdFileCloseReporterTree.h:55
 XrdFileCloseReporterTree.h:56
 XrdFileCloseReporterTree.h:57
 XrdFileCloseReporterTree.h:58
 XrdFileCloseReporterTree.h:59
 XrdFileCloseReporterTree.h:60
 XrdFileCloseReporterTree.h:61
 XrdFileCloseReporterTree.h:62
 XrdFileCloseReporterTree.h:63
 XrdFileCloseReporterTree.h:64
 XrdFileCloseReporterTree.h:65
 XrdFileCloseReporterTree.h:66
 XrdFileCloseReporterTree.h:67
 XrdFileCloseReporterTree.h:68
 XrdFileCloseReporterTree.h:69
 XrdFileCloseReporterTree.h:70
 XrdFileCloseReporterTree.h:71
 XrdFileCloseReporterTree.h:72
 XrdFileCloseReporterTree.h:73
 XrdFileCloseReporterTree.h:74
 XrdFileCloseReporterTree.h:75
 XrdFileCloseReporterTree.h:76
 XrdFileCloseReporterTree.h:77
 XrdFileCloseReporterTree.h:78