thepeg is hosted by Hepforge, IPPP Durham
ThePEG  2.2.1
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 &) = delete;
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 */
PersistentIStream is used to read persistent objects from a stream where they were previously written...
ProgressLog()
The default constructor.
time_t time1
The clock the last time a status line was written out.
Definition: ProgressLog.h:156
static double fclock()
Return the cpu clock in seconds.
string host
The host on which we are running.
Definition: ProgressLog.h:166
void persistentOutput(PersistentOStream &os) const
Function used to write out object persistently.
A concreate implementation of ClassDescriptionBase describing a concrete class with persistent data...
PersistentOStream is used to write objects persistently to a stream from which they can be read in ag...
TransientRCPtr is a simple wrapper around a bare pointer which can be assigned to and from an RCPtr a...
Definition: RCPtr.h:519
The ProgressLog class will not perform an actual analysis.
Definition: ProgressLog.h:29
virtual IBPtr fullclone() const
Make a clone of this object, possibly modifying the cloned object to make it sane.
static ClassDescription< ProgressLog > initProgressLog
The static object used to initialize the description of this class.
Definition: ProgressLog.h:179
This is the main namespace within which all identifiers in ThePEG are declared.
Definition: FactoryBase.h:28
The AnalysisHandler is the base class of all analysis objects which may be handled by the FullEventGe...
time_t time0
The clock when the run was started.
Definition: ProgressLog.h:146
ProgressLog & operator=(const ProgressLog &)=delete
The assignment operator is private and must never be called.
InitState state() const
Return the state of initialization of this object.
virtual ~ProgressLog()
The destructor.
virtual IBPtr clone() const
Make a simple clone of this object.
RCPtr is a reference counted (smart) pointer.
Definition: RCPtr.h:60
bool statusTime(long i, long n) const
Check if it is time to write out a status line.
pid_t pid
The pid of the current process.
Definition: ProgressLog.h:171
double fcpu0
The cpu clock when the run was started.
Definition: ProgressLog.h:151
The default concrete implementation of ClassTraitsBase.
Definition: ClassTraits.h:134
double fcpu1
The cpu clock the last time a status line was written out.
Definition: ProgressLog.h:161
static void Init()
The standard Init function used to initialize the interfaces.
int secstep
If larger than 0, a status line will be written every secstep second.
Definition: ProgressLog.h:141
virtual void doinitrun()
Initialize this object.
void persistentInput(PersistentIStream &is, int version)
Function used to read in object persistently.
BaseClassTraits describes the base classes of the templated class.
Definition: ClassTraits.h:156
virtual void analyze(tEventPtr event, long ieve, int loop, int state)
Analyze a given Event.
The templated ClassTraitsBase class defines a set of default information about classes used by ThePEG...
Definition: ClassTraits.h:52