VR-Forces 4.3.1 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DtSettingsBackup.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2009 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 /******************************************************************************
6 ** $RCSfile: DtSettingsBackup.h,v $ $Revision: 1.16 $ $State: Exp $
7 ******************************************************************************/
8 
15 
16 #pragma once
17 #include <vrvCore/vrvCore.h>
19 #include <boost/archive/xml_iarchive.hpp>
20 #include <boost/archive/xml_oarchive.hpp>
21 
22 namespace makVrv
23 {
24 
28  {
29  public:
31  {
32  RestoreFromFactory = 0x00000001,
33  RestoreFromLocal = 0x00000002,
38  KeepRestoreFromLocal = 0x80000000,
39  RestoreAll = RestoreFromFactory | RestoreFromLocal
40  };
41 
42  typedef std::map<DtSettingsBackup*, int> RestoreWhenRestored;
43 
44  public:
45 
48 
50  virtual ~DtSettingsBackup();
51 
55  virtual bool createAndWriteToBackupFile(const std::ostringstream& str, const std::string& path);
56 
58  const std::string& backupFile() const;
59 
61  virtual bool backupExists() const;
62 
64  virtual bool factoryExists() const;
65 
68  virtual void backup();
69 
72  virtual void deleteBackup();
73 
75  virtual void restore(bool fromFactory = false);
76 
78  virtual void getRestorableNames(NameList& names);
79 
82  virtual void restore(bool fromFactory, bool selectedOnly);
83 
87  virtual void restore(const DtSettingsBackup* from ) = 0;
88 
92  virtual void restoreSelected( const DtSettingsBackup* ) {}
93 
96  virtual std::string backupClassType() const = 0;
97 
100  virtual DtSettingsBackup* create() const = 0;
101 
104  virtual void write(boost::archive::xml_oarchive& ar) = 0;
105 
108  virtual void read(boost::archive::xml_iarchive& ar) = 0;
109 
111  void setManagerDestroyed(bool b)
112  {
113  myManagerDestroyed = b;
114  }
115 
119  virtual void addRestoreWhenRestored(DtSettingsBackup*,
120  const RestoreFlags& f = RestoreAll);
121 
122  const RestoreWhenRestored& restoreWhenRestored() const
123  {
124  return myRestoreWhenRestored;
125  }
126 
129  virtual void cancelRestoreWhenRestored(DtSettingsBackup*,
130  const RestoreFlags& f = RestoreAll);
131 
134  virtual std::string backupName() const;
135 
136  void setBackupsPath(const std::string& s)
137  {
138  myBackupsPath = s;
139  }
140 
141  const std::string& backupsPath() const
142  {
143  return myBackupsPath;
144  }
145 
146  void setFactoryFile(const std::string& s)
147  {
148  myFactoryFile = s;
149  }
150 
151  const std::string& factoryFile() const
152  {
153  return myFactoryFile;
154  }
155 
158  boost::signal<void (const DtSettingsBackup*)> signal_destructing;
159  boost::signal<void (const DtSettingsBackup*)> signal_backupCleared;
160  boost::signal<void (const DtSettingsBackup*)> signal_backedUp;
161  boost::signal<void (const DtSettingsBackup*)> signal_restored;
162 
163  protected:
164 
166  virtual bool restore(bool fromFactory,
167  std::vector<DtSettingsBackup*>& hasBeenRestored, bool selectedOnly);
168 
169  protected:
170 
173  std::string myBackupFile;
174  std::string myFactoryFile;
175  std::string myBackupsPath;
176 
177  };
178 
179 }

Document ID: Generated on Wed Jul 29 00:55:00 EDT 2015 from SVN revision 155257
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)