IBR-DTNSuite  0.10
TimeAdjustmentEvent.cpp
Go to the documentation of this file.
1 /*
2  * TimeAdjustmentEvent.cpp
3  *
4  * Created on: 11.09.2012
5  * Author: morgenro
6  */
7 
9 #include "core/EventDispatcher.h"
10 #include <ibrdtn/utils/Clock.h>
11 #include <sstream>
12 #include <sys/time.h>
13 
14 namespace dtn
15 {
16  namespace core
17  {
18  TimeAdjustmentEvent::TimeAdjustmentEvent(const timeval &o, const double &r)
19  : offset(o), rating(r)
20  {
21  }
22 
24  {
25  }
26 
27  void TimeAdjustmentEvent::raise(const timeval &offset, const double &rating)
28  {
30  }
31 
32  const std::string TimeAdjustmentEvent::getName() const
33  {
34  return className;
35  }
36 
37  std::string TimeAdjustmentEvent::getMessage() const
38  {
39  std::stringstream ss;
40  ss << "time adjusted by " << dtn::utils::Clock::toDouble(offset) << "s, new rating is " << rating;
41  return ss.str();
42  }
43 
44  const std::string TimeAdjustmentEvent::className = "TimeAdjustmentEvent";
45  } /* namespace core */
46 } /* namespace dtn */