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