LibCT 2.0

Include/EventOccurance.h

Go to the documentation of this file.
00001 // ------------------------------------------------------------------
00012 #ifndef _LIBCT_EVENTOCCURANCE_H
00013 #define _LIBCT_EVENTOCCURANCE_H
00014 
00015 #include "Functor.h"
00016 #include "EventData.h"
00017 #include "Defines.h"
00018 
00019 namespace LibCT
00020 {
00022         class EventType;
00023 
00025         class EventOccurance
00026         {
00027         public:
00029                 EventOccurance( 
00030                         EventType* pEventType,  
00031                         Functor* pFunctor,              
00032                         int prioriy,                    
00033                         EventData* pEventData   
00034                         );
00035 
00037                 ~EventOccurance();
00038 
00040                 EventOccurance(
00041                         const EventOccurance& rhs       
00042                         );
00043 
00046                 EventOccurance& operator = (
00047                         const EventOccurance& rhs       
00048                         );
00049 
00051                 void Run();
00052 
00055                 const EventType* GetEventType() const;
00056 
00059                 int     GetPriority() const;
00060 
00063                 const void* GetData() const;
00064 
00067                 template<typename T>
00068                 const T* GetData() const { return static_cast<const T*>(m_pEventData->GetData()); }
00069 
00070         private:
00071                 EventType*              m_pEventType;           
00072                 Functor*                m_pFunctor;                     
00073                 int                             m_Priority;                     
00074                 EventData*              m_pEventData;           
00075         };
00076 }
00077 
00078 #endif // _LIBCT_EVENTOCCURANCE_H