Arg & argument,
Args &... arguments);
+ /**
+ * Return a reference to the object with given name. If the object does
+ * not exist, then the input @p arguments will be used to construct an object
+ * of the given @p Type and a reference to this new object then be returned.
+ *
+ * Same as above for a single argument.
+ */
+ template <typename Type, typename Arg>
+ Type &
+ get_or_add_object_with_name(const std::string &name, Arg &argument);
+
/**
* Return a reference to the object with given name. If the object does
* not exist, then the input @p arguments will be used to construct an object
Arg && argument,
Args &&... arguments);
+ /**
+ * Return a reference to the object with given name. If the object does
+ * not exist, then the input @p arguments will be used to construct an object
+ * of the given @p Type and a reference to this new object then be returned.
+ *
+ * Same as above for a single argument.
+ */
+ template <typename Type, typename Arg>
+ Type &
+ get_or_add_object_with_name(const std::string &name, Arg &&argument);
+
/**
* Same as above for default constructors.
*/
}
+
+template <typename Type, typename Arg>
+Type &
+GeneralDataStorage::get_or_add_object_with_name(const std::string &name,
+ Arg & argument)
+{
+ if (!stores_object_with_name(name))
+ add_unique_copy(name, Type(argument));
+
+ return get_object_with_name<Type>(name);
+}
+
+
+
template <typename Type, typename Arg, typename... Args>
Type &
GeneralDataStorage::get_or_add_object_with_name(const std::string &name,
}
+
+template <typename Type, typename Arg>
+Type &
+GeneralDataStorage::get_or_add_object_with_name(const std::string &name,
+ Arg && argument)
+{
+ if (!stores_object_with_name(name))
+ add_unique_copy(name, Type(std::forward<Arg>(argument)));
+
+ return get_object_with_name<Type>(name);
+}
+
+
+
template <typename Type, typename Arg, typename... Args>
Type &
GeneralDataStorage::get_or_add_object_with_name(const std::string &name,
--- /dev/null
+
+DEAL::Add by copy
+DEAL::Size: 2
+DEAL::Add by reference
+DEAL::Size: 2
+DEAL::Add or construct
+DEAL::Size: 1
+DEAL::Merge
+DEAL::Data pre-merge:
+DEAL::value double
+DEAL::Size: 1
+DEAL::Data 2 pre-merge:
+DEAL::value double
+DEAL::value_2 double
+DEAL::Size: 2
+DEAL::Data post-merge:
+DEAL::value double
+DEAL::value_2 double
+DEAL::Size: 2
+DEAL::Ambiguous construction
+DEAL::Try to overwrite existing entry: Copy
+DEAL::
+--------------------------------------------------------
+An error occurred in file <general_data_storage.h> in function
+ void dealii::GeneralDataStorage::add_unique_copy(const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> &, const Type &) [with Type = double]
+The violated condition was:
+ !stores_object_with_name(name)
+Additional information:
+ An entry with the name value already exists.
+--------------------------------------------------------
+
+DEAL::Try to overwrite existing entry: Reference
+DEAL::
+--------------------------------------------------------
+An error occurred in file <general_data_storage.h> in function
+ void dealii::GeneralDataStorage::add_unique_reference(const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> &, Type &) [with Type = const double]
+The violated condition was:
+ !stores_object_with_name(name)
+Additional information:
+ An entry with the name value already exists.
+--------------------------------------------------------
+
+DEAL::Fetch non-existing entry
+DEAL::
+--------------------------------------------------------
+An error occurred in file <general_data_storage.h> in function
+ Type &dealii::GeneralDataStorage::get_object_with_name(const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> &) [with Type = double]
+The violated condition was:
+ stores_object_with_name(name)
+Additional information:
+ No entry with the name value exists.
+--------------------------------------------------------
+
+DEAL::Access removed entry (reference)
+DEAL::
+--------------------------------------------------------
+An error occurred in file <general_data_storage.h> in function
+ Type &dealii::GeneralDataStorage::get_object_with_name(const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> &) [with Type = double]
+The violated condition was:
+ stores_object_with_name(name)
+Additional information:
+ No entry with the name value exists.
+--------------------------------------------------------
+
+DEAL::Access removed entry (copy)
+DEAL::
+--------------------------------------------------------
+An error occurred in file <general_data_storage.h> in function
+ Type &dealii::GeneralDataStorage::get_object_with_name(const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> &) [with Type = double]
+The violated condition was:
+ stores_object_with_name(name)
+Additional information:
+ No entry with the name value exists.
+--------------------------------------------------------
+