VR-Forces 4.0.4 Class Documentation
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
makVrv::DtSharedSimulationSettingsManager Class Reference

The shared settings manager handles low level access to the settings. More...

Inheritance diagram for makVrv::DtSharedSimulationSettingsManager:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual ~DtSharedSimulationSettingsManager ()
 DTOR.
void connectInputSignals ()
 Connects to signals indicating the settings need updating.
void loadDefaultMappings (DtEntityTypeMapper &mapper, bool useFactory)
 Saving and loading is NOT thread save, these functions must be called in the main thread (because they use DtDe).
void saveDefaultMappings ()
 Save the default settings, this will internally acquire a read lock (released at end).
void saveDefaultMappings (const DtEntityTypeMapper &mapper)
 Save a default mapper.
void loadMapFile (const std::string &filePath, DtEntityTypeMapper &mapper)
 Load an entity type mapper from a file.
void saveMapFile (const std::string &filePath, const DtEntityTypeMapper &mapper)
 Save an entity type mapper to a file.
void setAutoSave (bool b)
 Sets whether the manager should save settings as they change.
bool autoSave () const
 Gets whether the manager saves settings as they change.

Static Public Member Functions

static
DtSharedSimulationSettingsManager
instance (DtDe &de)
 Static instance method.

Protected Member Functions

virtual void mapperChanged (const DtEntityTypeMapper &)
 Called when a mapper has changed, saves if autosave is true.
virtual void backupMapper (DtEntityTypeMapper &)
 Called when a mapper wants to be backed up.
virtual void entityTypeMappingsRestored (const DtSettingsBackup *)
 Called when a mapping is restored, save out if auto save is true.
 DtSharedSimulationSettingsManager (DtDe &de)
 CTOR.

Private Member Functions

void initializeMappings ()
 Initializes the cockpit mappings from the settings file.
void initDefaultMappings (bool useFactory)
 Load the default settings, this will acquire a write lock (released at end).

Private Attributes

DtSignalConnectionManager myConnections
bool myAutoSave
DtDemyDe

Detailed Description

The shared settings manager handles low level access to the settings.

This object is not thread safe. It will auto save changes though. To access or change settings use the following thread-safe methods:

 DtWriteSettingsLock<DtSharedSimulationSettings> 
    settings(DtSharedSettingsManager::instance(myAgentManager.de()));

or:

 DtReadSettingsLock<DtSharedSimulationSettings> 
    settings(DtSharedSettingsManager::instance(myDe));

Constructor & Destructor Documentation

DTOR.

CTOR.


Member Function Documentation

Static instance method.

Connects to signals indicating the settings need updating.

Connects to the signal indicating a mapping has changed, and connects to the signal indicating the settings backup has been restored.

Saving and loading is NOT thread save, these functions must be called in the main thread (because they use DtDe).

Warning:
This function needs a write lock in place to be safe.

Save the default settings, this will internally acquire a read lock (released at end).

Save a default mapper.

Warning:
This function needs a read lock in place to be safe.
void makVrv::DtSharedSimulationSettingsManager::loadMapFile ( const std::string &  filePath,
DtEntityTypeMapper mapper 
)

Load an entity type mapper from a file.

Warning:
This function needs a write lock in place to be safe.
void makVrv::DtSharedSimulationSettingsManager::saveMapFile ( const std::string &  filePath,
const DtEntityTypeMapper mapper 
)

Save an entity type mapper to a file.

Warning:
This function needs a read lock in place to be safe.

Sets whether the manager should save settings as they change.

Gets whether the manager saves settings as they change.

virtual void makVrv::DtSharedSimulationSettingsManager::mapperChanged ( const DtEntityTypeMapper ) [protected, virtual]

Called when a mapper has changed, saves if autosave is true.

Called when a mapper wants to be backed up.

Get lock on appropriate objects to back-up.

Called when a mapping is restored, save out if auto save is true.

Initializes the cockpit mappings from the settings file.

Load the default settings, this will acquire a write lock (released at end).

This method is intentionally private as it should only be called once, and from the constructor of this class


Member Data Documentation


The documentation for this class was generated from the following file:

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)