LCIO  02.17
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
LCWarning.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 #ifndef UTIL_LCWARNING_H
3 #define UTIL_LCWARNING_H 1
4 
5 #include<map>
6 #include<string>
7 #include<iostream>
8 
9 namespace UTIL {
10 
20 class LCWarning {
21 public:
22 
23  static LCWarning& getInstance(); // singleton class
24 
31  void registerWarning( const std::string& id, const std::string& txt, int max=10 ) ;
32 
34  void printWarning( const std::string& id ) ;
35 
36 private:
37  // singleton settings
38  LCWarning( std::ostream& outstream=std::cerr );
39  ~LCWarning(); //{}
40  LCWarning( const LCWarning& ) ;
41  LCWarning & operator=(const LCWarning &);
42  static LCWarning& instance ;
43 
44 
46  std::string txt{};
47  int max{0};
48  int counter{0};
49  };
50 
53  std::ostream& _outstream ; // where warnings get printed
54 
55 }; // class
56 
57 } // namespace UTIL
58 #endif /* ifndef UTIL_LCWARNING_H */
std::ostream & _outstream
Definition: LCWarning.h:53
static LCWarning & instance
Definition: LCWarning.h:42
std::map< std::string, _warning_cfg_struct >::iterator _warning_cfg_it
Definition: LCWarning.h:52
std::map< std::string, _warning_cfg_struct > _warning_cfg
Definition: LCWarning.h:51
void printWarning(const std::string &id)
print the warning text associated to the given id
Definition: LCWarning.cc:117
STL class.
LCWarning & operator=(const LCWarning &)
void registerWarning(const std::string &id, const std::string &txt, int max=10)
register a new warning
Definition: LCWarning.cc:102
LCWarning(std::ostream &outstream=std::cerr)
Definition: LCWarning.cc:12
static LCWarning & getInstance()
Definition: LCWarning.cc:171
Utility class to show warnings in LCIO.
Definition: LCWarning.h:20
STL class.