![]() |
VR-Forces 4.0.4 Class Documentation
|
The makVrv::DtSettingsBackupManager class is a central place to store objects that can be backed up and restored. More...

Public Member Functions | |
| virtual | ~DtSettingsBackupManager () |
| DTOR. | |
| virtual void | setBackupsPath (const std::string &) |
| Sets the backups path. If it does not exist when the backup wants to be created, creates the path. | |
| const std::string & | backupsPath () const |
| virtual void | registerSettingsBackup (DtSettingsBackup *backup) |
| Registers the settings class with the manager. | |
| virtual void | unregisterSettingsBackup (const std::string &) |
| Unregisters item for backup. Sends out appropriate messages if either local or factory backup changes. | |
| virtual void | unregisterSettingsBackup (DtSettingsBackup *backup) |
| Calls similar class name with backupClassType() of object. | |
| virtual void | settingsObjectDestroyed (const DtSettingsBackup *) |
| Called when a registered settings object is destroyed, unregisters it. | |
| virtual void | settingsClearedBackup (const DtSettingsBackup *) |
| virtual void | settingsRestored (const DtSettingsBackup *) |
| virtual void | settingsBackedUp (const DtSettingsBackup *) |
| virtual bool | setFactoryFile (const std::string &, const std::string &factoryFile) |
| Sets the factory file to be used for restore for the specified backup. | |
| virtual bool | setFactoryFile (const DtSettingsBackup *, const std::string &factoryFile) |
| Calls similar class name with backupClassType() of object. | |
| virtual bool | canBeRevertedFromStartup (const std::string &) const |
| Returns true if the file can be restored from a local backup. | |
| virtual bool | canBeRevertedFromStartup (const DtSettingsBackup *) const |
| Calls similar class name with backupClassType() of object. | |
| virtual bool | canBeRestoredFromFactory (const std::string &) const |
| Returns true if can be restored from factory. | |
| virtual bool | canBeRestoredFromFactory (const DtSettingsBackup *) const |
| Calls similar class name with backupClassType() of object. | |
| virtual bool | backup (const std::string &) |
| Backs up the specified object and sends out signal through the shared signaller that the object has been backed=up. | |
| virtual bool | backup (const DtSettingsBackup *) |
| Calls similar class name with backupClassType() of object. | |
| virtual void | clearBackup (const std::string &) |
| Clears out any backup settings for specified object. | |
| virtual void | clearBackup (const DtSettingsBackup *) |
| Calls similar class name with backupClassType() of object. | |
| virtual bool | revertToStartup (const std::string &) |
| Restores settings for the supplied backup object by calling the restore() method on it. | |
| virtual bool | revertToStartup (const DtSettingsBackup *) |
| Calls similar class name with backupClassType() of object. | |
| virtual bool | restoreFromFactory (const std::string &) |
| Restores settings for the supplied backup object by restoring from factory file. | |
| virtual bool | restoreFromFactory (const DtSettingsBackup *) |
| Calls similar class name with backupClassType() of object. | |
| virtual bool | registered (const std::string &) const |
| Returns whether or not this class is registered. | |
| virtual bool | registered (const DtSettingsBackup *) const |
| Calls similar class name with backupClassType() of object. | |
| virtual void | restoreWhenRestored (const std::string &toRestore, const std::string &whenRestored, const DtSettingsBackup::RestoreFlags &f=DtSettingsBackup::RestoreAll) |
| Restores the specified backup setting when the host backup setting is restored. | |
| virtual void | restoreWhenRestored (const DtSettingsBackup *toRestore, const DtSettingsBackup *whenRestored, const DtSettingsBackup::RestoreFlags &f=DtSettingsBackup::RestoreAll) |
| Calls similar class name with backupClassType() of objects. | |
| virtual void | cancelRestoreWhenRestored (const std::string &toRestore, const std::string &whenRestored, const DtSettingsBackup::RestoreFlags &f=DtSettingsBackup::RestoreAll) |
| Removes the specified backup setting to be restored then the host is restored. | |
| virtual void | cancelRestoreWhenRestored (const DtSettingsBackup *toRestore, const DtSettingsBackup *whenRestored, const DtSettingsBackup::RestoreFlags &f=DtSettingsBackup::RestoreAll) |
| Calls similar class name with backupClassType() of objects. | |
| virtual std::vector< std::string > | willRestoreWhenRestored (const DtSettingsBackup *toRestore, const DtSettingsBackup::RestoreFlags &f=DtSettingsBackup::RestoreAll) const |
| Calls similar method with backupClassType() of object. | |
Static Public Member Functions | |
| static DtSettingsBackupManager & | instance (DtDe &de) |
| Get an instance of the settings manager. | |
Protected Types | |
| typedef std::map< std::string, DtSettingsBackup * > | DtSettingsBackupMap |
Protected Member Functions | |
| void | willRestoreWhenRestored (const std::string &toRestore, std::vector< std::string > &willRestore, const DtSettingsBackup::RestoreFlags &f=DtSettingsBackup::RestoreAll) const |
| Returns a list (names) of objects that will be restored for the given restore flags. | |
| DtSettingsBackupManager (DtDe &de) | |
| CTOR. Called from shared settings manager. | |
Protected Attributes | |
| DtDe & | myDe |
| DtSettingsBackupMap | myBackups |
| std::string | myBackupsPath |
| Map that maps backup class name to backup of object. | |
| boost::mutex | myMonitor |
The makVrv::DtSettingsBackupManager class is a central place to store objects that can be backed up and restored.
In order for objects to be backed up they must be of the makVrv::DtSettingsBackup class and must also implement the boost serialize method to archive and restore settings. When registering this this manager, if the object also can be restored from a factory setting, be sure to supply the factory file information either upon registration time or at a future date.
Note that this class will do it's own locking to allow multi-thread access
typedef std::map<std::string, DtSettingsBackup*> makVrv::DtSettingsBackupManager::DtSettingsBackupMap [protected] |
| virtual makVrv::DtSettingsBackupManager::~DtSettingsBackupManager | ( | ) | [virtual] |
DTOR.
| makVrv::DtSettingsBackupManager::DtSettingsBackupManager | ( | DtDe & | de | ) | [protected] |
CTOR. Called from shared settings manager.
| static DtSettingsBackupManager& makVrv::DtSettingsBackupManager::instance | ( | DtDe & | de | ) | [static] |
Get an instance of the settings manager.
Referenced by makVrv::DtRecordSettingsBackupInterface::DtRecordSettingsBackupInterface(), makVrv::DtBaseSettingsManager< makArchives::DtForestSettingsRecord >::initializeBackup(), and makVrv::DtBaseSharedSettingsManager< makArchives::DtEntitySettingsRecord, DtSharedEntityDisplaySettings >::initializeBackup().
| virtual void makVrv::DtSettingsBackupManager::setBackupsPath | ( | const std::string & | ) | [virtual] |
Sets the backups path. If it does not exist when the backup wants to be created, creates the path.
| const std::string& makVrv::DtSettingsBackupManager::backupsPath | ( | ) | const [inline] |
| virtual void makVrv::DtSettingsBackupManager::registerSettingsBackup | ( | DtSettingsBackup * | backup | ) | [virtual] |
Registers the settings class with the manager.
If the name supplied for registration already exists, the existing one will be replaced by the new one. Each settings object must implement the backupClassType() to return the type of backup object it is.
Referenced by makVrv::DtRecordSettingsBackupInterface::DtRecordSettingsBackupInterface(), makVrv::DtBaseSettingsManager< makArchives::DtForestSettingsRecord >::initializeBackup(), and makVrv::DtBaseSharedSettingsManager< makArchives::DtEntitySettingsRecord, DtSharedEntityDisplaySettings >::initializeBackup().
| virtual void makVrv::DtSettingsBackupManager::unregisterSettingsBackup | ( | const std::string & | ) | [virtual] |
Unregisters item for backup. Sends out appropriate messages if either local or factory backup changes.
| virtual void makVrv::DtSettingsBackupManager::unregisterSettingsBackup | ( | DtSettingsBackup * | backup | ) | [virtual] |
Calls similar class name with backupClassType() of object.
| virtual void makVrv::DtSettingsBackupManager::settingsObjectDestroyed | ( | const DtSettingsBackup * | ) | [virtual] |
Called when a registered settings object is destroyed, unregisters it.
| virtual void makVrv::DtSettingsBackupManager::settingsClearedBackup | ( | const DtSettingsBackup * | ) | [virtual] |
| virtual void makVrv::DtSettingsBackupManager::settingsRestored | ( | const DtSettingsBackup * | ) | [virtual] |
| virtual void makVrv::DtSettingsBackupManager::settingsBackedUp | ( | const DtSettingsBackup * | ) | [virtual] |
| virtual bool makVrv::DtSettingsBackupManager::setFactoryFile | ( | const std::string & | , |
| const std::string & | factoryFile | ||
| ) | [virtual] |
Sets the factory file to be used for restore for the specified backup.
Returns true if setting can be backed up from file
| virtual bool makVrv::DtSettingsBackupManager::setFactoryFile | ( | const DtSettingsBackup * | , |
| const std::string & | factoryFile | ||
| ) | [virtual] |
Calls similar class name with backupClassType() of object.
Emits signal if factory restore status has changed
| virtual bool makVrv::DtSettingsBackupManager::canBeRevertedFromStartup | ( | const std::string & | ) | const [virtual] |
Returns true if the file can be restored from a local backup.
| virtual bool makVrv::DtSettingsBackupManager::canBeRevertedFromStartup | ( | const DtSettingsBackup * | ) | const [virtual] |
Calls similar class name with backupClassType() of object.
| virtual bool makVrv::DtSettingsBackupManager::canBeRestoredFromFactory | ( | const std::string & | ) | const [virtual] |
Returns true if can be restored from factory.
| virtual bool makVrv::DtSettingsBackupManager::canBeRestoredFromFactory | ( | const DtSettingsBackup * | ) | const [virtual] |
Calls similar class name with backupClassType() of object.
| virtual bool makVrv::DtSettingsBackupManager::backup | ( | const std::string & | ) | [virtual] |
Backs up the specified object and sends out signal through the shared signaller that the object has been backed=up.
| virtual bool makVrv::DtSettingsBackupManager::backup | ( | const DtSettingsBackup * | ) | [virtual] |
Calls similar class name with backupClassType() of object.
| virtual void makVrv::DtSettingsBackupManager::clearBackup | ( | const std::string & | ) | [virtual] |
Clears out any backup settings for specified object.
If backup status changes, emits signal
| virtual void makVrv::DtSettingsBackupManager::clearBackup | ( | const DtSettingsBackup * | ) | [virtual] |
Calls similar class name with backupClassType() of object.
| virtual bool makVrv::DtSettingsBackupManager::revertToStartup | ( | const std::string & | ) | [virtual] |
Restores settings for the supplied backup object by calling the restore() method on it.
If no backup exists for the object, returns false. Signal will be emitted after object is restored
| virtual bool makVrv::DtSettingsBackupManager::revertToStartup | ( | const DtSettingsBackup * | ) | [virtual] |
Calls similar class name with backupClassType() of object.
| virtual bool makVrv::DtSettingsBackupManager::restoreFromFactory | ( | const std::string & | ) | [virtual] |
Restores settings for the supplied backup object by restoring from factory file.
| virtual bool makVrv::DtSettingsBackupManager::restoreFromFactory | ( | const DtSettingsBackup * | ) | [virtual] |
Calls similar class name with backupClassType() of object.
| virtual bool makVrv::DtSettingsBackupManager::registered | ( | const std::string & | ) | const [virtual] |
Returns whether or not this class is registered.
| virtual bool makVrv::DtSettingsBackupManager::registered | ( | const DtSettingsBackup * | ) | const [virtual] |
Calls similar class name with backupClassType() of object.
| virtual void makVrv::DtSettingsBackupManager::restoreWhenRestored | ( | const std::string & | toRestore, |
| const std::string & | whenRestored, | ||
| const DtSettingsBackup::RestoreFlags & | f = DtSettingsBackup::RestoreAll |
||
| ) | [virtual] |
Restores the specified backup setting when the host backup setting is restored.
This can chain so that many settings can be restored if one is
| virtual void makVrv::DtSettingsBackupManager::restoreWhenRestored | ( | const DtSettingsBackup * | toRestore, |
| const DtSettingsBackup * | whenRestored, | ||
| const DtSettingsBackup::RestoreFlags & | f = DtSettingsBackup::RestoreAll |
||
| ) | [virtual] |
Calls similar class name with backupClassType() of objects.
| virtual void makVrv::DtSettingsBackupManager::cancelRestoreWhenRestored | ( | const std::string & | toRestore, |
| const std::string & | whenRestored, | ||
| const DtSettingsBackup::RestoreFlags & | f = DtSettingsBackup::RestoreAll |
||
| ) | [virtual] |
Removes the specified backup setting to be restored then the host is restored.
| virtual void makVrv::DtSettingsBackupManager::cancelRestoreWhenRestored | ( | const DtSettingsBackup * | toRestore, |
| const DtSettingsBackup * | whenRestored, | ||
| const DtSettingsBackup::RestoreFlags & | f = DtSettingsBackup::RestoreAll |
||
| ) | [virtual] |
Calls similar class name with backupClassType() of objects.
| virtual std::vector<std::string> makVrv::DtSettingsBackupManager::willRestoreWhenRestored | ( | const DtSettingsBackup * | toRestore, |
| const DtSettingsBackup::RestoreFlags & | f = DtSettingsBackup::RestoreAll |
||
| ) | const [virtual] |
Calls similar method with backupClassType() of object.
| void makVrv::DtSettingsBackupManager::willRestoreWhenRestored | ( | const std::string & | toRestore, |
| std::vector< std::string > & | willRestore, | ||
| const DtSettingsBackup::RestoreFlags & | f = DtSettingsBackup::RestoreAll |
||
| ) | const [protected] |
Returns a list (names) of objects that will be restored for the given restore flags.
DtDe& makVrv::DtSettingsBackupManager::myDe [protected] |
std::string makVrv::DtSettingsBackupManager::myBackupsPath [protected] |
Map that maps backup class name to backup of object.
boost::mutex makVrv::DtSettingsBackupManager::myMonitor [mutable, protected] |