VR-Forces 4.6.1 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtSharedSettingsManager.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2009 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 /******************************************************************************
6 ** $RCSfile: DtSharedSettingsManager.h,v $ $Revision: 1.7 $ $State: Exp $
7 ******************************************************************************/
8 
12 
13 #ifndef DtSharedSettingsManager_H_
14 #define DtSharedSettingsManager_H_
15 
16 #include <vrvCore/vrvCore.h>
18 
19 //Needed to keep from messing up windows.
20 #ifndef WIN32_LEAN_AND_MEAN
21 #define UNDEF_WIN32_LEAN_AND_MEAN
22 #define WIN32_LEAN_AND_MEAN
23 #endif
24 
25 #include <boost/thread/shared_mutex.hpp>
26 
27 #ifdef UNDEF_WIN32_LEAN_AND_MEAN
28 #undef UNDEF_WIN32_LEAN_AND_MEAN
29 #undef WIN32_LEAN_AND_MEAN
30 #endif
31 
32 #include <vlutil/vlThread.h>
33 #include <boost/unordered_map.hpp>
34 
35 namespace makVrv
36 {
37  class DtEventQueueInterface;
38  class DtDe;
39  class DtSharedSettings;
40 
46  {
47  public:
48 
51  template <typename SettingsClass> friend class DtReadSettingsLock;
52  template <typename SettingsClass> friend class DtWriteSettingsLock;
53 
55  static DtSharedSettingsManager& instance(DtDe&);
56 
58  virtual ~DtSharedSettingsManager();
59 
64  DtEventQueueInterface& thisThreadEventQueue() const;
65 
69  DtEventQueueInterface* findThisThreadEventQueue() const;
70 
71  protected:
72 
75  const DtSharedSettings* findSettings(const std::string& className) const;
76 
79  void registerSettings(const std::string& className,DtSharedSettings* setting);
80 
81  inline boost::shared_mutex& mutex()
82  {
83  return myMutex;
84  }
85 
86  protected:
87 
90 
91  private:
95 
96  protected:
97  typedef boost::unordered_map<std::string, DtSharedSettings*> SettingInstances;
98 
99  boost::shared_mutex myMutex;
102  DtThreadId myDeThreadId;
103 
104  };
105 }
106 
107 #endif
108 

Document ID: Generated on Wed Jul 25 16:57:45 EDT 2018 from SVN revision 190790
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)