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

Public Member Functions | |
| virtual | ~DtSharedSimulationSettingsManager () |
| DTOR. More... | |
| void | connectInputSignals () |
| Connects to signals indicating the settings need updating. More... | |
| std::vector< std::string > | getFileList (DtEntityTypeMapper &mapper) |
| 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). More... | |
| void | saveDefaultMappings () |
| Save the default settings, this will internally acquire a read lock (released at end). More... | |
| void | saveDefaultMappings (const DtEntityTypeMapper &mapper) |
| Save a default mapper. More... | |
| void | loadMapFile (const std::string &filePath, DtEntityTypeMapper &mapper) |
| Load an entity type mapper from a file. More... | |
| void | mergeMapFile (const std::string &filePath, DtEntityTypeMapper &mapper) |
| Merge an entity type mapper from a file. More... | |
| void | saveMapFile (const std::string &filePath, const DtEntityTypeMapper &mapper) |
| Save an entity type mapper to a file. More... | |
| 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) |
| Save an entity type mapper to a file. More... | |
| bool | shouldLoadDefaultMappings (const DtDeSettings *setting) |
| For this simulation object mapping, should we load by default? ex. More... | |
| bool | shouldMergeMappings (const DtDeSettings *setting) |
| For this simulation object mapping, should we merge in settings (if we have them) after loading defaults? ex. More... | |
| const std::vector< std::string > | getFilesToMerge (const DtDeSettings *setting) |
| bool | hasTypeMapSuffix (DtDeSettings *settings) |
| void | setAutoSave (bool b) |
| Sets whether the manager should save settings as they change. More... | |
| bool | autoSave () const |
| Gets whether the manager saves settings as they change. More... | |
Public Member Functions inherited from makVrv::DtVirtualBaseClass | |
| DtVirtualBaseClass () | |
| Do nothing constructor. More... | |
| virtual | ~DtVirtualBaseClass () |
| Virtual do nothing destructor. More... | |
Static Public Member Functions | |
| static DtSharedSimulationSettingsManager & | instance (DtDe &de) |
| Static instance method. More... | |
Protected Member Functions | |
| virtual void | mapperChanged (const DtEntityTypeMapper &) |
| Called when a mapper has changed, saves if autosave is true. More... | |
| virtual void | backupMapper (DtEntityTypeMapper &) |
| Called when a mapper wants to be backed up. More... | |
| virtual void | entityTypeMappingsRestored (const DtSettingsBackup *) |
| Called when a mapping is restored, save out if auto save is true. More... | |
| virtual bool | mergeTypeMappingsFromPaths (std::map< std::string, makArchives::DtEntityTypeMappingRecord > &record, DtDeSettings *settings, const std::string &fileOrDir) |
| 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. More... | |
| virtual bool | mergeTypeMappings (const std::string &dir) |
| Read additional type files in a directory (*.metx, etc.) and merge their records Return true if all files were able to be processed Note: skips files that have errors. More... | |
| virtual bool | mergeTypeMappingFile (const std::string &fileName) |
| Read a type mapping file (*.metx, etc.) and merge the records Return true if file exists and was read. More... | |
| virtual bool | mergeTypeMappingsFromPath (makArchives::DtEntityTypeMappingRecord &record, DtDeSettings *settings, const std::string &fileOrDir) |
| Read mapping from a directory with extension specified by the settings. More... | |
| std::string | generateDefaultDir (DtDeSettings *settings) |
| 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) More... | |
| void | generateDefaultDirAndFiles (DtDeSettings *settings, std::string &defaultDir, std::vector< std::string > &defaultDirFiles) |
| Generate default directory and list any files there. More... | |
| std::string | generateFactoryDir (DtDeSettings *settings) |
| 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) More... | |
| void | generateFactoryDirAndFiles (DtDeSettings *settings, std::string &factoryDir, std::vector< std::string > &factoryDirFiles) |
| Generate factory directory and list any files there. More... | |
| DtSharedSimulationSettingsManager (DtDe &de) | |
| CTOR. More... | |
Private Member Functions | |
| DtSharedSimulationSettingsManager () | |
| CTOR. More... | |
| DtSharedSimulationSettingsManager (const DtSharedSimulationSettingsManager ©) | |
| Copy Constructor Not implemented. More... | |
| DtSharedSimulationSettingsManager & | operator= (const DtSharedSimulationSettingsManager &) |
| Assignment Operator Not implemented. More... | |
| void | initializeMappings () |
| Initializes the cockpit mappings from the settings file. More... | |
| void | initDefaultMappings (bool useFactory) |
| Load the default settings, this will acquire a write lock (released at end). More... | |
| bool | checkEntityTypeMapper (const std::string &name, DtSettingsChangeObject::UseType t, std::string &inUse) |
| 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. More... | |
Private Attributes | |
| DtSignalConnectionManager | myConnections |
| bool | myAutoSave |
| std::string | myTypeMapSuffix |
| DtDe & | myDe |
| std::vector< std::string > | myFactoryFiles |
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:
|
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.
|
protectedvirtual |
Read additional type files in a directory (*.metx, etc.) and merge their records Return true if all files were able to be processed Note: skips files that have errors.
|
protectedvirtual |
Read a type mapping file (*.metx, etc.) and merge the records Return true if file exists and was read.
|
protectedvirtual |
Read mapping from a directory with extension specified by the settings.
|
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 |