IBR-DTNSuite  0.8
daemon/src/core/NodeEvent.h
Go to the documentation of this file.
00001 /*
00002  * NodeEvent.h
00003  *
00004  *  Created on: 05.03.2009
00005  *      Author: morgenro
00006  */
00007 
00008 #ifndef NODEEVENT_H_
00009 #define NODEEVENT_H_
00010 
00011 #include "core/Node.h"
00012 #include "core/Event.h"
00013 
00014 using namespace dtn::core;
00015 
00016 namespace dtn
00017 {
00018         namespace core
00019         {
00020                 enum EventNodeAction
00021                 {
00022                         NODE_UNAVAILABLE = 0,
00023                         NODE_AVAILABLE = 1,
00024                         NODE_INFO_UPDATED = 2
00025                 };
00026 
00027                 class NodeEvent : public Event
00028                 {
00029                 public:
00030                         virtual ~NodeEvent();
00031 
00032                         EventNodeAction getAction() const;
00033                         const Node& getNode() const;
00034                         const std::string getName() const;
00035 
00036                         std::string toString() const;
00037 
00038                         static void raise(const Node &n, const EventNodeAction action);
00039 
00040                         static const std::string className;
00041 
00042                 private:
00043                         NodeEvent(const Node &n, const EventNodeAction action);
00044 
00045                         const Node m_node;
00046                         const EventNodeAction m_action;
00047                 };
00048         }
00049 }
00050 
00051 #endif /* NODEEVENT_H_ */