Reference documentation for deal.II version 8.4.2
swappable_vector.h
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2000 - 2015 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 
55 template <typename number>
56 class SwappableVector : public Vector<number>
57 {
58 public:
63  SwappableVector ();
64 
72 
77  virtual ~SwappableVector ();
78 
84 
96  void swap_out (const std::string &filename);
97 
107  void reload ();
108 
125  void alert ();
126 
127 
137  void kill_file ();
138 
144  const std::string &get_filename () const;
145 
150  std::size_t memory_consumption () const;
151 
159  DeclException0 (ExcSizeZero);
163  DeclException0 (ExcSizeNonzero);
167  DeclException1 (ExcInvalidFilename,
168  std::string,
169  << "The filename <" << arg1
170  << "> is not a valid one here.");
174  DeclException0 (ExcInvalidCopyOperation);
176 private:
182  std::string filename;
183 
193 
199 
209  void reload_vector (const bool set_flag);
210 };
211 
213 /*---------------------------- swappable_vector.h ---------------------------*/
214 /* end of #ifndef dealii__swappable_vector_h */
215 DEAL_II_NAMESPACE_CLOSE
216 
217 #endif
218 /*---------------------------- swappable_vector.h ---------------------------*/
const std::string & get_filename() const
std::size_t memory_consumption() const
Threads::Mutex lock
SwappableVector & operator=(const SwappableVector &)
DeclException0(ExcSizeZero)
DeclException1(ExcInvalidFilename, std::string,<< "The filename <"<< arg1<< "> is not a valid one here.")
void reload_vector(const bool set_flag)
std::string filename
virtual ~SwappableVector()
void swap_out(const std::string &filename)