IBR-DTNSuite 0.6

daemon/src/core/TimeEvent.cpp

Go to the documentation of this file.
00001 /*
00002  * TimeEvent.cpp
00003  *
00004  *  Created on: 16.03.2009
00005  *      Author: morgenro
00006  */
00007 
00008 #include "core/TimeEvent.h"
00009 
00010 namespace dtn
00011 {
00012         namespace core
00013         {
00014                 TimeEvent::TimeEvent(const size_t timestamp, const TimeEventAction action)
00015                 : m_timestamp(timestamp), m_action(action)
00016                 {
00017 
00018                 }
00019 
00020                 TimeEvent::~TimeEvent()
00021                 {
00022 
00023                 }
00024 
00025                 TimeEventAction TimeEvent::getAction() const
00026                 {
00027                         return m_action;
00028                 }
00029 
00030                 size_t TimeEvent::getTimestamp() const
00031                 {
00032                         return m_timestamp;
00033                 }
00034 
00035                 const std::string TimeEvent::getName() const
00036                 {
00037                         return TimeEvent::className;
00038                 }
00039 
00040                 void TimeEvent::raise(const size_t timestamp, const TimeEventAction action)
00041                 {
00042                         // raise the new event
00043                         raiseEvent( new TimeEvent(timestamp, action) );
00044                 }
00045 
00046                 std::string TimeEvent::toString() const
00047                 {
00048                         return TimeEvent::className;
00049                 }
00050 
00051                 const std::string TimeEvent::className = "TimeEvent";
00052         }
00053 }