LCIO  "2.7.4"
 All Classes Namespaces Functions Variables Typedefs Friends Pages
LCWarning.h
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 
45  struct _warning_cfg_struct{
46  std::string txt;
47  int max;
48  int counter;
49  };
50 
51  std::map< std::string, _warning_cfg_struct > _warning_cfg ; // warning configurations
52  std::map< std::string, _warning_cfg_struct > :: iterator _warning_cfg_it ; // iterator
53  std::ostream& _outstream ; // where warnings get printed
54 
55 }; // class
56 
57 } // namespace UTIL
58 #endif /* ifndef UTIL_LCWARNING_H */
void printWarning(const std::string &id)
print the warning text associated to the given id
Definition: LCWarning.cc:117
void registerWarning(const std::string &id, const std::string &txt, int max=10)
register a new warning
Definition: LCWarning.cc:102
Utility class to show warnings in LCIO.
Definition: LCWarning.h:20