![]() |
VR-Forces Developer's Guide
|
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:
or:

Public Member Functions | |
| virtual | ~DtSharedSimulationSettingsManager () |
| void | connectInputSignals () |
| std::vector< std::string > | getFileList (DtEntityTypeMapper &mapper) |
| void | loadDefaultMappings (DtEntityTypeMapper &mapper, bool useFactory) |
| void | saveDefaultMappings () |
| void | saveDefaultMappings (const DtEntityTypeMapper &mapper) |
| void | loadMapFile (const std::string &filePath, DtEntityTypeMapper &mapper) |
| void | mergeMapFile (const std::string &filePath, DtEntityTypeMapper &mapper) |
| void | saveMapFile (const std::string &filePath, const DtEntityTypeMapper &mapper) |
| void | saveMapFiles (const std::vector< std::string > &filePath, const DtEntityTypeMapper &mapper) |
| void | saveSelectedMapFile (const std::string &filePath, std::vector< std::string > &keys, const DtEntityTypeMapper &mapper) |
| bool | shouldLoadDefaultMappings (const DtDeSettings *setting) |
| bool | shouldMergeMappings (const DtDeSettings *setting) |
| const std::vector< std::string > | getFilesToMerge (const DtDeSettings *setting) |
| bool | hasTypeMapSuffix (DtDeSettings *settings) |
| void | setAutoSave (bool b) |
| bool | autoSave () const |
Public Member Functions inherited from makVrv::DtVirtualBaseClass | |
| DtVirtualBaseClass () | |
| virtual | ~DtVirtualBaseClass () |
Static Public Member Functions | |
| static DtSharedSimulationSettingsManager & | instance (DtDe &de) |
Protected Member Functions | |
| virtual void | mapperChanged (const DtEntityTypeMapper &) |
| virtual void | backupMapper (DtEntityTypeMapper &) |
| virtual void | entityTypeMappingsRestored (const DtSettingsBackup *) |
| virtual bool | mergeTypeMappingsFromPaths (std::map< std::string, makArchives::DtEntityTypeMappingRecord > &record, DtDeSettings *settings, const std::string &fileOrDir, bool overwrite=false) |
| std::string | generateDefaultDir (DtDeSettings *settings) |
| void | generateDefaultDirAndFiles (DtDeSettings *settings, std::string &defaultDir, std::vector< std::string > &defaultDirFiles) |
| std::string | generateFactoryDir (DtDeSettings *settings) |
| void | generateFactoryDirAndFiles (DtDeSettings *settings, std::string &factoryDir, std::vector< std::string > &factoryDirFiles) |
| DtSharedSimulationSettingsManager (DtDe &de) | |
Private Member Functions | |
| DtSharedSimulationSettingsManager () | |
| DtSharedSimulationSettingsManager (const DtSharedSimulationSettingsManager ©) | |
| DtSharedSimulationSettingsManager & | operator= (const DtSharedSimulationSettingsManager &) |
| void | initializeMappings () |
| void | initDefaultMappings (bool useFactory) |
| bool | checkEntityTypeMapper (const std::string &name, DtSettingsChangeObject::UseType t, std::string &inUse) |
Private Attributes | |
| DtSignalConnectionManager | myConnections |
| bool | myAutoSave |
| std::string | myTypeMapSuffix |
| DtDe & | myDe |
| std::vector< std::string > | myFactoryFiles |
|
virtual |
DTOR.
|
private |
CTOR.
|
private |
Copy Constructor Not implemented.
|
protected |
CTOR.
|
static |
Static instance method.
|
private |
Assignment Operator Not implemented.
| void makVrv::DtSharedSimulationSettingsManager::connectInputSignals | ( | ) |
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.
| std::vector<std::string> makVrv::DtSharedSimulationSettingsManager::getFileList | ( | DtEntityTypeMapper & | mapper | ) |
| 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).
| void makVrv::DtSharedSimulationSettingsManager::saveDefaultMappings | ( | ) |
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::mergeMapFile | ( | const std::string & | filePath, |
| DtEntityTypeMapper & | mapper | ||
| ) |
Merge 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.
| void makVrv::DtSharedSimulationSettingsManager::saveMapFiles | ( | const std::vector< std::string > & | filePath, |
| const DtEntityTypeMapper & | mapper | ||
| ) |
| void makVrv::DtSharedSimulationSettingsManager::saveSelectedMapFile | ( | const std::string & | filePath, |
| std::vector< std::string > & | keys, | ||
| const DtEntityTypeMapper & | mapper | ||
| ) |
Save an entity type mapper to a file.
| bool makVrv::DtSharedSimulationSettingsManager::shouldLoadDefaultMappings | ( | const DtDeSettings * | setting | ) |
For this simulation object mapping, should we load by default? ex. false if –noAppData{Entity,Aggregate,TacticalGraphics}TypeMap.
| bool makVrv::DtSharedSimulationSettingsManager::shouldMergeMappings | ( | const DtDeSettings * | setting | ) |
For this simulation object mapping, should we merge in settings (if we have them) after loading defaults? ex. true if –merge{Entity,Aggregate,TacticalGraphics}TypeMap.
| const std::vector<std::string> makVrv::DtSharedSimulationSettingsManager::getFilesToMerge | ( | const DtDeSettings * | setting | ) |
| bool makVrv::DtSharedSimulationSettingsManager::hasTypeMapSuffix | ( | DtDeSettings * | settings | ) |
| void makVrv::DtSharedSimulationSettingsManager::setAutoSave | ( | bool | b | ) |
Sets whether the manager should save settings as they change.
| bool makVrv::DtSharedSimulationSettingsManager::autoSave | ( | ) | const |
Gets whether the manager saves settings as they change.
|
protectedvirtual |
Called when a mapper has changed, saves if autosave is true.
|
protectedvirtual |
Called when a mapper wants to be backed up. Get lock on appropriate objects to back-up.
|
protectedvirtual |
Called when a mapping is restored, save out if auto save is true.
|
protectedvirtual |
Read mappings from a directory with extensions specified by the settings fileOrDir is assigned to save as the file path for the mappings passed in. overwrite param is only used for commandline merges, over write any mappings in the record map with any in the file/dir.
|
protected |
Generate the path to the default type mapping directory return "" if path cannot be generated from settings (path may or may not exist on disk)
|
protected |
Generate default directory and list any files there.
|
protected |
Generate the path to the factory type mapping directory return "" if path cannot be generated from settings (path may or may not exist on disk)
|
protected |
Generate factory directory and list any files there.
|
private |
Initializes the cockpit mappings from the settings file.
|
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.
|
private |
Checks if an entity is in the entity type mapper Don't allow people to delete an object if they don't remove it from the entity type maps first.
|
private |
|
private |
|
private |
|
private |
|
private |