Go to the documentation of this file.00001
00002
00003
00004
00005
00008
00009 #ifndef lgrCommandDispatcher_H_
00010 #define lgrCommandDispatcher_H_
00011
00012 #include "lgrCore.h"
00013 #include "absoluteTime.h"
00014 #include "collectors.h"
00015 #include "lgrCommandQueue.h"
00016 #include "virtualConstructor.h"
00017
00018 #include <vlutil/vlSmartPointers.h>
00019 #include <vlutil/vlMutex.h>
00020
00021 namespace MAKLogger
00022 {
00023 class DtLogger;
00024 class DtLgrSharedData;
00025 class DtLgrCmdDescriptor;
00026 class DtAnnotationManager;
00027 class DtRuntimeCommandFactory;
00028
00033 class DT_DLL_LGRCORE DtCommandDispatcher
00034 {
00035 public:
00037 DT_VIRTUAL_CTR(DtCommandDispatcher,())
00038
00039
00040 virtual ~DtCommandDispatcher();
00041
00058 virtual bool addResponseListener(DtResponseQueueSP listener);
00059
00073 virtual void removeResponseListener(DtResponseQueueSP listener);
00074
00076 virtual void sendResponse(DtResponse response);
00077
00079 virtual void addCommand(const DtCommand& command);
00080
00082 void moveQueuedCommands(DtCollector< DtCommand>& collector);
00083
00084 private:
00086 DtCommandDispatcher( const DtCommandDispatcher& src );
00088 DtCommandDispatcher& operator=( const DtCommandDispatcher& src );
00089
00090 public:
00092 virtual DtAbsoluteTime tick();
00093
00094 protected:
00095 DtMutex myListenerMutex;
00096 DtLgrCommandQueue* myCommandQueue;
00097 DtResponseList myResponseList;
00098 DtRuntimeCommandFactory* myRuntimeCommandFactory;
00099 };
00100
00101 typedef DtBoost::shared_ptr<DtCommandDispatcher> DtCommandDispatcherSP;
00102
00103 }
00104
00105 #endif //! DtCommandDispatcher_H_
00106