![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /****************************************************************************** 00002 ** Copyright (c) 2008 MAK Technologies, Inc. 00003 ** All rights reserved. 00004 ******************************************************************************/ 00005 /****************************************************************************** 00006 ** $RCSfile: DtVrfResourceManager.h,v $ $Revision: 1.2 $ $State: Exp $ 00007 ******************************************************************************/ 00008 00011 00013 00014 #pragma once 00015 00016 #include <vrfGuiCore/vrfGuiCore.h> 00017 00018 #include <vrvUtil/DtVirtualBaseClass.h> 00019 00020 #include <boost/signal.hpp> 00021 00022 namespace makVrv 00023 { 00024 class DtDe; 00025 } 00026 00027 class DtIfServerRequestResponse; 00028 class DtSimMessage; 00029 00030 namespace makVrf 00031 { 00032 class DT_DLL_VRFGUICORE DtVrfResourceManager : public makVrv::DtVirtualBaseClass 00033 { 00034 public: 00035 DtVrfResourceManager(makVrv::DtDe&); 00036 virtual ~DtVrfResourceManager(); 00037 00039 static DtVrfResourceManager& instance(makVrv::DtDe& de); 00040 00041 public: 00043 virtual void requestResourcesFor(const std::vector<std::string>& names); 00044 boost::signal<void (const DtIfServerRequestResponse&)> signal_resourceResponse; 00045 00047 virtual void startMonitoring(const std::string&, int period); 00048 00051 virtual bool stopMonitoring(const std::string&); 00052 00054 virtual int updateRateFor(const std::string&); 00055 00058 virtual void setUpdateRate(const std::string&, int); 00059 00061 bool monitoring(const std::string& n) const 00062 { 00063 return (myMonitoring.find(n) != myMonitoring.end()); 00064 } 00065 00066 protected: 00067 virtual void processResourceResponse(DtSimMessage*); 00068 00069 protected: 00070 makVrv::DtDe& myDe; 00071 std::map<std::string, int> myUpdateRates; 00072 00073 typedef std::map<std::string, int> DtMonitoringMap; 00074 DtMonitoringMap myMonitoring; 00075 }; 00076 }