VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtWriteSettingsLock.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2009 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #ifndef DtWriteSettingsLock_H_
11 #define DtWriteSettingsLock_H_
12 
14 
15 #include <boost/thread/locks.hpp>
16 
17 namespace makVrv
18 {
19  class DtSharedSettingsManager;
20 
46  template <typename SettingsClass>
48  {
49  public:
50 
51  //Acquired an instance of the SettingsClass with a read lock.
53 
54  //release the lock on the object.
56 
57  //Access the instance using pointer notation.
58  inline SettingsClass* operator->() { return myObject; }
59 
60  //Access the instance using deref notation.
61  inline SettingsClass& operator*() { return *myObject; }
62 
63  private:
64  //Not copyable or assignable.
67 
68  private:
70  SettingsClass* myObject;
71 
72  boost::shared_lock<boost::shared_mutex> myManagerLock;
73  boost::unique_lock<boost::shared_mutex> myObjectLock;
74 
75  };
76 }
77 
78 #define DtWriteSettingsLock_INL_
79 #include <vrvCore/DtWriteSettingsLock.inl>
80 #undef DtWriteSettingsLock_INL_
81 
82 #endif
83 
boost::unique_lock< boost::shared_mutex > myObjectLock
Definition: DtWriteSettingsLock.h:73
SettingsClass & operator*()
Definition: DtWriteSettingsLock.h:61
boost::shared_lock< boost::shared_mutex > myManagerLock
Definition: DtWriteSettingsLock.h:72
SettingsClass * operator->()
Definition: DtWriteSettingsLock.h:58
The shared settings manager, is the global object responsible for managing any shared settings object...
Definition: DtSharedSettingsManager.h:42
SettingsClass * myObject
Definition: DtWriteSettingsLock.h:70
DtWriteSettingsLock & operator=(const DtWriteSettingsLock &)
a write settings lock on a setting object. The object can be read and modified, but no other threads ...
Definition: DtWriteSettingsLock.h:47
Contains makVrv::DtSharedSettingsManager class.
DtSharedSettingsManager & myManager
Definition: DtWriteSettingsLock.h:69
DtWriteSettingsLock(DtSharedSettingsManager &manager)

Document ID: Generated on Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)