QModule.hh
Go to the documentation of this file.00001
00030 #ifndef _Q_MODULE_H_
00031 #define _Q_MODULE_H_
00032
00033 #include "QBaseModule.hh"
00034
00035 using namespace Cuore;
00036
00037 class QModule : public QBaseModule {
00038
00039 public:
00040
00041 QModule(const std::string&, QSequence *s);
00042
00043 virtual ~QModule();
00044
00045 protected:
00047 const QError& JumpToEvent(unsigned int event) { return GetSequence().JumpToEvent(event,this) ;}
00048
00050 virtual void Init() = 0;
00051
00053 virtual QEvent* Do( QEvent* ev) = 0;
00054
00056 virtual void Done() = 0;
00057
00058 private:
00060 void Begin() { Init(); }
00061
00063 QEvent* Process( QEvent* ev) { Do(ev); return ev; }
00064
00066 void End() { Done(); }
00067
00068 };
00069
00070 #undef REGISTER_MODULE
00071 #define REGISTER_MODULE(clazz) REGISTER_MOD(clazz,QModule)
00072
00073 #endif