MultiAgentDecisionProcess  Release 0.2.1
TimedAlgorithm.cpp
Go to the documentation of this file.
1 
28 #include "TimedAlgorithm.h"
29 #include <fstream>
30 
31 using namespace std;
32 
33 //Default constructor
35 {
36  _m_timer=new Timing();
37 }
38 //Destructor
40 {
41  delete _m_timer;
42 }
43 
44 void TimedAlgorithm::StartTimer(const string & id) const
45 {
46  _m_timer->Start(id);
47 }
48 
49 void TimedAlgorithm::StopTimer(const string & id) const
50 {
51  _m_timer->Stop(id);
52 }
53 
55 {
56  _m_timer->Print();
57 }
58 
59 void TimedAlgorithm::SaveTimers(const string & filename) const
60 {
61  _m_timer->Save(filename);
62 }
63 
64 void TimedAlgorithm::SaveTimers(ofstream &of) const
65 {
66  _m_timer->Save(of);
67 }
68 
69 void TimedAlgorithm::LoadTimers(const string & filename)
70 {
71  _m_timer->Load(filename);
72 }
73 
75 {
76  _m_timer->PrintSummary();
77 }
78 
79 void TimedAlgorithm::AddTimedEvent(const string & id, clock_t duration)
80 {
81  _m_timer->AddEvent(id,duration);
82 }
83 
84 vector<double> TimedAlgorithm::GetTimedEventDurations(const string & id)
85 {
86  return(_m_timer->GetEventDurations(id));
87 }