IBR-DTNSuite  0.8
daemon/src/core/CustodyEvent.h
Go to the documentation of this file.
00001 /*
00002  * CustodyEvent.h
00003  *
00004  *  Created on: 06.03.2009
00005  *      Author: morgenro
00006  */
00007 
00008 #ifndef CUSTODYEVENT_H_
00009 #define CUSTODYEVENT_H_
00010 
00011 #include <string>
00012 #include "core/Event.h"
00013 
00014 #include <ibrdtn/data/MetaBundle.h>
00015 #include <ibrdtn/data/CustodySignalBlock.h>
00016 
00017 namespace dtn
00018 {
00019         namespace core
00020         {
00021                 enum EventCustodyAction
00022                 {
00023                         CUSTODY_REJECT = 0,
00024                         CUSTODY_ACCEPT = 1
00025                 };
00026 
00027                 class CustodyEvent : public Event
00028                 {
00029                 public:
00030                         virtual ~CustodyEvent();
00031 
00032                         EventCustodyAction getAction() const;
00033                         const dtn::data::MetaBundle& getBundle() const;
00034                         const std::string getName() const;
00035 
00036                         std::string toString() const;
00037 
00038                         static void raise(const dtn::data::MetaBundle &bundle, const EventCustodyAction action);
00039 
00040                         static const std::string className;
00041 
00042                 private:
00043                         CustodyEvent(const dtn::data::MetaBundle &bundle, const EventCustodyAction action);
00044 
00045                         const dtn::data::MetaBundle m_bundle;
00046                         const EventCustodyAction m_action;
00047                 };
00048         }
00049 }
00050 
00051 #endif /* CUSTODYEVENT_H_ */