Logo Coherent WaveBurst  
Reference Guide
Logo
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
HistoryStage.hh
Go to the documentation of this file.
1 /***************************************************************************
2  HistoryStage.h - description
3  -------------------
4  begin : ven set 2 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 HISTORYSTAGE_H
19 #define HISTORYSTAGE_H
20 
21 #include "TObject.h"
22 #include "TDatime.h"
23 #include "TList.h"
24 #include "TString.h"
25 //#include "AalException.h"
26 #include "HistoryDefines.hh"
27 #include "TTimeStamp.h"
28 #include "TSystem.h"
29 #include <stdlib.h>
30 #include <iostream>
31 #include <fstream>
32 
33 using namespace std;
34 
35 namespace CWB {
36 
37 class HistoryStage : public TObject {
38 public:
39  HistoryStage(char** HistoryTypes = NULL, int TypeNumber = 0, char* Name = NULL, char* Comment = NULL, TDatime* Time = NULL);
40  HistoryStage(const TList& HistoryTypes, char* Name = NULL, char* Comemment = NULL, TDatime* Time = NULL);
41  HistoryStage(char** HistoryTypes, int TypeNumber, char* Name, char* Comment, int Date, int Time);
42  HistoryStage(const TList& HistoryTypes, char* Name, char* Comment, int Date, int Time);
44  ~HistoryStage();
45 
46  char* SetName(char* Name);
47  char* SetComment(char* Comment);
48  void SetTime(TDatime* Time);
49  void SetTime(int Date, int Time);
50  void SetTypes(char** HistoryTypes, int TypeNumber);
51  char* SetTypeComment(char* Type, char* Comment);
52 
53  char* GetName();
54  char* GetComment();
55  int GetDate();
56  int GetTime();
57  TDatime*GetDatime();
58  char* GetTypeComment(char* Type);
59 
60  void AddLog(char* LogMsg, TDatime* Time = NULL);
61  void AddLog(char* LogMsg, int Date, int Time);
62 
63  void AddHistory(char* Type, char* History, char* Comment = NULL, bool Replace = false);
64 
65  int GetHistorySize();
66  int GetLogSize();
67  char* GetHistoryEntry(int index);
68  char* GetHistoryEntryType(int index);
69  char* GetLogEntry(int index);
70  int GetLogEntryDate(int index);
71  int GetLogEntryTime(int index);
72  TDatime* GetLogEntryDatime(int index);
73 
74  char* GetHistory(char* Type);
75 
76  void SortLogs(bool Ascending = true);
77 
78  bool TypeAllowed(char* Type);
79  bool TypeAlreadyPresent(char* Type);
80 
81  virtual void Browse(TBrowser *b);
82  void Print();
83 
84  bool IsSortable() const;
85  int Compare(const TObject* Obj) const;
86 
87  char* AddType(char* TypeName);
88  char* RemoveType(char* TypeName);
89 
90  SortOrderType SetSortOrder(SortOrderType SortOrder);
91  SortOrderType GetSortOrder();
92 
93  bool IsSortOrderInsertion();
94  bool IsSortOrderDate();
95  bool IsSortOrderAlphabetical();
96 
97  bool SetAscendingSortOrder();
98  bool SetDescendantSortOrder();
99 
100  bool GetAscendingSortOrder();
101  bool GetDescendantSortOrder();
102 
103  void Sort();
104 
105  TTimeStamp GetCreationTimeStamp();
106 
107  void HistoryStageException(int type, const char *location, const char *msgfmt, ...);
108 
109 private:
110  int Date;
111  int Time;
112 
114 
115  int NameLength; //Name char number + 1
116  char* Name; //[NameLength]
117 
118  TList History;
119  TList Logs;
120 
121  int CommentLength; //Comment char number + 1
122  char* Comment; //[CommentLength]
123 
126 
129 
130  void Init();
131  void Destroy();
132  void NameSet(char* Name);
133  void CommentSet(char* Comment);
134 
135  ClassDef(HistoryStage, 3)
136 };
137 
138 } // end namespace
139 
140 #endif
void Init()
Definition: ChirpMass.C:280
Definition: ced.hh:24
plot hist2D SetName("WSeries-1")
SortOrderType
STL namespace.
history AddLog(job_stage,"START JOB")
MDC Print()
SortOrderType SortOrder
history AddHistory(job_stage,"WATVERSION", watversion('s'))
wavearray< int > index
Type
Definition: FrDisplay.cc:105