IBR-DTNSuite
0.12
Main Page
Namespaces
Classes
Files
File List
File Members
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
8
#include "
core/TimeAdjustmentEvent.h
"
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
23
TimeAdjustmentEvent::~TimeAdjustmentEvent
()
24
{
25
}
26
27
void
TimeAdjustmentEvent::raise
(
const
timeval &offset,
const
double
&rating)
28
{
29
dtn::core::EventDispatcher<TimeAdjustmentEvent>::queue
(
new
TimeAdjustmentEvent
(offset, rating) );
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, based on clock with rating "
<<
rating
;
41
return
ss.str();
42
}
43
44
const
std::string
TimeAdjustmentEvent::className
=
"TimeAdjustmentEvent"
;
45
}
/* namespace core */
46
}
/* namespace dtn */
daemon
src
core
TimeAdjustmentEvent.cpp
Generated on Thu Mar 27 2014 09:26:20 for IBR-DTNSuite by
1.8.4