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_() {
46  }
47  }
48 
50  static errors::FilledMap fm;
51  setme = &fm.trans_;
52  }
53 
55 
57  extern void getCodeTable(CodeMap*&);
58  CodeMap* trans;
59  getCodeTable(trans);
60  CodeMap::const_iterator i(trans->find(c));
61  return i!=trans->end() ? i->second : std::string("UnknownCode");
62  }
63 
65  cms::Exception(codeToString(aCategory)),
66  category_(aCategory) {
67  }
68 
70  cms::Exception(codeToString(aCategory),message),
71  category_(aCategory) {
72  }
73 
75  cms::Exception(codeToString(aCategory), std::string(message)),
76  category_(aCategory) {
77  }
78 
80  cms::Exception(codeToString(aCategory),message,another),
81  category_(aCategory) {
82  }
83 
84  Exception::Exception(errors::ErrorCodes aCategory, char const* message, cms::Exception const& another):
85  cms::Exception(codeToString(aCategory), std::string(message), another),
86  category_(aCategory) {
87  }
88 
90  cms::Exception(other),
91  category_(other.category_) {
92  }
93 
95  }
96 
97  Exception&
99  Exception temp(other);
100  this->swap(temp);
101  return *this;
102  }
103 
104  int
106  return static_cast<int>(category_);
107  }
108 
109  void
111  char const* message0,
112  char const* message1,
113  char const* message2,
114  char const* message3,
115  char const* message4) {
116  Exception e(aCategory, std::string(message0));
117  e << message1 << message2 << message3 << message4;
118  throw e;
119  }
120 
121  void
122  Exception::throwThis(errors::ErrorCodes aCategory, char const* message0, int intVal, char const* message1) {
123  Exception e(aCategory, std::string(message0));
124  e << intVal << message1;
125  throw e;
126  }
127 
129  return new Exception(*this);
130  }
131 
132  void
134  throw *this;
135  }
136 }
int i
Definition: DBlmapReader.cc:9
void getCodeTable(Exception::CodeMap *&setme)
Definition: EDMException.cc:49
#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:92
virtual Exception * clone() const
static std::string codeToString(Code)
-----------— implementation details ---------------—
Definition: EDMException.cc:56
virtual int returnCode_() const
Exception(Code category)
Definition: EDMException.cc:64
std::map< Code, std::string > CodeMap
Definition: EDMException.h:102
Exception::CodeMap trans_
Definition: EDMException.cc:8
Exception & operator=(Exception const &other)
Definition: EDMException.cc:98
virtual void rethrow()
virtual ~Exception()
Definition: EDMException.cc:94