IBR-DTN
1.0.0
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"
;
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
}
/* namespace net */
51
}
/* namespace dtn */
dtn::net::P2PDialupEvent::INTERFACE_UP
Definition:
P2PDialupEvent.h:22
EventDispatcher.h
dtn::net::P2PDialupEvent::iface
const ibrcommon::vinterface iface
Definition:
P2PDialupEvent.h:35
P2PDialupEvent.h
dtn::net::P2PDialupEvent::~P2PDialupEvent
virtual ~P2PDialupEvent()
Definition:
P2PDialupEvent.cpp:21
dtn::core::EventDispatcher::queue
static void queue(E *evt)
Definition:
EventDispatcher.h:112
dtn::net::P2PDialupEvent::type
const p2p_event_type type
Definition:
P2PDialupEvent.h:34
dtn::net::P2PDialupEvent::p2p_event_type
p2p_event_type
Definition:
P2PDialupEvent.h:21
dtn::net::P2PDialupEvent::getMessage
std::string getMessage() const
Definition:
P2PDialupEvent.cpp:38
dtn::net::P2PDialupEvent::INTERFACE_DOWN
Definition:
P2PDialupEvent.h:23
dtn::net::P2PDialupEvent::raise
static void raise(p2p_event_type, const ibrcommon::vinterface &)
Definition:
P2PDialupEvent.cpp:26
dtn::net::P2PDialupEvent
Definition:
P2PDialupEvent.h:18
dtn::net::P2PDialupEvent::getName
const std::string getName() const
Definition:
P2PDialupEvent.cpp:32
daemon
src
net
P2PDialupEvent.cpp
Generated on Sun Jan 4 2015 15:27:33 for IBR-DTN by
1.8.6