00001 #ifndef BUNDLEROUTER_H_ 00002 #define BUNDLEROUTER_H_ 00003 00004 #include "Node.h" 00005 #include <list> 00006 #include "data/Bundle.h" 00007 #include "utils/Service.h" 00008 #include "core/BundleSchedule.h" 00009 #include "utils/MutexLock.h" 00010 #include "utils/Mutex.h" 00011 #include "core/EventReceiver.h" 00012 #include "core/Event.h" 00013 #include "utils/Conditional.h" 00014 00015 using namespace std; 00016 using namespace dtn::data; 00017 using namespace dtn::utils; 00018 00019 namespace dtn 00020 { 00021 namespace core 00022 { 00030 class BundleRouter : public Service, public EventReceiver 00031 { 00032 public: 00033 /* constructor 00034 * @param eid Own node eid. 00035 */ 00036 BundleRouter(string eid); 00037 00041 virtual ~BundleRouter(); 00042 00047 virtual const list<Node>& getNeighbours(); 00048 00054 virtual bool isNeighbour(Node &node); 00055 bool isNeighbour(string eid); 00056 00057 Node getNeighbour(string eid); 00058 00062 virtual void tick(); 00063 00069 virtual BundleSchedule getSchedule(const Bundle &b); 00070 00071 bool isLocal(const Bundle &b) const; 00072 00076 void raiseEvent(const Event *evt); 00077 00078 protected: 00079 void terminate(); 00080 00081 private: 00087 virtual void discovered(const Node &node); 00088 00089 list<Node> m_neighbours; 00090 string m_eid; 00091 dtn::utils::Mutex m_lock; 00092 00093 Conditional m_nexttime; 00094 }; 00095 } 00096 } 00097 00098 #endif /*BUNDLEROUTER_H_*/
1.5.6