xrootd
XrdMonException.hh
Go to the documentation of this file.
1 /*****************************************************************************/
2 /* */
3 /* XrdMonException.hh */
4 /* */
5 /* (c) 2005 by the Board of Trustees of the Leland Stanford, Jr., University */
6 /* All Rights Reserved */
7 /* Produced by Jacek Becla for Stanford University under contract */
8 /* DE-AC02-76SF00515 with the Department of Energy */
9 /*****************************************************************************/
10 
11 // $Id$
12 
13 #ifndef XRDMONEXCEPTION_HH
14 #define XRDMONEXCEPTION_HH
15 
16 #include "XrdMon/XrdMonTypes.hh"
17 #include <map>
18 #include <string>
19 #include <vector>
20 
21 using std::map;
22 using std::string;
23 using std::vector;
24 
25 
26 typedef int err_t;
27 
29 public:
32  const string& s);
34  const char* s);
35 
36  err_t err() const { return _err; }
37  const string msg() const { return _msg; }
38  void printIt() const;
39  void printItOnce() const;
40 
41 private:
42  struct ErrInfo {
43  vector<string> msgs;
44  int count;
45  };
46 
47  static map<err_t, ErrInfo> _oneTime;
48 
50  string _msg;
51 
52 };
53 
54 #endif /* XRDMONEXCEPTION_HH */