Logo Coherent WaveBurst  
Reference Guide
Logo
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
History.hh
Go to the documentation of this file.
1 /***************************************************************************
2  History.h - description
3  -------------------
4  begin : lun set 5 2005
5  copyright : (C) 2005 by Stefano Longo
6  email : Stefano.Longo@lnl.infn.it
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef HISTORY_H
19 #define HISTORY_H
20 
21 #include "TObject.h"
22 #include "TList.h"
23 #include "TObjString.h"
24 #include "TDatime.h"
25 #include "TTimeStamp.h"
26 #include <iostream>
27 
28 #include "HistoryStage.hh"
29 #include "HistoryDefines.hh"
30 
31 #define HEADER_WIDTH 80
32 
33 
34 using namespace std;
35 
36 namespace CWB {
37 
38 class History : public TObject {
39 public:
40  History(char** StageNames = NULL, int StageNumber = 0, char** TypeNames = NULL, int TypeNumber = 0, char* FilePrefix = NULL, bool HistoryModify = false);
41  History(const History& History);
42  ~History();
43 
44  bool StageAllowed(char* Name);
45  bool StageAlreadyPresent(char* Name);
46 
47  bool NameAllowed(char* Name);
48  bool TypeAllowed(char* Name);
49 
50  void SetStageNames(char** StageNames, int StageNumber);
51  void SetTypeNames(char** TypeNames, int TypeNumber);
52 
53  void AddLog(char* Stage, char* Log, TDatime* Time = NULL);
54  void AddLog(char* Stage, char* Log, int Date, int Time);
55 
56  void AddHistory(char* Stage, char* Type, char* History, TDatime* Time = NULL);
57  void AddHistory(char* Stage, char* Type, char* History, int Date, int Time);
58 
59  void SetFilePrefix(char* FilePrefix);
60  char* GetFilePrefix();
61 
62  char* GetHistory(char* StageName, char* Type);
63  TDatime* GetHistoryDatime(char* StageName, char* Type);
64 
65  int GetLogSize(char* Stage);
66  char* GetLog(char* Stage, int index);
67 
68  virtual void Browse(TBrowser *b);
69  void Print(); // *MENU*
70  void PrintSummary(); // *MENU*
71  void DumpToTextFile(char* FileName = NULL); // *MENU*
72  void DumpToROOTFile(char* FileName = NULL); // *MENU*
73 
74  TList* GetStageNames();
75  TList* GetTypeNames();
76 
77  bool SetHistoryModify(bool Replace = true);
78  bool GetHistoryModify();
79 
80  char* AddStage(char* StageName);
81  char* RemoveStage(char* StageName);
82 
83  char* AddType(char* TypeName);
84  char* RemoveType(char* TypeName);
85 
86  char* SetStageComment(char* Stage, char* Comment = NULL);
87  char* SetTypeComment(char* Stage, char* Type, char* Comment = NULL);
88 
89  char* GetStageComment(char* Stage);
90  char* GetTypeComment(char* Stage, char* Type);
91 
92  SortOrderType SetSortOrder(SortOrderType SortOrder);
93  SortOrderType GetSortOrder();
94 
95  bool IsSortOrderInsertion();
96  bool IsSortOrderDate();
97  bool IsSortOrderAlphabetical();
98 
99  bool SetAscendingSortOrder();
100  bool SetDescendantSortOrder();
101 
102  bool GetAscendingSortOrder();
103  bool GetDescendantSortOrder();
104 
105  void Sort();
106 
107  TTimeStamp GetCreationTimeStamp();
108  TTimeStamp GetCreationTimeStamp(char* Stage);
109 
110  const CWB::HistoryStage* GetStage(char* Name);
111 
112  void HistoryException(int type, const char *location, const char *msgfmt, ...);
113 
114 private:
115  void Init();
116  void Destroy();
117  bool DuplicateNames(char** NameList, int NameNumber);
118  void WriteToFile(char* FileName, bool SummaryOnly = false);
119  int GetStagePosition(char* Name);
120 
121  TList StageNames;
122  TList TypeNames;
123 
124  TList StageList;
125  TObjString FilePrefix;
126 
130 
133 
134  ClassDef(History, 3)
135 };
136 
137 } // end namespace
138 
139 #endif
void Init()
Definition: ChirpMass.C:280
bool HistoryModify
Definition: History.hh:127
Definition: ced.hh:24
long CreationDate_Sec
Definition: History.hh:131
SortOrderType
SortOrderType SortOrder
Definition: History.hh:128
STL namespace.
long CreationDate_NSec
Definition: History.hh:132
history AddLog(job_stage,"START JOB")
MDC Print()
ihistory DumpToTextFile(historyFile)
TList StageNames
Definition: History.hh:121
bool AscendingOrder
Definition: History.hh:129
TObjString FilePrefix
Definition: History.hh:125
history AddHistory(job_stage,"WATVERSION", watversion('s'))
wavearray< int > index
TList TypeNames
Definition: History.hh:122
Type
Definition: FrDisplay.cc:105
TList StageList
Definition: History.hh:124