test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EDMException.cc
Go to the documentation of this file.
1 
3 
4 namespace edm {
5  namespace errors {
6  struct FilledMap {
7  FilledMap();
9  };
10  FilledMap::FilledMap() : trans_() {
45  }
46  }
47 
49  static errors::FilledMap fm;
50  setme = &fm.trans_;
51  }
52 
54 
56  extern void getCodeTable(CodeMap*&);
57  CodeMap* trans;
58  getCodeTable(trans);
59  CodeMap::const_iterator i(trans->find(c));
60  return i!=trans->end() ? i->second : std::string("UnknownCode");
61  }
62 
64  cms::Exception(codeToString(aCategory)),
65  category_(aCategory) {
66  }
67 
69  cms::Exception(codeToString(aCategory),message),
70  category_(aCategory) {
71  }
72 
74  cms::Exception(codeToString(aCategory), std::string(message)),
75  category_(aCategory) {
76  }
77 
79  cms::Exception(codeToString(aCategory),message,another),
80  category_(aCategory) {
81  }
82 
83  Exception::Exception(errors::ErrorCodes aCategory, char const* message, cms::Exception const& another):
84  cms::Exception(codeToString(aCategory), std::string(message), another),
85  category_(aCategory) {
86  }
87 
89  cms::Exception(other),
90  category_(other.category_) {
91  }
92 
94  }
95 
96  Exception&
98  Exception temp(other);
99  this->swap(temp);
100  return *this;
101  }
102 
103  int
105  return static_cast<int>(category_);
106  }
107 
108  void
110  char const* message0,
111  char const* message1,
112  char const* message2,
113  char const* message3,
114  char const* message4) {
115  Exception e(aCategory, std::string(message0));
116  e << message1 << message2 << message3 << message4;
117  throw e;
118  }
119 
120  void
121  Exception::throwThis(errors::ErrorCodes aCategory, char const* message0, int intVal, char const* message1) {
122  Exception e(aCategory, std::string(message0));
123  e << intVal << message1;
124  throw e;
125  }
126 
128  return new Exception(*this);
129  }
130 
131  void
133  throw *this;
134  }
135 }
int i
Definition: DBlmapReader.cc:9
void getCodeTable(Exception::CodeMap *&setme)
Definition: EDMException.cc:48
#define EDM_MAP_ENTRY_NONS(map, name)
Definition: EDMException.h:16
static void throwThis(Code category, char const *message0="", char const *message1="", char const *message2="", char const *message3="", char const *message4="")
void swap(Exception &other)
Definition: EDMException.h:90
virtual Exception * clone() const
static std::string codeToString(Code)
-----------— implementation details ---------------—
Definition: EDMException.cc:55
virtual int returnCode_() const
Exception(Code category)
Definition: EDMException.cc:63
std::map< Code, std::string > CodeMap
Definition: EDMException.h:100
Exception::CodeMap trans_
Definition: EDMException.cc:8
Exception & operator=(Exception const &other)
Definition: EDMException.cc:97
virtual void rethrow()
virtual ~Exception()
Definition: EDMException.cc:93