AnalogMessageDispatcher.h

Go to the documentation of this file.
00001 #ifndef ANALOGMESSAGEDISPATCHER_H_
00002 #define ANALOGMESSAGEDISPATCHER_H_
00003 
00004 #include <boost/thread/barrier.hpp>
00005 
00006 #include <vector>
00007 
00008 using std::vector;
00009 
00010 class AnalogMessageDispatcher
00011 {
00012 public:
00013     AnalogMessageDispatcher();
00014     virtual ~AnalogMessageDispatcher();
00015 
00016     virtual void dispatchAnalogMsgs() = 0;
00017 
00018     virtual void initialize() = 0;
00019     
00020     virtual void reset(double dt) = 0;
00021 
00022     virtual void setBarrier(boost::barrier *barrier)
00023     {}
00024     ;
00025 };
00026 
00027 class AnalogMessageDispatcherVector
00028 {       
00029 public:
00030         virtual ~AnalogMessageDispatcherVector() {};
00031         
00032     virtual AnalogMessageDispatcher & operator[] (int idx) = 0;
00033 };
00034 
00035 
00036 template <typename T>
00037 class AnalogMessageDispatcherVectorImpl : public AnalogMessageDispatcherVector
00038 {
00039 public: 
00040     AnalogMessageDispatcherVectorImpl(vector<T*> &dispatcherVector)
00041             : dispatchers(dispatcherVector)
00042     {}
00043     ;
00044     
00045     virtual ~AnalogMessageDispatcherVectorImpl() {};
00046 
00047     virtual AnalogMessageDispatcher & operator[] (int idx)
00048     {
00049         return *(dispatchers[idx]);
00050     }
00051 
00052 protected:
00053     vector<T*> &dispatchers;
00054 };
00055 
00056 #endif /*ANALOGMESSAGEDISPATCHER_H_*/

Generated on Wed Jul 9 16:34:37 2008 for PCSIM by  doxygen 1.5.5