IBR-DTNSuite
0.12
Main Page
Namespaces
Classes
Files
File List
File Members
P2PDialupEvent.cpp
Go to the documentation of this file.
1
/*
2
* P2PDialupEvent.cpp
3
*
4
* Created on: 25.02.2013
5
* Author: morgenro
6
*/
7
8
#include "
net/P2PDialupEvent.h
"
9
#include "
core/EventDispatcher.h
"
10
11
namespace
dtn
12
{
13
namespace
net
14
{
15
P2PDialupEvent::P2PDialupEvent(p2p_event_type t,
const
ibrcommon::vinterface
&i)
16
: type(t), iface(i)
17
{
18
19
}
20
21
P2PDialupEvent::~P2PDialupEvent
()
22
{
23
24
}
25
26
void
P2PDialupEvent::raise
(
p2p_event_type
t,
const
ibrcommon::vinterface
&i)
27
{
28
// raise the new event
29
dtn::core::EventDispatcher<P2PDialupEvent>::queue
(
new
P2PDialupEvent
(t, i) );
30
}
31
32
const
std::string
P2PDialupEvent::getName
()
const
33
{
34
return
P2PDialupEvent::className
;
35
}
36
37
38
std::string
P2PDialupEvent::getMessage
()
const
39
{
40
switch
(
type
)
41
{
42
case
INTERFACE_UP
:
43
return
"interface "
+
iface
.
toString
() +
" up"
;
44
case
INTERFACE_DOWN
:
45
return
"interface "
+
iface
.
toString
() +
" down"
;
46
}
47
48
return
"unknown event"
;
49
}
50
51
const
std::string
P2PDialupEvent::className
=
"P2PDialupEvent"
;
52
}
/* namespace net */
53
}
/* namespace dtn */
daemon
src
net
P2PDialupEvent.cpp
Generated on Thu Mar 27 2014 09:26:20 for IBR-DTNSuite by
1.8.4