00001 #ifndef SCT_API_CONFIG_CACHE_H 00002 #define SCT_API_CONFIG_CACHE_H 00003 00009 #include <Sct/AbcdModule.h> 00010 #include <CommonWithDsp/processor.h> 00011 #include <boost/shared_ptr.hpp> 00012 #include <string> 00013 #include <map> 00014 #include "SctApiFwd.h" 00015 #include <boost/thread.hpp> 00016 00017 namespace SctApi { 00023 class SctApiConfigCache{ 00024 public: 00025 class ModuleBanks; 00030 boost::shared_ptr<ModuleBanks> getFromMid(const UINT32 mid); 00031 boost::shared_ptr<const ModuleBanks> getFromMid(const UINT32 mid) const; 00035 void clearMid(const UINT32 mid); 00039 void clearAll(); 00040 00042 void copyAllModules(BankType from, std::list<BankType> to); 00044 void copyAllModules(BankType from, BankType to); 00048 void set(UINT32 mid, boost::shared_ptr<ModuleBanks> banks); 00052 SctApiConfigCache(); 00056 ~SctApiConfigCache(); 00060 class ModuleBanks{ 00061 public: 00066 boost::shared_ptr<ABCDModule> get(BankType b); 00070 boost::shared_ptr<const ABCDModule> get(BankType b) const; 00075 void copy(BankType from, BankType to); 00080 void copy(BankType from, std::list<BankType> to); 00082 void set(BankType, boost::shared_ptr<ABCDModule> config); 00083 private: 00084 std::map<BankType, boost::shared_ptr<ABCDModule> > m_map; 00085 mutable boost::recursive_mutex bank_mutex; 00086 }; 00087 00088 private: 00089 std::map<UINT32, boost::shared_ptr<ModuleBanks> > m_map; 00090 mutable boost::recursive_mutex cache_mutex; 00091 }; 00092 00093 } 00094 00095 #endif