F:/Dev-Cpp/Projects/Events System 1.0 Revision/Handler.hpp

Go to the documentation of this file.
00001 #ifndef _Handler
00002 #define _Handler
00003 
00004 #include <list>
00005 #include "SimpleElement.hpp"
00006 
00007 namespace EventsSystem
00008 {
00009         namespace Events
00010         {
00021                 namespace Handlers
00022                 {
00042                         template <class HandlerIdList, class TargetType = void, class SourceType = void>
00043                         class Handler : public Interfaces::SimpleElement<>
00044                         {
00045                         public:
00054                                 HandlerIdList iHandlerId;
00055                                 
00062                                 const SourceType *oSource;
00063                                 
00070                                 TargetType *oTarget;
00071                                 
00078                                 Handler(HandlerIdList iNewHandlerId)
00079                                 : oSource(NULL),
00080                                         oTarget(NULL),
00081                                         iNewHandlerId(iHandlerId)
00082                                 {
00083                                 }
00084                                 
00091                                 virtual ~Handler() {}
00092                                 
00093                                 virtual void runComponent() = 0;
00094                         };
00095                 
00096                         template <class HandlerIdList, class TargetType>
00097                         class Handler<HandlerIdList, TargetType, void> : public Interfaces::SimpleElement<>
00098                         {
00099                         public:
00108                                 HandlerIdList iHandlerId;
00109                                 
00110                                 TargetType *oTarget;
00111                                 
00118                                 Handler(HandlerIdList iNewHandlerId)
00119                                 : oTarget(NULL),
00120                                         iHandlerId(iNewHandlerId)
00121                                 {
00122                                 }
00123 
00124                                 virtual void runComponent() = 0;
00125                         };
00126                         
00127                         template<class HandlerIdList>
00128                         class Handler<HandlerIdList, void, void> : public Interfaces::SimpleElement<>
00129                         {
00130                         public:
00139                                 HandlerIdList iHandlerId;
00140                                 
00141                                 Handler(HandlerIdList iNewHandlerId)
00142                                 : iHandlerId(iNewHandlerId)
00143                                 {
00144                                 }
00145 
00146                                 
00147                                 virtual void runComponent() = 0;
00148                         };
00149                 }
00150         }
00151 }
00152 
00153 #endif

Generated on Thu Apr 13 12:15:07 2006 for Events System by  doxygen 1.4.6-NO