IBR-DTNSuite  0.8
daemon/src/routing/StaticRouteChangeEvent.h
Go to the documentation of this file.
00001 /*
00002  * StaticRouteChangeEvent.h
00003  *
00004  *  Created on: 08.02.2012
00005  *      Author: morgenro
00006  */
00007 
00008 #ifndef STATICROUTECHANGEEVENT_H_
00009 #define STATICROUTECHANGEEVENT_H_
00010 
00011 #include "core/Event.h"
00012 #include <ibrdtn/data/EID.h>
00013 
00014 namespace dtn
00015 {
00016         namespace routing
00017         {
00018                 class StaticRouteChangeEvent : public dtn::core::Event
00019                 {
00020                 public:
00021                         enum CHANGE_TYPE
00022                         {
00023                                 ROUTE_ADD = 0,
00024                                 ROUTE_DEL = 1,
00025                                 ROUTE_EXPIRED = 2,
00026                                 ROUTE_CLEAR = 3
00027                         };
00028 
00029                         virtual ~StaticRouteChangeEvent();
00030 
00031                         const std::string getName() const;
00032 
00033                         std::string toString() const;
00034 
00035                         static void raiseEvent(CHANGE_TYPE type);
00036                         static void raiseEvent(CHANGE_TYPE type, const dtn::data::EID &nexthop, const std::string pattern, size_t timeout = 0);
00037                         static void raiseEvent(CHANGE_TYPE type, const dtn::data::EID &nexthop, const dtn::data::EID &destination, size_t timeout = 0);
00038 
00039                         CHANGE_TYPE type;
00040                         const dtn::data::EID nexthop;
00041                         const dtn::data::EID destination;
00042                         const std::string pattern;
00043                         size_t timeout;
00044 
00045                         static const std::string className;
00046 
00047                 private:
00048                         StaticRouteChangeEvent(CHANGE_TYPE type);
00049                         StaticRouteChangeEvent(CHANGE_TYPE type, const dtn::data::EID &nexthop, const std::string pattern, size_t timeout = 0);
00050                         StaticRouteChangeEvent(CHANGE_TYPE type, const dtn::data::EID &nexthop, const dtn::data::EID &destination, size_t timeout = 0);
00051                 };
00052         } /* namespace routing */
00053 } /* namespace dtn */
00054 #endif /* STATICROUTECHANGEEVENT_H_ */