IBR-DTNSuite  0.8
daemon/src/routing/NeighborRoutingExtension.h
Go to the documentation of this file.
00001 /*
00002  * NeighborRoutingExtension.h
00003  *
00004  *  Created on: 16.02.2010
00005  *      Author: morgenro
00006  */
00007 
00008 #ifndef NEIGHBORROUTINGEXTENSION_H_
00009 #define NEIGHBORROUTINGEXTENSION_H_
00010 
00011 #include "routing/BaseRouter.h"
00012 #include "routing/NeighborDatabase.h"
00013 #include "core/Node.h"
00014 
00015 #include <ibrdtn/data/MetaBundle.h>
00016 #include "ibrdtn/data/EID.h"
00017 #include <ibrcommon/thread/Queue.h>
00018 #include <list>
00019 #include <map>
00020 #include <queue>
00021 
00022 namespace dtn
00023 {
00024         namespace routing
00025         {
00026                 class NeighborRoutingExtension : public BaseRouter::ThreadedExtension
00027                 {
00028                 public:
00029                         NeighborRoutingExtension();
00030                         virtual ~NeighborRoutingExtension();
00031 
00032                         void notify(const dtn::core::Event *evt);
00033 
00034                 protected:
00035                         void run();
00036                         void __cancellation();
00037 
00038                 private:
00039                         class Task
00040                         {
00041                         public:
00042                                 virtual ~Task() {};
00043                                 virtual std::string toString() = 0;
00044                         };
00045 
00046                         class SearchNextBundleTask : public Task
00047                         {
00048                         public:
00049                                 SearchNextBundleTask(const dtn::data::EID &eid);
00050                                 virtual ~SearchNextBundleTask();
00051 
00052                                 virtual std::string toString();
00053 
00054                                 const dtn::data::EID eid;
00055                         };
00056 
00057                         class ProcessBundleTask : public Task
00058                         {
00059                         public:
00060                                 ProcessBundleTask(const dtn::data::MetaBundle &meta, const dtn::data::EID &origin);
00061                                 virtual ~ProcessBundleTask();
00062 
00063                                 virtual std::string toString();
00064 
00065                                 const dtn::data::MetaBundle bundle;
00066                                 const dtn::data::EID origin;
00067                         };
00068 
00072                         ibrcommon::Queue<NeighborRoutingExtension::Task* > _taskqueue;
00073                 };
00074         }
00075 }
00076 
00077 #endif /* NEIGHBORROUTINGEXTENSION_H_ */