ThePEG  1.8.0
ProgressLog.h
1 // -*- C++ -*-
2 #ifndef THEPEG_ProgressLog_H
3 #define THEPEG_ProgressLog_H
4 //
5 // This is the declaration of the ProgressLog class.
6 //
7 
8 #include "ThePEG/Handlers/AnalysisHandler.h"
9 
10 namespace ThePEG {
11 
30 
31 public:
32 
38  ProgressLog();
39 
43  virtual ~ProgressLog();
45 
46 public:
47 
67  virtual void analyze(tEventPtr event, long ieve, int loop, int state);
69 
73  static double fclock();
74 
78  bool statusTime(long i, long n) const;
79 
80 public:
81 
88  void persistentOutput(PersistentOStream & os) const;
89 
95  void persistentInput(PersistentIStream & is, int version);
97 
104  static void Init();
105 
106 protected:
107 
114  virtual IBPtr clone() const;
115 
120  virtual IBPtr fullclone() const;
122 
123 
124 
125 protected:
126 
133  virtual void doinitrun();
135 
136 private:
137 
141  int secstep;
142 
146  time_t time0;
147 
151  double fcpu0;
152 
156  time_t time1;
157 
161  double fcpu1;
162 
166  string host;
167 
171  pid_t pid;
172 
173 private:
174 
180 
185  ProgressLog & operator=(const ProgressLog &);
186 
187 };
188 
189 }
190 
191 #include "ThePEG/Utilities/ClassTraits.h"
192 
193 namespace ThePEG {
194 
199 template <>
200 struct BaseClassTrait<ProgressLog,1> {
202  typedef AnalysisHandler NthBase;
203 };
204 
207 template <>
208 struct ClassTraits<ProgressLog>
209  : public ClassTraitsBase<ProgressLog> {
211  static string className() { return "ThePEG::ProgressLog"; }
219  static string library() { return "ProgressLog.so"; }
220 };
221 
224 }
225 
226 #endif /* THEPEG_ProgressLog_H */