61 LimitedWarning(
int max_warn_in) : _max_warn(max_warn_in), _this_warning_summary(0) {}
63#ifdef FASTJET_HAVE_LIMITED_THREAD_SAFETY
66 : _max_warn(other._max_warn), _this_warning_summary{other._this_warning_summary.load()} {}
71 void warn(
const char * warning) {
warn(warning, _default_ostr);}
75 void warn(
const std::string & warning) {
warn(warning.c_str(), _default_ostr);}
78 void warn(
const char * warning, std::ostream * ostr);
81 void warn(
const std::string & warning, std::ostream * ostr) {
warn(warning.c_str(), ostr);}
89#ifdef FASTJET_HAVE_LIMITED_THREAD_SAFETY
94 static void set_default_stream_and_mutex(std::ostream * ostr,
95 std::mutex * warnings_mutex) {
97 _stream_mutex = warnings_mutex;
104 _max_warn_default = max_warn;
113 int n_warn_so_far()
const;
117 static std::string summary();
122 typedef std::pair<std::string, thread_safety_helpers::AtomicCounter<unsigned int> > Summary;
123#ifdef FASTJET_HAVE_LIMITED_THREAD_SAFETY
124 static std::atomic<int> _max_warn_default;
125 static std::atomic<std::ostream *> _default_ostr;
126 static std::atomic<std::mutex *> _stream_mutex;
127 static std::mutex _global_warnings_summary_mutex;
128 std::atomic<Summary*> _this_warning_summary;
130 static int _max_warn_default;
131 static std::ostream * _default_ostr;
132 Summary* _this_warning_summary;
138 static std::list< Summary > _global_warnings_summary;