diff options
author | Bernard Normier <bernard@zeroc.com> | 2014-06-16 16:56:03 +0000 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2014-06-16 16:56:03 +0000 |
commit | dfbaed856c3559145ff1ce20dfdcb4c6fc7069a9 (patch) | |
tree | 146c0a563e94c948e2c6aaab80b2684919dba8f3 /cpp/include/Ice/UserExceptionFactory.h | |
parent | C# IceSSL fixes (diff) | |
download | ice-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.h | 24 |
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 |