Reference documentation for deal.II version 9.1.0-pre
swappable_vector.h
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2000 - 2017 by the deal.II authors
4 //
5 // This file is part of the deal.II library.
6 //
7 // The deal.II library is free software; you can use it, redistribute
8 // it, and/or modify it under the terms of the GNU Lesser General
9 // Public License as published by the Free Software Foundation; either
10 // version 2.1 of the License, or (at your option) any later version.
11 // The full text of the license can be found in the file LICENSE.md at
12 // the top level directory of deal.II.
13 //
14 // ---------------------------------------------------------------------
15 
16 #ifndef dealii_swappable_vector_h
17 # define dealii_swappable_vector_h
18 
19 
20 # include <deal.II/base/config.h>
21 
22 # include <deal.II/base/thread_management.h>
23 
24 # include <deal.II/lac/vector.h>
25 
26 # include <string>
27 
28 DEAL_II_NAMESPACE_OPEN
29 
60 template <typename number>
61 class DEAL_II_DEPRECATED SwappableVector : public Vector<number>
62 {
63 public:
69 
77 
82  virtual ~SwappableVector() override;
83 
89  operator=(const SwappableVector &);
90 
102  void
103  swap_out(const std::string &filename);
104 
114  void
115  reload();
116 
133  void
134  alert();
135 
136 
149  void
150  kill_file();
151 
157  const std::string &
158  get_filename() const;
159 
164  std::size_t
165  memory_consumption() const;
166 
174  DeclException0(ExcSizeZero);
178  DeclException0(ExcSizeNonzero);
182  DeclException1(ExcInvalidFilename,
183  std::string,
184  << "The filename <" << arg1 << "> is not a valid one here.");
188  DeclException0(ExcInvalidCopyOperation);
190 private:
196  std::string filename;
197 
207 
213 
223  void
224  reload_vector(const bool set_flag);
225 };
226 
228 DEAL_II_NAMESPACE_CLOSE
229 
230 #endif // dealii_swappable_vector_h
231 /*--------------------------- swappable_vector.h --------------------------*/
Threads::Mutex lock
#define DeclException1(Exception1, type1, outsequence)
Definition: exceptions.h:408
std::string filename
#define DeclException0(Exception0)
Definition: exceptions.h:385