Reference documentation for deal.II version 9.1.1
\(\newcommand{\dealcoloneq}{\mathrel{\vcenter{:}}=}\)
general_data_storage.cc
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2019 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 
17 #include <deal.II/algorithms/general_data_storage.h>
18 
19 
20 DEAL_II_NAMESPACE_OPEN
21 
22 
23 std::size_t
25 {
26  return any_data.size();
27 }
28 
29 
30 void
32 {
33  any_data.insert(other.any_data.begin(), other.any_data.end());
34 }
35 
36 
37 void
39 {
40  any_data.clear();
41 }
42 
43 
44 bool
45 GeneralDataStorage::stores_object_with_name(const std::string &name) const
46 {
47  return any_data.find(name) != any_data.end();
48 }
49 
50 
51 void
53 {
54  const auto it = any_data.find(name);
55  if (it != any_data.end())
56  any_data.erase(it);
57 }
58 
59 
60 
61 DEAL_II_NAMESPACE_CLOSE
std::size_t size() const
bool stores_object_with_name(const std::string &name) const
std::map< std::string, boost::any > any_data
void merge(const GeneralDataStorage &other_data)
void remove_object_with_name(const std::string &name)