VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | 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. 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>
Inheritance diagram for makVrv::DtSharedSimulationSettingsManager:
Inheritance graph
[legend]

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 &copy)
 
DtSharedSimulationSettingsManageroperator= (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
 
DtDemyDe
 
std::vector< std::string > myFactoryFiles
 

Constructor & Destructor Documentation

virtual makVrv::DtSharedSimulationSettingsManager::~DtSharedSimulationSettingsManager ( )
virtual

DTOR.

makVrv::DtSharedSimulationSettingsManager::DtSharedSimulationSettingsManager ( )
private

CTOR.

makVrv::DtSharedSimulationSettingsManager::DtSharedSimulationSettingsManager ( const DtSharedSimulationSettingsManager copy)
private

Copy Constructor Not implemented.

makVrv::DtSharedSimulationSettingsManager::DtSharedSimulationSettingsManager ( DtDe de)
protected

CTOR.

Member Function Documentation

static DtSharedSimulationSettingsManager& makVrv::DtSharedSimulationSettingsManager::instance ( DtDe de)
static

Static instance method.

DtSharedSimulationSettingsManager& makVrv::DtSharedSimulationSettingsManager::operator= ( const DtSharedSimulationSettingsManager )
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).

Warning
This function needs a write lock in place to be safe.
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.

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::mergeMapFile ( const std::string &  filePath,
DtEntityTypeMapper mapper 
)

Merge 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.
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.

Warning
This function needs a read lock in place to be safe.
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.

virtual void makVrv::DtSharedSimulationSettingsManager::mapperChanged ( const DtEntityTypeMapper )
protectedvirtual

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

virtual void makVrv::DtSharedSimulationSettingsManager::backupMapper ( DtEntityTypeMapper )
protectedvirtual

Called when a mapper wants to be backed up. Get lock on appropriate objects to back-up.

virtual void makVrv::DtSharedSimulationSettingsManager::entityTypeMappingsRestored ( const DtSettingsBackup )
protectedvirtual

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

virtual bool makVrv::DtSharedSimulationSettingsManager::mergeTypeMappingsFromPaths ( std::map< std::string, makArchives::DtEntityTypeMappingRecord > &  record,
DtDeSettings settings,
const std::string &  fileOrDir,
bool  overwrite = false 
)
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.

std::string makVrv::DtSharedSimulationSettingsManager::generateDefaultDir ( DtDeSettings 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)

void makVrv::DtSharedSimulationSettingsManager::generateDefaultDirAndFiles ( DtDeSettings settings,
std::string &  defaultDir,
std::vector< std::string > &  defaultDirFiles 
)
protected

Generate default directory and list any files there.

std::string makVrv::DtSharedSimulationSettingsManager::generateFactoryDir ( DtDeSettings settings)
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)

void makVrv::DtSharedSimulationSettingsManager::generateFactoryDirAndFiles ( DtDeSettings settings,
std::string &  factoryDir,
std::vector< std::string > &  factoryDirFiles 
)
protected

Generate factory directory and list any files there.

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.

bool makVrv::DtSharedSimulationSettingsManager::checkEntityTypeMapper ( const std::string &  name,
DtSettingsChangeObject::UseType  t,
std::string &  inUse 
)
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.

Member Data Documentation

DtSignalConnectionManager makVrv::DtSharedSimulationSettingsManager::myConnections
private
bool makVrv::DtSharedSimulationSettingsManager::myAutoSave
private
std::string makVrv::DtSharedSimulationSettingsManager::myTypeMapSuffix
private
DtDe& makVrv::DtSharedSimulationSettingsManager::myDe
private
std::vector<std::string> makVrv::DtSharedSimulationSettingsManager::myFactoryFiles
private

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

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)