00001 #ifndef _ABSTRACTMOTIONRECEIVER_H 00002 #define _ABSTRACTMOTIONRECEIVER_H 00003 00004 #include <list> 00005 #include "IMotionObserver.h" 00006 #include "util/Vector.h" 00007 00009 00013 class AbstractMotionReceiver 00014 { 00015 public: 00020 AbstractMotionReceiver(); 00024 virtual ~AbstractMotionReceiver(); 00025 00030 bool addObserver(IMotionObserver *obs); 00035 bool removeObserver(IMotionObserver *obs); 00043 void notify(const Vector3d &v); 00044 00048 virtual void start() = 0; 00052 virtual void run() = 0; 00056 virtual void stop() = 0; 00060 const bool isRunning() const { return m_run; } 00061 00062 protected: 00066 void setRunning(const bool run) { m_run = run; } 00067 00068 private: 00069 bool m_run; 00070 typedef std::list<IMotionObserver*> observerList; 00071 observerList m_observers; 00072 }; 00073 00074 #endif