15#ifndef dealii_enable_observer_pointer_h
16#define dealii_enable_observer_pointer_h
124 subscribe(std::atomic<bool> *
const validity,
125 const std::string &identifier =
"")
const;
135 const std::string &identifier =
"")
const;
148 template <
typename StreamType>
172 <<
"Object of class " << arg2 <<
" is still used by " << arg1
175 <<
"(Additional information: " << arg3 <<
")\n\n"
176 <<
"See the entry in the Frequently Asked Questions of "
177 <<
"deal.II (linked to from http://www.dealii.org/) for "
178 <<
"a lot more information on what this error means and "
179 <<
"how to fix programs in which it happens.");
189 <<
"No subscriber with identifier <" << arg2
190 <<
"> subscribes to this object of class " << arg1
191 <<
". Consequently, it cannot be unsubscribed.");
207 template <
class Archive>
209 serialize(Archive &ar,
const unsigned int version);
329template <
class Archive>
337template <
typename StreamType>
341 std::lock_guard<std::mutex> lock(
mutex);
344 stream << it.second <<
'/' <<
counter <<
" subscriptions from \""
345 << it.first <<
'\"' << std::endl;
virtual ~EnableObserverPointer()
void check_no_subscribers() const noexcept
void subscribe(std::atomic< bool > *const validity, const std::string &identifier="") const
decltype(counter_map)::iterator map_iterator
void serialize(Archive &ar, const unsigned int version)
EnableObserverPointer & operator=(const EnableObserverPointer &)
std::atomic< unsigned int > counter
void unsubscribe(std::atomic< bool > *const validity, const std::string &identifier="") const
void list_subscribers() const
std::map< std::string, unsigned int > counter_map
std::vector< std::atomic< bool > * > validity_pointers
decltype(counter_map)::value_type map_value_type
const std::type_info * object_info
unsigned int n_subscriptions() const
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
#define DeclException2(Exception2, type1, type2, outsequence)
static ::ExceptionBase & ExcNoSubscriber(std::string arg1, std::string arg2)
#define DeclException3(Exception3, type1, type2, type3, outsequence)
static ::ExceptionBase & ExcInUse(int arg1, std::string arg2, std::string arg3)