IBR-DTNSuite 0.6

daemon/src/net/BundleReceivedEvent.cpp

Go to the documentation of this file.
00001 /*
00002  * BundleReceivedEvent.cpp
00003  *
00004  *  Created on: 15.02.2010
00005  *      Author: morgenro
00006  */
00007 
00008 #include "net/BundleReceivedEvent.h"
00009 #include "core/BundleCore.h"
00010 #include <ibrcommon/Logger.h>
00011 
00012 namespace dtn
00013 {
00014         namespace net
00015         {
00016                 BundleReceivedEvent::BundleReceivedEvent(const dtn::data::EID &p, const dtn::data::Bundle &b, const bool &local)
00017                  : peer(p), bundle(b), fromlocal(local)
00018                 {
00019 
00020                 }
00021 
00022                 BundleReceivedEvent::~BundleReceivedEvent()
00023                 {
00024 
00025                 }
00026 
00027                 void BundleReceivedEvent::raise(const dtn::data::EID &peer, const dtn::data::Bundle &bundle, const bool &local)
00028                 {
00029                         // raise the new event
00030                         dtn::core::Event::raiseEvent( new BundleReceivedEvent(peer, bundle, local) );
00031                 }
00032 
00033                 const string BundleReceivedEvent::getName() const
00034                 {
00035                         return BundleReceivedEvent::className;
00036                 }
00037 
00038                 string BundleReceivedEvent::toString() const
00039                 {
00040                         return className + ": Bundle received " + bundle.toString();
00041                 }
00042 
00043                 const string BundleReceivedEvent::className = "BundleReceivedEvent";
00044         }
00045 }