![]() |
VR-Forces Developer's Guide
|
Provides a method of doign settings backup.

Public Types | |
| enum | RestoreFlags { RestoreFromFactory = 0x00000001, RestoreFromLocal = 0x00000002, KeepRestoreFromLocal = 0x80000000, RestoreAll = RestoreFromFactory | RestoreFromLocal } |
| typedef std::map < DtSettingsBackup *, int > | RestoreWhenRestored |
Public Types inherited from makVrv::DtBackupInterface | |
| typedef std::vector< std::string > | NameList |
Public Member Functions | |
| DtSettingsBackup () | |
| virtual | ~DtSettingsBackup () |
| virtual bool | createAndWriteToBackupFile (const std::ostringstream &str, const std::string &path) |
| virtual bool | createAndWriteToBackupFiles (const std::vector< std::ostringstream * > &str, const std::string &path, const std::vector< std::string > &fileNames) |
| const std::string & | backupFile () const |
| virtual bool | backupFileExists () const |
| virtual bool | backupDirExists () const |
| virtual bool | factoryFileExists () const |
| virtual bool | factoryDirExists () const |
| virtual void | backup () |
| virtual void | backupByDir () |
| virtual void | deleteBackup () |
| virtual void | restore (bool fromFactory=false) |
| virtual void | getRestorableNames (NameList &names) |
| virtual void | restore (bool fromFactory, bool selectedOnly) |
| virtual void | restore (const DtSettingsBackup *from)=0 |
| virtual void | restoreSelected (const DtSettingsBackup *) |
| virtual std::string | backupClassType () const =0 |
| virtual DtSettingsBackup * | create () const =0 |
| virtual void | write (boost::archive::xml_oarchive &ar)=0 |
| virtual void | read (boost::archive::xml_iarchive &ar)=0 |
| virtual void | writeDir (std::vector< std::ostringstream * > &outStreamVec, std::vector< std::string > &fileNames) |
| virtual void | readIncremental (boost::archive::xml_iarchive &ar) |
| void | setManagerDestroyed (bool b) |
| virtual void | addRestoreWhenRestored (DtSettingsBackup *, const RestoreFlags &f=RestoreAll) |
| const RestoreWhenRestored & | restoreWhenRestored () const |
| virtual void | cancelRestoreWhenRestored (DtSettingsBackup *, const RestoreFlags &f=RestoreAll) |
| virtual std::string | backupName () const |
| void | setBackupsPath (const std::string &s) |
| const std::string & | backupsPath () const |
| void | setFactoryFile (const std::string &s) |
| const std::string & | factoryFile () const |
| void | setFactoryDir (const std::string &dir) |
| const std::string & | factoryDir () const |
| void | setBackupDir (const std::string &dir) |
| const std::string & | backupDir () const |
Public Member Functions inherited from makVrv::DtBackupInterface | |
| DtBackupInterface () | |
| virtual | ~DtBackupInterface () |
Public Attributes | |
| boost::signalslib::signal < void(const DtSettingsBackup *)> | signal_destructing |
| boost::signalslib::signal < void(const DtSettingsBackup *)> | signal_backupCleared |
| boost::signalslib::signal < void(const DtSettingsBackup *)> | signal_backedUp |
| boost::signalslib::signal < void(const DtSettingsBackup *)> | signal_restored |
Public Attributes inherited from makVrv::DtBackupInterface | |
| boost::signalslib::signal < void(DtBackupInterface *)> | signal_backupFileChanged |
Protected Member Functions | |
| virtual bool | restore (bool fromFactory, std::vector< DtSettingsBackup * > &hasBeenRestored, bool selectedOnly) |
Protected Attributes | |
| bool | myManagerDestroyed |
| RestoreWhenRestored | myRestoreWhenRestored |
| std::string | myBackupFile |
| std::string | myFactoryFile |
| std::string | myBackupsPath |
| std::string | myBackupDir |
| std::string | myFactoryDir |
| typedef std::map<DtSettingsBackup*, int> makVrv::DtSettingsBackup::RestoreWhenRestored |
| makVrv::DtSettingsBackup::DtSettingsBackup | ( | ) |
CTOR.
|
virtual |
DTOR.
|
virtual |
Creates a backup file on the specified path and writes to that backup file given the string stream which contains the stored buffer. Will delete the backup file when this object is deleted.
|
virtual |
| const std::string& makVrv::DtSettingsBackup::backupFile | ( | ) | const |
Get the name of the backup file.
|
virtual |
Returns true if the file can be restored from a local backup.
Implements makVrv::DtBackupInterface.
|
virtual |
Returns true if the file can be restored from a local backup directory.
Implements makVrv::DtBackupInterface.
|
virtual |
Returns true if can be restored from factory.
Implements makVrv::DtBackupInterface.
|
virtual |
Returns true if can be restored from factory directory.
Implements makVrv::DtBackupInterface.
|
virtual |
Backs up settings to backup file. If file does not exist, will create. Emits signal_backedUp when this object is backed up.
Implements makVrv::DtBackupInterface.
Reimplemented in makVrv::DtRecordSettingsBackupInterface.
Referenced by makVrv::DtRecordSettingsBackupInterface::backup(), makVrv::DtSharedRecordSettingsBackup< SettingsClass, ArchiveClass >::backup(), and makVrv::DtBaseSettingsManager< makArchives::DtOculusSettingsRecord >::initializeBackup().
|
virtual |
Backs up settings to backup directory. If directory does not exist, will create. Emits signal_backedUp when this object is backed up.
Reimplemented in makVrv::DtRecordSettingsBackupInterface.
Referenced by makVrv::DtRecordSettingsBackupInterface::backupByDir().
|
virtual |
If backup file exists, deletes it. Returns true if successful. Emits signal_backupCleared when backup is cleared.
Implements makVrv::DtBackupInterface.
|
virtual |
Restore all.
Implements makVrv::DtBackupInterface.
|
virtual |
Get the names of states restore will affect.
Implements makVrv::DtBackupInterface.
Restore the state, either from the backup (default) or from the factory.
|
pure virtual |
Called with the object that needs to be restored from. The object passed in should be considered temporary. Any member that holds onto this will become invalid after the restore method is complete.
Implemented in makVrv::DtEntityTypeMapperBackup, makVrv::DtCigiSettingsBackup, makVrv::DtSharedRecordSettingsBackup< SettingsClass, ArchiveClass >, makVrv::DtKeyMapSettingsBackup, makVrv::DtRecordSettingsBackup< SettingsClass, ArchiveClass >, makVrv::DtRecordSettingsBackup< DtBaseSettingsManager< makArchives::DtObserverModesRecord >, makArchives::DtObserverModesRecord >, makVrv::DtRecordSettingsBackup< DtBaseSettingsManager< makArchives::DtShadowSettingsCollectionRecord >, makArchives::DtShadowSettingsCollectionRecord >, makVrv::DtSchemaSettingsBackup, and makVrv::DtModelDefinitionManagerBackup.
|
inlinevirtual |
Called with the object that needs to be restored from. The object passed in should be considered temporary. Any member that holds onto this will become invalid after the restore method is complete.
Reimplemented in makVrv::DtShadowSettingsCollectionBackup, and makVrv::DtObserverModesSettingsBackup.
|
pure virtual |
Override to return the class name of this object. Will be used as a key to look itself up in the backup manager.
Implemented in makVrv::DtEntityTypeMapperBackup, makVrv::DtCigiSettingsBackup, makVrv::DtSharedRecordSettingsBackup< SettingsClass, ArchiveClass >, makVrv::DtKeyMapSettingsBackup, makVrv::DtRecordSettingsBackupInterface, makVrv::DtSchemaSettingsBackup, and makVrv::DtModelDefinitionManagerBackup.
|
pure virtual |
Returns a new empty class of type. Will be called from restore() method to restore data into.
Implemented in makVrv::DtEntityTypeMapperBackup, makVrv::DtCigiSettingsBackup, makVrv::DtSharedRecordSettingsBackup< SettingsClass, ArchiveClass >, makVrv::DtKeyMapSettingsBackup, makVrv::DtRecordSettingsBackup< SettingsClass, ArchiveClass >, makVrv::DtRecordSettingsBackup< DtBaseSettingsManager< makArchives::DtObserverModesRecord >, makArchives::DtObserverModesRecord >, makVrv::DtRecordSettingsBackup< DtBaseSettingsManager< makArchives::DtShadowSettingsCollectionRecord >, makArchives::DtShadowSettingsCollectionRecord >, makVrv::DtSchemaSettingsBackup, and makVrv::DtModelDefinitionManagerBackup.
|
pure virtual |
Override to write to given stream. Implementation need not be more than oa << *this.
Implemented in makVrv::DtEntityTypeMapperBackup, makVrv::DtCigiSettingsBackup, makVrv::DtSharedRecordSettingsBackup< SettingsClass, ArchiveClass >, makVrv::DtKeyMapSettingsBackup, makVrv::DtRecordSettingsBackup< SettingsClass, ArchiveClass >, makVrv::DtRecordSettingsBackup< DtBaseSettingsManager< makArchives::DtObserverModesRecord >, makArchives::DtObserverModesRecord >, makVrv::DtRecordSettingsBackup< DtBaseSettingsManager< makArchives::DtShadowSettingsCollectionRecord >, makArchives::DtShadowSettingsCollectionRecord >, makVrv::DtSchemaSettingsBackup, and makVrv::DtModelDefinitionManagerBackup.
|
pure virtual |
Override to read from given stream. Implementation need not be more than ia >> *this.
Implemented in makVrv::DtEntityTypeMapperBackup, makVrv::DtCigiSettingsBackup, makVrv::DtSharedRecordSettingsBackup< SettingsClass, ArchiveClass >, makVrv::DtKeyMapSettingsBackup, makVrv::DtRecordSettingsBackup< SettingsClass, ArchiveClass >, makVrv::DtRecordSettingsBackup< DtBaseSettingsManager< makArchives::DtObserverModesRecord >, makArchives::DtObserverModesRecord >, makVrv::DtRecordSettingsBackup< DtBaseSettingsManager< makArchives::DtShadowSettingsCollectionRecord >, makArchives::DtShadowSettingsCollectionRecord >, makVrv::DtSchemaSettingsBackup, and makVrv::DtModelDefinitionManagerBackup.
|
inlinevirtual |
Support for writing settings to files in a directory.
Reimplemented in makVrv::DtRecordSettingsBackup< SettingsClass, ArchiveClass >, makVrv::DtRecordSettingsBackup< DtBaseSettingsManager< makArchives::DtObserverModesRecord >, makArchives::DtObserverModesRecord >, and makVrv::DtRecordSettingsBackup< DtBaseSettingsManager< makArchives::DtShadowSettingsCollectionRecord >, makArchives::DtShadowSettingsCollectionRecord >.
|
inlinevirtual |
Support for reading files from a directory by looping over files and incrementally adding their contents.
Reimplemented in makVrv::DtEntityTypeMapperBackup, makVrv::DtRecordSettingsBackup< SettingsClass, ArchiveClass >, makVrv::DtRecordSettingsBackup< DtBaseSettingsManager< makArchives::DtObserverModesRecord >, makArchives::DtObserverModesRecord >, makVrv::DtRecordSettingsBackup< DtBaseSettingsManager< makArchives::DtShadowSettingsCollectionRecord >, makArchives::DtShadowSettingsCollectionRecord >, and makVrv::DtModelDefinitionManagerBackup.
|
inline |
If true, will not signal destroyed.
|
virtual |
Sets to restore the specified object when this object is restored. Will hold the information only – the actual restore will be handled by the backup manager.
|
inline |
|
virtual |
Cancels that the specified object should be restored when this one is restored.
|
virtual |
Returns a more readable backup name (for dialogs). Will return backupClassType by default.
Reimplemented in makVrv::DtCigiSettingsBackup, makVrv::DtSharedRecordSettingsBackup< SettingsClass, ArchiveClass >, makVrv::DtKeyMapSettingsBackup, makVrv::DtRecordSettingsBackupInterface, and makVrv::DtModelDefinitionManagerBackup.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
protectedvirtual |
Restores from startup (false) or factory (true) file.
| boost::signalslib::signal<void (const DtSettingsBackup*)> makVrv::DtSettingsBackup::signal_destructing |
Called when destructing. If registered with shared manager will remove item.
| boost::signalslib::signal<void (const DtSettingsBackup*)> makVrv::DtSettingsBackup::signal_backupCleared |
| boost::signalslib::signal<void (const DtSettingsBackup*)> makVrv::DtSettingsBackup::signal_backedUp |
| boost::signalslib::signal<void (const DtSettingsBackup*)> makVrv::DtSettingsBackup::signal_restored |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |