![]() |
VR-Forces 4.0.4 Class Documentation
|
Provides a method of doign settings backup. More...

Public Types | |
| enum | RestoreFlags { RestoreFromFactory = 0x00000001, RestoreFromLocal = 0x00000002, KeepRestoreFromLocal = 0x80000000, RestoreAll = RestoreFromFactory | RestoreFromLocal } |
| typedef std::map < DtSettingsBackup *, int > | RestoreWhenRestored |
Public Member Functions | |
| DtSettingsBackup () | |
| CTOR. | |
| virtual | ~DtSettingsBackup () |
| DTOR. | |
| virtual bool | createAndWriteToBackupFile (const std::ostringstream &str, const std::string &path) |
| Creates a backup file on the specified path and writes to that backup file given the string stream which contains the stored buffer. | |
| const std::string & | backupFile () const |
| Get the name of the backup file. | |
| virtual bool | backupExists () const |
| Returns true if the file can be restored from a local backup. | |
| virtual bool | factoryExists () const |
| Returns true if can be restored from factory. | |
| virtual void | backup () |
| Backs up settings to backup file. | |
| virtual void | deleteBackup () |
| If backup file exists, deletes it. | |
| virtual void | restore (bool fromFactory=false) |
| Restore all. | |
| virtual void | getRestorableNames (NameList &names) |
| Get the names of states restore will affect. | |
| virtual void | restore (bool fromFactory, bool selectedOnly) |
| Restore the state, either from the backup (default) or from the factory. | |
| virtual void | restore (const DtSettingsBackup *from)=0 |
| Called with the object that needs to be restored from. | |
| virtual void | restoreSelected (const DtSettingsBackup *) |
| Called with the object that needs to be restored from. | |
| virtual std::string | backupClassType () const =0 |
| Override to return the class name of this object. | |
| virtual DtSettingsBackup * | create () const =0 |
| Returns a new empty class of type. | |
| virtual void | write (boost::archive::xml_oarchive &ar)=0 |
| Override to write to given stream. | |
| virtual void | read (boost::archive::xml_iarchive &ar)=0 |
| Override to read from given stream. | |
| void | setManagerDestroyed (bool b) |
| If true, will not signal destroyed. | |
| virtual void | addRestoreWhenRestored (DtSettingsBackup *, const RestoreFlags &f=RestoreAll) |
| Sets to restore the specified object when this object is restored. | |
| const RestoreWhenRestored & | restoreWhenRestored () const |
| virtual void | cancelRestoreWhenRestored (DtSettingsBackup *, const RestoreFlags &f=RestoreAll) |
| Cancels that the specified object should be restored when this one is restored. | |
| virtual std::string | backupName () const |
| Returns a more readable backup name (for dialogs). | |
| void | setBackupsPath (const std::string &s) |
| const std::string & | backupsPath () const |
| void | setFactoryFile (const std::string &s) |
| const std::string & | factoryFile () const |
Public Attributes | |
| boost::signal< void(const DtSettingsBackup *)> | signal_destructing |
| Called when destructing. | |
| boost::signal< void(const DtSettingsBackup *)> | signal_backupCleared |
| boost::signal< void(const DtSettingsBackup *)> | signal_backedUp |
| boost::signal< void(const DtSettingsBackup *)> | signal_restored |
Protected Member Functions | |
| virtual bool | restore (bool fromFactory, std::vector< DtSettingsBackup * > &hasBeenRestored, bool selectedOnly) |
| Restores from startup (false) or factory (true) file. | |
Protected Attributes | |
| bool | myManagerDestroyed |
| RestoreWhenRestored | myRestoreWhenRestored |
| std::string | myBackupFile |
| std::string | myFactoryFile |
| std::string | myBackupsPath |
Provides a method of doign settings backup.
| typedef std::map<DtSettingsBackup*, int> makVrv::DtSettingsBackup::RestoreWhenRestored |
| virtual makVrv::DtSettingsBackup::~DtSettingsBackup | ( | ) | [virtual] |
DTOR.
| virtual bool makVrv::DtSettingsBackup::createAndWriteToBackupFile | ( | const std::ostringstream & | str, |
| const std::string & | path | ||
| ) | [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
| const std::string& makVrv::DtSettingsBackup::backupFile | ( | ) | const |
Get the name of the backup file.
| virtual bool makVrv::DtSettingsBackup::backupExists | ( | ) | const [virtual] |
Returns true if the file can be restored from a local backup.
Implements makVrv::DtBackupInterface.
| virtual bool makVrv::DtSettingsBackup::factoryExists | ( | ) | const [virtual] |
Returns true if can be restored from factory.
Implements makVrv::DtBackupInterface.
| virtual void makVrv::DtSettingsBackup::backup | ( | ) | [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::DtForestSettingsRecord >::initializeBackup().
| virtual void makVrv::DtSettingsBackup::deleteBackup | ( | ) | [virtual] |
If backup file exists, deletes it.
Returns true if successful. Emits signal_backupCleared when backup is cleared
Implements makVrv::DtBackupInterface.
| virtual void makVrv::DtSettingsBackup::restore | ( | bool | fromFactory = false | ) | [virtual] |
Restore all.
Implements makVrv::DtBackupInterface.
| virtual void makVrv::DtSettingsBackup::getRestorableNames | ( | NameList & | names | ) | [virtual] |
Get the names of states restore will affect.
Implements makVrv::DtBackupInterface.
| virtual void makVrv::DtSettingsBackup::restore | ( | bool | fromFactory, |
| bool | selectedOnly | ||
| ) | [virtual] |
Restore the state, either from the backup (default) or from the factory.
| virtual void makVrv::DtSettingsBackup::restore | ( | const DtSettingsBackup * | from | ) | [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::DtCigiSettingsBackup, makVrv::DtKeyMapSettingsBackup, makVrv::DtEntityTypeMapperBackup, makVrv::DtSharedRecordSettingsBackup< SettingsClass, ArchiveClass >, makVrv::DtRecordSettingsBackup< SettingsClass, ArchiveClass >, makVrv::DtSchemaSettingsBackup, makVrv::DtModelDefinitionManagerBackup, and makVrv::DtSymbolDecorationSettingsBackup.
| virtual void makVrv::DtSettingsBackup::restoreSelected | ( | const DtSettingsBackup * | ) | [inline, 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
| virtual std::string makVrv::DtSettingsBackup::backupClassType | ( | ) | const [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::DtCigiSettingsBackup, makVrv::DtKeyMapSettingsBackup, makVrv::DtEntityTypeMapperBackup, makVrv::DtSharedRecordSettingsBackup< SettingsClass, ArchiveClass >, makVrv::DtRecordSettingsBackupInterface, makVrv::DtSchemaSettingsBackup, and makVrv::DtModelDefinitionManagerBackup.
| virtual DtSettingsBackup* makVrv::DtSettingsBackup::create | ( | ) | const [pure virtual] |
Returns a new empty class of type.
Will be called from restore() method to restore data into
Implemented in makVrv::DtCigiSettingsBackup, makVrv::DtKeyMapSettingsBackup, makVrv::DtEntityTypeMapperBackup, makVrv::DtSharedRecordSettingsBackup< SettingsClass, ArchiveClass >, makVrv::DtRecordSettingsBackup< SettingsClass, ArchiveClass >, makVrv::DtSchemaSettingsBackup, makVrv::DtModelDefinitionManagerBackup, and makVrv::DtSymbolDecorationSettingsBackup.
| virtual void makVrv::DtSettingsBackup::write | ( | boost::archive::xml_oarchive & | ar | ) | [pure virtual] |
Override to write to given stream.
Implementation need not be more than oa << *this
Implemented in makVrv::DtCigiSettingsBackup, makVrv::DtKeyMapSettingsBackup, makVrv::DtEntityTypeMapperBackup, makVrv::DtSharedRecordSettingsBackup< SettingsClass, ArchiveClass >, makVrv::DtRecordSettingsBackup< SettingsClass, ArchiveClass >, makVrv::DtSchemaSettingsBackup, makVrv::DtModelDefinitionManagerBackup, and makVrv::DtSymbolDecorationSettingsBackup.
| virtual void makVrv::DtSettingsBackup::read | ( | boost::archive::xml_iarchive & | ar | ) | [pure virtual] |
Override to read from given stream.
Implementation need not be more than ia >> *this
Implemented in makVrv::DtCigiSettingsBackup, makVrv::DtKeyMapSettingsBackup, makVrv::DtEntityTypeMapperBackup, makVrv::DtSharedRecordSettingsBackup< SettingsClass, ArchiveClass >, makVrv::DtRecordSettingsBackup< SettingsClass, ArchiveClass >, makVrv::DtSchemaSettingsBackup, makVrv::DtModelDefinitionManagerBackup, and makVrv::DtSymbolDecorationSettingsBackup.
| void makVrv::DtSettingsBackup::setManagerDestroyed | ( | bool | b | ) | [inline] |
If true, will not signal destroyed.
| virtual void makVrv::DtSettingsBackup::addRestoreWhenRestored | ( | DtSettingsBackup * | , |
| const RestoreFlags & | f = RestoreAll |
||
| ) | [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
| const RestoreWhenRestored& makVrv::DtSettingsBackup::restoreWhenRestored | ( | ) | const [inline] |
| virtual void makVrv::DtSettingsBackup::cancelRestoreWhenRestored | ( | DtSettingsBackup * | , |
| const RestoreFlags & | f = RestoreAll |
||
| ) | [virtual] |
Cancels that the specified object should be restored when this one is restored.
| virtual std::string makVrv::DtSettingsBackup::backupName | ( | ) | const [virtual] |
Returns a more readable backup name (for dialogs).
Will return backupClassType by default
Reimplemented in makVrv::DtCigiSettingsBackup, makVrv::DtKeyMapSettingsBackup, makVrv::DtSharedRecordSettingsBackup< SettingsClass, ArchiveClass >, makVrv::DtRecordSettingsBackupInterface, makVrv::DtSymbolDecorationSettingsBackup, and makVrv::DtModelDefinitionManagerBackup.
| void makVrv::DtSettingsBackup::setBackupsPath | ( | const std::string & | s | ) | [inline] |
| const std::string& makVrv::DtSettingsBackup::backupsPath | ( | ) | const [inline] |
| void makVrv::DtSettingsBackup::setFactoryFile | ( | const std::string & | s | ) | [inline] |
| const std::string& makVrv::DtSettingsBackup::factoryFile | ( | ) | const [inline] |
| virtual bool makVrv::DtSettingsBackup::restore | ( | bool | fromFactory, |
| std::vector< DtSettingsBackup * > & | hasBeenRestored, | ||
| bool | selectedOnly | ||
| ) | [protected, virtual] |
Restores from startup (false) or factory (true) file.
| boost::signal<void (const DtSettingsBackup*)> makVrv::DtSettingsBackup::signal_destructing |
Called when destructing.
If registered with shared manager will remove item
| boost::signal<void (const DtSettingsBackup*)> makVrv::DtSettingsBackup::signal_backupCleared |
| boost::signal<void (const DtSettingsBackup*)> makVrv::DtSettingsBackup::signal_backedUp |
| boost::signal<void (const DtSettingsBackup*)> makVrv::DtSettingsBackup::signal_restored |
bool makVrv::DtSettingsBackup::myManagerDestroyed [protected] |
std::string makVrv::DtSettingsBackup::myBackupFile [protected] |
std::string makVrv::DtSettingsBackup::myFactoryFile [protected] |
std::string makVrv::DtSettingsBackup::myBackupsPath [protected] |