VR-Forces 4.1.1 Class Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Behavior Models
File List
File Members
include
vrvCore
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
>
17
#include <
vrvUtil/DtVirtualBaseClass.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 <map>
34
35
namespace
makVrv
36
{
37
class
DtEventQueueInterface;
38
class
DtDe;
39
class
DtSharedSettings;
40
45
class
DT_DLL_VRVCORE
DtSharedSettingsManager
:
public
DtVirtualBaseClass
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
89
DtSharedSettingsManager
(
DtDe
& de);
90
91
private
:
93
DtSharedSettingsManager
(
const
DtSharedSettingsManager
&);
94
DtSharedSettingsManager
& operator=(
DtSharedSettingsManager
&);
95
96
protected
:
97
typedef
std::map<std::string, DtSharedSettings*>
SettingInstances
;
98
99
boost::shared_mutex
myMutex
;
100
SettingInstances
mySettings
;
101
DtDe
&
myUnsafeDe
;
102
DtThreadId
myDeThreadId
;
103
104
};
105
}
106
107
#endif
108
Document ID: Generated on Mon Apr 8 19:24:01 EDT 2013 from SVN revision 125877
Copyright © 2005-2013 VT MÄK. All Rights Reserved (
www.mak.com
)