Reference documentation for deal.II version 8.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
swappable_vector.h
1 // ---------------------------------------------------------------------
2 // @f$Id: swappable_vector.h 30036 2013-07-18 16:55:32Z maier @f$
3 //
4 // Copyright (C) 2000 - 2013 by the deal.II authors
5 //
6 // This file is part of the deal.II library.
7 //
8 // The deal.II library is free software; you can use it, redistribute
9 // it, and/or modify it under the terms of the GNU Lesser General
10 // Public License as published by the Free Software Foundation; either
11 // version 2.1 of the License, or (at your option) any later version.
12 // The full text of the license can be found in the file LICENSE at
13 // the top level of the deal.II distribution.
14 //
15 // ---------------------------------------------------------------------
16 
17 #ifndef __deal2__swappable_vector_h
18 #define __deal2__swappable_vector_h
19 
20 
21 #include <deal.II/base/config.h>
22 #include <deal.II/base/thread_management.h>
23 #include <deal.II/lac/vector.h>
24 #include <string>
25 
26 DEAL_II_NAMESPACE_OPEN
27 
56 template <typename number>
57 class SwappableVector : public Vector<number>
58 {
59 public:
66  SwappableVector ();
67 
81 
88  virtual ~SwappableVector ();
89 
98 
121  void swap_out (const std::string &filename);
122 
139  void reload ();
140 
174  void alert ();
175 
176 
192  void kill_file ();
193 
204  const std::string &get_filename () const;
205 
211  std::size_t memory_consumption () const;
212 
218  DeclException0 (ExcSizeZero);
222  DeclException0 (ExcSizeNonzero);
226  DeclException1 (ExcInvalidFilename,
227  std::string,
228  << "The filename <" << arg1
229  << "> is not a valid one here.");
233  DeclException0 (ExcInvalidCopyOperation);
235 private:
246  std::string filename;
247 
262 
271 
289  void reload_vector (const bool set_flag);
290 };
291 
293 /*---------------------------- swappable_vector.h ---------------------------*/
294 /* end of #ifndef __deal2__swappable_vector_h */
295 DEAL_II_NAMESPACE_CLOSE
296 
297 #endif
298 /*---------------------------- swappable_vector.h ---------------------------*/
SwappableVector & operator=(const SwappableVector &)
Threads::Mutex lock
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
const std::string & get_filename() const
std::size_t memory_consumption() const
void swap_out(const std::string &filename)