Reference documentation for deal.II version 9.0.0
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 at
12 // the top level of the deal.II distribution.
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 #include <deal.II/base/thread_management.h>
22 #include <deal.II/lac/vector.h>
23 #include <string>
24 
25 DEAL_II_NAMESPACE_OPEN
26 
57 template <typename number>
58 class DEAL_II_DEPRECATED SwappableVector : public Vector<number>
59 {
60 public:
65  SwappableVector ();
66 
74 
79  virtual ~SwappableVector ();
80 
86 
98  void swap_out (const std::string &filename);
99 
109  void reload ();
110 
127  void alert ();
128 
129 
142  void kill_file ();
143 
149  const std::string &get_filename () const;
150 
155  std::size_t memory_consumption () const;
156 
164  DeclException0 (ExcSizeZero);
168  DeclException0 (ExcSizeNonzero);
172  DeclException1 (ExcInvalidFilename,
173  std::string,
174  << "The filename <" << arg1
175  << "> is not a valid one here.");
179  DeclException0 (ExcInvalidCopyOperation);
181 private:
187  std::string filename;
188 
198 
204 
214  void reload_vector (const bool set_flag);
215 };
216 
218 /*---------------------------- swappable_vector.h ---------------------------*/
219 /* end of #ifndef dealii_swappable_vector_h */
220 DEAL_II_NAMESPACE_CLOSE
221 
222 #endif
223 /*---------------------------- swappable_vector.h ---------------------------*/
std::size_t memory_consumption() const
Threads::Mutex lock
Vector< Number > & operator=(const Number s)
#define DeclException1(Exception1, type1, outsequence)
Definition: exceptions.h:346
std::string filename
#define DeclException0(Exception0)
Definition: exceptions.h:323