VR-Forces 4.8 Class Documentation
 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 /******************************************************************************
6 ** $RCSfile: DtWriteSettingsLock.h,v $ $Revision: 1.6 $ $State: Exp $
7 ******************************************************************************/
8 
12 
13 #ifndef DtWriteSettingsLock_H_
14 #define DtWriteSettingsLock_H_
15 
17 
18 #include <boost/thread/locks.hpp>
19 
20 namespace makVrv
21 {
22  class DtSharedSettingsManager;
23 
49  template <typename SettingsClass>
51  {
52  public:
53 
54  //Acquired an instance of the SettingsClass with a read lock.
56 
57  //release the lock on the object.
59 
60  //Access the instance using pointer notation.
61  inline SettingsClass* operator->() { return myObject; }
62 
63  //Access the instance using deref notation.
64  inline SettingsClass& operator*() { return *myObject; }
65 
66  private:
67  //Not copyable or assignable.
70 
71  private:
73  SettingsClass* myObject;
74 
75  boost::shared_lock<boost::shared_mutex> myManagerLock;
76  boost::unique_lock<boost::shared_mutex> myObjectLock;
77 
78  };
79 }
80 
81 #define DtWriteSettingsLock_INL_
82 #include <vrvCore/DtWriteSettingsLock.inl>
83 #undef DtWriteSettingsLock_INL_
84 
85 #endif
86 
boost::unique_lock< boost::shared_mutex > myObjectLock
Definition: DtWriteSettingsLock.h:76
SettingsClass & operator*()
Definition: DtWriteSettingsLock.h:64
boost::shared_lock< boost::shared_mutex > myManagerLock
Definition: DtWriteSettingsLock.h:75
SettingsClass * operator->()
Definition: DtWriteSettingsLock.h:61
The shared settings manager, is the global object responsible for managing any shared settings object...
Definition: DtSharedSettingsManager.h:45
SettingsClass * myObject
Definition: DtWriteSettingsLock.h:73
DtWriteSettingsLock & operator=(const DtWriteSettingsLock &)
a write settings lock on a setting object.
Definition: DtWriteSettingsLock.h:50
Contains makVrv::DtSharedSettingsManager class.
DtSharedSettingsManager & myManager
Definition: DtWriteSettingsLock.h:72
DtWriteSettingsLock(DtSharedSettingsManager &manager)

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)