VR-Forces 4.3.1 Class Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Behavior Models
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
include
vrvCore
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
16
#include <
vrvCore/vrvCore.h
>
17
#include <
vrvCore/DtSharedSettingsManager.h
>
18
19
#include <boost/thread/shared_mutex.hpp>
20
#include <boost/thread/locks.hpp>
21
22
namespace
makVrv
23
{
24
class
DtSharedSettingsManager;
25
51
template
<
typename
SettingsClass>
52
class
DtWriteSettingsLock
53
{
54
public
:
55
56
//Acquired an instance of the SettingsClass with a read lock.
57
DtWriteSettingsLock
(
DtSharedSettingsManager
& manager);
58
59
//release the lock on the object.
60
~DtWriteSettingsLock
();
61
62
//Access the instance using pointer notation.
63
inline
SettingsClass*
operator->
() {
return
myObject
; }
64
65
//Access the instance using deref notation.
66
inline
SettingsClass&
operator*
() {
return
*
myObject
; }
67
68
private
:
69
//Not copyable or assignable.
70
DtWriteSettingsLock
(
const
DtWriteSettingsLock
&);
71
DtWriteSettingsLock
&
operator=
(
const
DtWriteSettingsLock
&);
72
73
private
:
74
DtSharedSettingsManager
&
myManager
;
75
SettingsClass*
myObject
;
76
77
boost::shared_lock<boost::shared_mutex>
myManagerLock
;
78
boost::unique_lock<boost::shared_mutex>
myObjectLock
;
79
80
};
81
}
82
83
#define DtWriteSettingsLock_INL_
84
#include <vrvCore/DtWriteSettingsLock.inl>
85
#undef DtWriteSettingsLock_INL_
86
87
#endif
88
Document ID: Generated on Wed Jul 29 00:55:00 EDT 2015 from SVN revision 155257
Copyright © 2005-2015 VT MÄK. All Rights Reserved (
www.mak.com
)