VR-Forces 4.7 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 

Document ID: Generated on Fri Apr 26 21:53:14 EDT 2019 from SVN revision 197883
Copyright © 2005-2019 VT MAK. All Rights Reserved (www.mak.com)