MultiAgentDecisionProcess  Release 0.2.1
TimedAlgorithm.h
Go to the documentation of this file.
1 
28 /* Only include this header file once. */
29 #ifndef _TIMEDALGORITHM_H_
30 #define _TIMEDALGORITHM_H_ 1
31 
32 /* the include directives */
33 #include <iostream>
34 #include "Globals.h"
35 
36 #include "Timing.h"
37 
41 {
42 private:
43 
45  // This is a pointer, so that timing information can be stored in
46  // const functions.
48 
49 protected:
50 
51 public:
52  // Constructor, destructor and copy assignment.
56  virtual ~TimedAlgorithm();
57 
59  void StartTimer(const std::string & id) const;
60 
62  void StopTimer(const std::string & id) const;
63 
65  void PrintTimers() const;
66 
68  void PrintTimersSummary() const;
69 
71  void SaveTimers(const std::string & filename) const;
72 
74  void SaveTimers(std::ofstream &of) const;
75 
77  void LoadTimers(const std::string & filename);
78 
80  void AddTimedEvent(const std::string & id, clock_t duration);
81 
83  std::vector<double> GetTimedEventDurations(const std::string & id);
84 
85 };
86 
87 
88 #endif /* !_TIMEDALGORITHM_H_ */
89 
90 // Local Variables: ***
91 // mode:c++ ***
92 // End: ***