15#ifndef dealii_enable_observer_pointer_h
16#define dealii_enable_observer_pointer_h
34template <
typename T,
typename P>
133 template <
typename StreamType>
157 <<
"Object of class " <<
arg2 <<
" is still used by " <<
arg1
160 <<
"(Additional information: " <<
arg3 <<
")\n\n"
161 <<
"See the entry in the Frequently Asked Questions of "
162 <<
"deal.II (linked to from http://www.dealii.org/) for "
163 <<
"a lot more information on what this error means and "
164 <<
"how to fix programs in which it happens.");
174 <<
"No subscriber with identifier <" <<
arg2
175 <<
"> subscribes to this object of class " <<
arg1
176 <<
". Consequently, it cannot be unsubscribed.");
192 template <
class Archive>
346template <
class Archive>
354template <
typename StreamType>
358 std::lock_guard<std::mutex> lock(
mutex);
361 stream <<
it.second <<
'/' <<
counter <<
" subscriptions from \""
362 <<
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)