summaryrefslogtreecommitdiff
path: root/cpp/include/Ice/UserExceptionFactory.h
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2014-06-16 16:56:03 +0000
committerBernard Normier <bernard@zeroc.com>2014-06-16 16:56:03 +0000
commitdfbaed856c3559145ff1ce20dfdcb4c6fc7069a9 (patch)
tree146c0a563e94c948e2c6aaab80b2684919dba8f3 /cpp/include/Ice/UserExceptionFactory.h
parentC# IceSSL fixes (diff)
downloadice-dfbaed856c3559145ff1ce20dfdcb4c6fc7069a9.tar.bz2
ice-dfbaed856c3559145ff1ce20dfdcb4c6fc7069a9.tar.xz
ice-dfbaed856c3559145ff1ce20dfdcb4c6fc7069a9.zip
Fix for ICE-5527 (simplify generated code for user exception and object factories), ICE-4832 (ice_staticId and static initialization) and partial fix for ICE-5515 (ice_staticId on C++ proxies)
Diffstat (limited to 'cpp/include/Ice/UserExceptionFactory.h')
-rw-r--r--cpp/include/Ice/UserExceptionFactory.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/cpp/include/Ice/UserExceptionFactory.h b/cpp/include/Ice/UserExceptionFactory.h
index 73a22301d66..2d4f1c8c397 100644
--- a/cpp/include/Ice/UserExceptionFactory.h
+++ b/cpp/include/Ice/UserExceptionFactory.h
@@ -27,6 +27,30 @@ public:
typedef ::IceUtil::Handle<UserExceptionFactory> UserExceptionFactoryPtr;
+template<class E>
+class DefaultUserExceptionFactory : public UserExceptionFactory
+{
+public:
+
+ DefaultUserExceptionFactory(const ::std::string& typeId) :
+ _typeId(typeId)
+ {
+ }
+
+#ifndef NDEBUG
+ virtual void createAndThrow(const ::std::string& typeId)
+#else
+ virtual void createAndThrow(const ::std::string&)
+#endif
+ {
+ assert(typeId == _typeId);
+ throw E();
+ }
+
+private:
+ const ::std::string _typeId;
+};
+
}
#endif