#include <LimitedWarning.hh>
Public Member Functions | |
| LimitedWarning () | |
| constructor that provides a default maximum number of warnings | |
| LimitedWarning (int max_warn) | |
| constructor that provides a used-set max number of warnings | |
| void | warn (const std::string &warning, std::ostream &ostr=std::cerr) |
| output a warning to ostr | |
Private Attributes | |
| int | _max_warn |
| int | _n_warn_so_far |
Static Private Attributes | |
| const int | _max_warn_default = 5 |
Definition at line 40 of file LimitedWarning.hh.
|
|
constructor that provides a default maximum number of warnings
Definition at line 44 of file LimitedWarning.hh. References _max_warn, _max_warn_default, and _n_warn_so_far.
00044 : _max_warn(_max_warn_default), _n_warn_so_far(0) {} |
|
|
constructor that provides a used-set max number of warnings
Definition at line 47 of file LimitedWarning.hh. References _max_warn, and _n_warn_so_far.
00047 : _max_warn(max_warn), _n_warn_so_far(0) {} |
|
||||||||||||
|
output a warning to ostr
Definition at line 50 of file LimitedWarning.hh. References _max_warn, and _n_warn_so_far. Referenced by fastjet::ClusterSequenceAreaBase::_check_jet_alg_good_for_median(), and fastjet::ClusterSequenceArea::_warn_if_range_unsuitable().
00050 {
00051 if (_n_warn_so_far < _max_warn) {
00052 ostr << "WARNING: ";
00053 ostr << warning;
00054 _n_warn_so_far++;
00055 if (_n_warn_so_far == _max_warn) ostr << " (LAST SUCH WARNING)";
00056 ostr << std::endl;
00057 }
00058 }
|
|
|
Definition at line 61 of file LimitedWarning.hh. Referenced by LimitedWarning(), and warn(). |
|
|
Definition at line 62 of file LimitedWarning.hh. Referenced by LimitedWarning(). |
|
|
Definition at line 61 of file LimitedWarning.hh. Referenced by LimitedWarning(), and warn(). |
1.3.4