16 #ifndef dealii_subscriptor_h 17 #define dealii_subscriptor_h 118 subscribe(std::atomic<bool> *
const validity,
119 const std::string & identifier =
"")
const;
129 const std::string & identifier =
"")
const;
142 template <
typename StreamType>
166 <<
"Object of class " << arg2 <<
" is still used by " << arg1
169 <<
"(Additional information: " << arg3 <<
")\n\n" 170 <<
"See the entry in the Frequently Asked Questions of " 171 <<
"deal.II (linked to from http://www.dealii.org/) for " 172 <<
"a lot more information on what this error means and " 173 <<
"how to fix programs in which it happens.");
182 <<
"No subscriber with identifier <" << arg2
183 <<
"> subscribes to this object of class " << arg1
184 <<
". Consequently, it cannot be unsubscribed.");
200 template <
class Archive>
202 serialize(Archive &ar,
const unsigned int version);
279 , object_info(
nullptr)
286 , object_info(nullptr)
308 template <
class Archive>
316 template <
typename StreamType>
320 std::lock_guard<std::mutex> lock(
mutex);
322 for (
const auto &it : counter_map)
323 stream << it.second <<
'/' << counter <<
" subscriptions from \"" 324 << it.first <<
'\"' << std::endl;
static ::ExceptionBase & ExcInUse(int arg1, std::string arg2, std::string arg3)
#define DeclException2(Exception2, type1, type2, outsequence)
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
void subscribe(std::atomic< bool > *const validity, const std::string &identifier="") const
void serialize(Archive &ar, const unsigned int version)
decltype(counter_map)::value_type map_value_type
#define DEAL_II_NAMESPACE_CLOSE
std::map< std::string, unsigned int > counter_map
unsigned int n_subscriptions() const
decltype(counter_map)::iterator map_iterator
std::atomic< unsigned int > counter
#define DEAL_II_NAMESPACE_OPEN
#define DeclException3(Exception3, type1, type2, type3, outsequence)
static ::ExceptionBase & ExcNoSubscriber(std::string arg1, std::string arg2)
void check_no_subscribers() const noexcept