16 #include <deal.II/base/logstream.h> 17 #include <deal.II/base/subscriptor.h> 18 #include <deal.II/base/thread_management.h> 25 DEAL_II_NAMESPACE_OPEN
28 static const char *unknown_subscriber =
"unknown subscriber";
36 , object_info(subscriptor.object_info)
38 for (
const auto validity_ptr : subscriptor.validity_pointers)
39 *validity_ptr =
false;
47 *validity_ptr =
false;
77 if (std::uncaught_exception() ==
false)
79 std::string infostring;
82 if (map_entry.second > 0)
83 infostring += std::string(
"\n from Subscriber ") +
84 std::string(map_entry.first);
87 if (infostring.empty())
88 infostring =
"<none>";
98 <<
"---------------------------------------------------------" 100 <<
"An object pointed to by a SmartPointer is being destroyed." 102 <<
"Under normal circumstances, this would abort the program." 104 <<
"However, another exception is being processed at the" 106 <<
"moment, so the program will continue to run to allow" 108 <<
"this exception to be processed." << std::endl
109 <<
"---------------------------------------------------------" 121 for (
const auto validity_ptr : s.validity_pointers)
122 *validity_ptr =
false;
131 const std::string &
id)
const 133 std::lock_guard<std::mutex> lock(
mutex);
139 const std::string &name =
id.empty() ? unknown_subscriber : id;
151 const std::string &
id)
const 153 const std::string &name =
id.empty() ? unknown_subscriber : id;
162 std::lock_guard<std::mutex> lock(
mutex);
179 auto validity_ptr_it =
186 "This Subscriptor object does not know anything about the supplied pointer!"));
203 DEAL_II_NAMESPACE_CLOSE
static ::ExceptionBase & ExcInUse(int arg1, std::string arg2, std::string arg3)
#define AssertNothrow(cond, exc)
std::vector< std::atomic< bool > * > validity_pointers
const std::type_info * object_info
Subscriptor & operator=(const Subscriptor &)
void unsubscribe(std::atomic< bool > *const validity, const std::string &identifier="") const
void list_subscribers() const
static ::ExceptionBase & ExcMessage(std::string arg1)
void subscribe(std::atomic< bool > *const validity, const std::string &identifier="") const
std::map< std::string, unsigned int > counter_map
decltype(counter_map)::iterator map_iterator
std::atomic< unsigned int > counter
static ::ExceptionBase & ExcNoSubscriber(std::string arg1, std::string arg2)
void check_no_subscribers() const noexcept