VR-Forces Development_Version 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
18 #include <boost/archive/xml_iarchive.hpp>
19 #include <boost/archive/xml_oarchive.hpp>
20 
21 namespace makVrv
22 {
23 
27  {
28  public:
30  {
31  RestoreFromFactory = 0x00000001,
32  RestoreFromLocal = 0x00000002,
37  KeepRestoreFromLocal = 0x80000000,
38  RestoreAll = RestoreFromFactory | RestoreFromLocal
39  };
40 
41  typedef std::map<DtSettingsBackup*, int> RestoreWhenRestored;
42 
43  public:
44 
47 
49  virtual ~DtSettingsBackup();
50 
54  virtual bool createAndWriteToBackupFile(const std::ostringstream& str, const std::string& path);
55 
57  const std::string& backupFile() const;
58 
60  virtual bool backupExists() const;
61 
63  virtual bool factoryExists() const;
64 
67  virtual void backup();
68 
71  virtual void deleteBackup();
72 
74  virtual void restore(bool fromFactory = false);
75 
77  virtual void getRestorableNames(NameList& names);
78 
81  virtual void restore(bool fromFactory, bool selectedOnly);
82 
86  virtual void restore(const DtSettingsBackup* from ) = 0;
87 
91  virtual void restoreSelected( const DtSettingsBackup* ) {}
92 
95  virtual std::string backupClassType() const = 0;
96 
99  virtual DtSettingsBackup* create() const = 0;
100 
103  virtual void write(boost::archive::xml_oarchive& ar) = 0;
104 
107  virtual void read(boost::archive::xml_iarchive& ar) = 0;
108 
110  void setManagerDestroyed(bool b)
111  {
112  myManagerDestroyed = b;
113  }
114 
118  virtual void addRestoreWhenRestored(DtSettingsBackup*,
119  const RestoreFlags& f = RestoreAll);
120 
121  const RestoreWhenRestored& restoreWhenRestored() const
122  {
123  return myRestoreWhenRestored;
124  }
125 
128  virtual void cancelRestoreWhenRestored(DtSettingsBackup*,
129  const RestoreFlags& f = RestoreAll);
130 
133  virtual std::string backupName() const;
134 
135  void setBackupsPath(const std::string& s)
136  {
137  myBackupsPath = s;
138  }
139 
140  const std::string& backupsPath() const
141  {
142  return myBackupsPath;
143  }
144 
145  void setFactoryFile(const std::string& s)
146  {
147  myFactoryFile = s;
148  }
149 
150  const std::string& factoryFile() const
151  {
152  return myFactoryFile;
153  }
154 
157  boost::signal<void (const DtSettingsBackup*)> signal_destructing;
158  boost::signal<void (const DtSettingsBackup*)> signal_backupCleared;
159  boost::signal<void (const DtSettingsBackup*)> signal_backedUp;
160  boost::signal<void (const DtSettingsBackup*)> signal_restored;
161 
162  protected:
163 
165  virtual bool restore(bool fromFactory,
166  std::vector<DtSettingsBackup*>& hasBeenRestored, bool selectedOnly);
167 
168  protected:
169 
172  std::string myBackupFile;
173  std::string myFactoryFile;
174  std::string myBackupsPath;
175 
176  };
177 
178 }

Document ID: Generated on Tue Mar 8 22:13:38 EST 2016 from SVN revision 162938
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)