![]() |
VR-Forces 4.0.4 Class Documentation
|
The shared settings manager handles low level access to the settings. More...

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 |
| DtDe & | myDe |
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));
| virtual makVrv::DtSharedSimulationSettingsManager::~DtSharedSimulationSettingsManager | ( | ) | [virtual] |
DTOR.
| makVrv::DtSharedSimulationSettingsManager::DtSharedSimulationSettingsManager | ( | DtDe & | de | ) | [protected] |
CTOR.
| static DtSharedSimulationSettingsManager& makVrv::DtSharedSimulationSettingsManager::instance | ( | DtDe & | de | ) | [static] |
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.
| void makVrv::DtSharedSimulationSettingsManager::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).
Save the default settings, this will internally acquire a read lock (released at end).
| void makVrv::DtSharedSimulationSettingsManager::saveDefaultMappings | ( | const DtEntityTypeMapper & | mapper | ) |
Save a default mapper.
| void makVrv::DtSharedSimulationSettingsManager::loadMapFile | ( | const std::string & | filePath, |
| DtEntityTypeMapper & | mapper | ||
| ) |
Load an entity type mapper from a file.
| void makVrv::DtSharedSimulationSettingsManager::saveMapFile | ( | const std::string & | filePath, |
| const DtEntityTypeMapper & | mapper | ||
| ) |
Save an entity type mapper to a file.
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.
| virtual void makVrv::DtSharedSimulationSettingsManager::backupMapper | ( | DtEntityTypeMapper & | ) | [protected, virtual] |
Called when a mapper wants to be backed up.
Get lock on appropriate objects to back-up.
| virtual void makVrv::DtSharedSimulationSettingsManager::entityTypeMappingsRestored | ( | const DtSettingsBackup * | ) | [protected, virtual] |
Called when a mapping is restored, save out if auto save is true.
| void makVrv::DtSharedSimulationSettingsManager::initializeMappings | ( | ) | [private] |
Initializes the cockpit mappings from the settings file.
| void makVrv::DtSharedSimulationSettingsManager::initDefaultMappings | ( | bool | useFactory | ) | [private] |
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