IBR-DTNSuite
0.8
|
00001 /* 00002 * BundleEvent.cpp 00003 * 00004 * Created on: 06.03.2009 00005 * Author: morgenro 00006 */ 00007 00008 #include "core/BundleEvent.h" 00009 00010 namespace dtn 00011 { 00012 namespace core 00013 { 00014 BundleEvent::BundleEvent(const dtn::data::MetaBundle &b, const EventBundleAction action, dtn::data::StatusReportBlock::REASON_CODE reason) : m_bundle(b), m_action(action), m_reason(reason) 00015 {} 00016 00017 BundleEvent::~BundleEvent() 00018 {} 00019 00020 const dtn::data::MetaBundle& BundleEvent::getBundle() const 00021 { 00022 return m_bundle; 00023 } 00024 00025 EventBundleAction BundleEvent::getAction() const 00026 { 00027 return m_action; 00028 } 00029 00030 dtn::data::StatusReportBlock::REASON_CODE BundleEvent::getReason() const 00031 { 00032 return m_reason; 00033 } 00034 00035 const std::string BundleEvent::getName() const 00036 { 00037 return BundleEvent::className; 00038 } 00039 00040 std::string BundleEvent::toString() const 00041 { 00042 return className; 00043 } 00044 00045 void BundleEvent::raise(const dtn::data::MetaBundle &bundle, EventBundleAction action, dtn::data::StatusReportBlock::REASON_CODE reason) 00046 { 00047 // raise the new event 00048 raiseEvent( new BundleEvent(bundle, action, reason) ); 00049 } 00050 00051 const string BundleEvent::className = "BundleEvent"; 00052 } 00053 }