diff options
author | Jose <jose@zeroc.com> | 2016-01-20 10:36:51 +0100 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2016-01-20 10:36:51 +0100 |
commit | 13f4fd6d3cc5a044db66d9c25319419bb4ede5fa (patch) | |
tree | c230ae28caba40ac1f939fbedb5fd780d49fad0c /cpp | |
parent | ICE-6861 - removing public stream API (diff) | |
download | ice-13f4fd6d3cc5a044db66d9c25319419bb4ede5fa.tar.bz2 ice-13f4fd6d3cc5a044db66d9c25319419bb4ede5fa.tar.xz ice-13f4fd6d3cc5a044db66d9c25319419bb4ede5fa.zip |
ice_name/ice_id fixes & simplifications.
Diffstat (limited to 'cpp')
32 files changed, 175 insertions, 285 deletions
diff --git a/cpp/include/Glacier2/Application.h b/cpp/include/Glacier2/Application.h index 36a4e2ca6da..0c0a1e29e3b 100644 --- a/cpp/include/Glacier2/Application.h +++ b/cpp/include/Glacier2/Application.h @@ -27,8 +27,10 @@ class GLACIER2_API RestartSessionException : public IceUtil::Exception { public: - virtual std::string ice_name() const; + virtual std::string ice_id() const; +#ifndef ICE_CPP11_MAPPING virtual RestartSessionException* ice_clone() const; +#endif virtual void ice_throw() const; }; diff --git a/cpp/include/Ice/Exception.h b/cpp/include/Ice/Exception.h index 349e9ef5d78..c4477bb8000 100644 --- a/cpp/include/Ice/Exception.h +++ b/cpp/include/Ice/Exception.h @@ -47,10 +47,7 @@ public: virtual ~LocalException() ICE_NOEXCEPT; virtual std::string ice_id() const = 0; -#ifndef ICE_CPP11_MAPPING - ICE_DEPRECATED_API("ice_name() is deprecated, use ice_id() instead.") - virtual std::string ice_name() const = 0; - +#ifndef ICE_CPP11_MAPPING virtual LocalException* ice_clone() const = 0; #endif virtual void ice_throw() const = 0; @@ -63,8 +60,6 @@ public: virtual std::string ice_id() const = 0; #ifndef ICE_CPP11_MAPPING - ICE_DEPRECATED_API("ice_name() is deprecated, use ice_id() instead.") - virtual std::string ice_name() const = 0; virtual UserException* ice_clone() const = 0; #endif virtual void ice_throw() const = 0; @@ -90,8 +85,6 @@ public: virtual ~SystemException() ICE_NOEXCEPT; virtual std::string ice_id() const = 0; #ifndef ICE_CPP11_MAPPING - ICE_DEPRECATED_API("ice_name() is deprecated.") - virtual std::string ice_name() const = 0; virtual SystemException* ice_clone() const = 0; #endif virtual void ice_throw() const = 0; diff --git a/cpp/include/IceSSL/Plugin.h b/cpp/include/IceSSL/Plugin.h index 79b27af95fc..c9333492534 100644 --- a/cpp/include/IceSSL/Plugin.h +++ b/cpp/include/IceSSL/Plugin.h @@ -105,9 +105,11 @@ class ICE_SSL_API CertificateReadException : public IceUtil::Exception public: CertificateReadException(const char*, int, const std::string&); - virtual ~CertificateReadException() throw(); - virtual std::string ice_name() const; + virtual ~CertificateReadException() ICE_NOEXCEPT; + virtual std::string ice_id() const; +#ifndef ICE_CPP11_MAPPING virtual CertificateReadException* ice_clone() const; +#endif virtual void ice_throw() const; std::string reason; @@ -128,9 +130,11 @@ public: #ifdef ICE_USE_SECURE_TRANSPORT CertificateEncodingException(const char*, int, CFErrorRef); #endif - virtual ~CertificateEncodingException() throw(); - virtual std::string ice_name() const; + virtual ~CertificateEncodingException() ICE_NOEXCEPT; + virtual std::string ice_id() const; +#ifndef ICE_CPP11_MAPPING virtual CertificateEncodingException* ice_clone() const; +#endif virtual void ice_throw() const; std::string reason; @@ -148,9 +152,11 @@ class ICE_SSL_API ParseException : public IceUtil::Exception public: ParseException(const char*, int, const std::string&); - virtual ~ParseException() throw(); - virtual std::string ice_name() const; + virtual ~ParseException() ICE_NOEXCEPT; + virtual std::string ice_id() const; +#ifndef ICE_CPP11_MAPPING virtual ParseException* ice_clone() const; +#endif virtual void ice_throw() const; std::string reason; diff --git a/cpp/include/IceUtil/CtrlCHandler.h b/cpp/include/IceUtil/CtrlCHandler.h index b44a0128f3f..492381fc4ef 100644 --- a/cpp/include/IceUtil/CtrlCHandler.h +++ b/cpp/include/IceUtil/CtrlCHandler.h @@ -60,8 +60,10 @@ class ICE_UTIL_API CtrlCHandlerException : public Exception public: CtrlCHandlerException(const char*, int); - virtual std::string ice_name() const; + virtual std::string ice_id() const; +#ifndef ICE_CPP11_MAPPING virtual CtrlCHandlerException* ice_clone() const; +#endif virtual void ice_throw() const; }; diff --git a/cpp/include/IceUtil/Exception.h b/cpp/include/IceUtil/Exception.h index 730c0958d9b..87dc6a0aa96 100644 --- a/cpp/include/IceUtil/Exception.h +++ b/cpp/include/IceUtil/Exception.h @@ -33,7 +33,7 @@ public: std::exception_ptr ice_clone() const; #else ICE_DEPRECATED_API("ice_name() is deprecated, use ice_id() instead.") - virtual std::string ice_name() const; + std::string ice_name() const; virtual Exception* ice_clone() const; #endif virtual void ice_throw() const; @@ -60,8 +60,6 @@ public: virtual ~NullHandleException() ICE_NOEXCEPT; virtual std::string ice_id() const; #ifndef ICE_CPP11_MAPPING - ICE_DEPRECATED_API("ice_name() is deprecated, use ice_id() instead.") - virtual std::string ice_name() const; virtual NullHandleException* ice_clone() const; #endif virtual void ice_throw() const; @@ -77,8 +75,6 @@ public: virtual std::string ice_id() const; virtual void ice_print(std::ostream&) const; #ifndef ICE_CPP11_MAPPING - ICE_DEPRECATED_API("ice_name() is deprecated, use ice_id() instead.") - virtual std::string ice_name() const; virtual IllegalArgumentException* ice_clone() const; #endif virtual void ice_throw() const; @@ -103,8 +99,6 @@ public: virtual std::string ice_id() const; virtual void ice_print(std::ostream&) const; #ifndef ICE_CPP11_MAPPING - ICE_DEPRECATED_API("ice_name() is deprecated, use ice_id() instead.") - virtual std::string ice_name() const; virtual IllegalConversionException* ice_clone() const; #endif virtual void ice_throw() const; @@ -124,8 +118,6 @@ public: virtual std::string ice_id() const; virtual void ice_print(std::ostream&) const; #ifndef ICE_CPP11_MAPPING - ICE_DEPRECATED_API("ice_name() is deprecated, use ice_id() instead.") - virtual std::string ice_name() const; virtual SyscallException* ice_clone() const; #endif virtual void ice_throw() const; @@ -146,8 +138,6 @@ public: virtual std::string ice_id() const; virtual void ice_print(std::ostream&) const; #ifndef ICE_CPP11_MAPPING - ICE_DEPRECATED_API("ice_name() is deprecated, use ice_id() instead.") - virtual std::string ice_name() const; virtual FileLockException* ice_clone() const; #endif virtual void ice_throw() const; @@ -169,8 +159,6 @@ public: virtual ~OptionalNotSetException() ICE_NOEXCEPT; virtual std::string ice_id() const; #ifndef ICE_CPP11_MAPPING - ICE_DEPRECATED_API("ice_name() is deprecated, use ice_id() instead.") - virtual std::string ice_name() const; virtual OptionalNotSetException* ice_clone() const; #endif virtual void ice_throw() const; @@ -186,8 +174,6 @@ public: virtual std::string ice_id() const; virtual void ice_print(std::ostream&) const; #ifndef ICE_CPP11_MAPPING - ICE_DEPRECATED_API("ice_name() is deprecated, use ice_id() instead.") - virtual std::string ice_name() const; virtual IconvInitializationException* ice_clone() const; #endif virtual void ice_throw() const; diff --git a/cpp/include/IceUtil/Options.h b/cpp/include/IceUtil/Options.h index f193fa47168..fa56497038f 100644 --- a/cpp/include/IceUtil/Options.h +++ b/cpp/include/IceUtil/Options.h @@ -27,17 +27,15 @@ class ICE_UTIL_API APIException : public IceUtil::Exception public: APIException(const char*, int, const ::std::string&); - virtual ~APIException() throw(); - virtual ::std::string ice_name() const; + virtual ~APIException() ICE_NOEXCEPT; + virtual ::std::string ice_id() const; virtual void ice_print(std::ostream&) const; +#ifndef ICE_CPP11_MAPPING virtual APIException* ice_clone() const; +#endif virtual void ice_throw() const; ::std::string reason; - -private: - - static const char* _name; }; ICE_UTIL_API ::std::ostream& operator<<(::std::ostream&, const APIException&); @@ -47,17 +45,15 @@ class ICE_UTIL_API BadOptException : public IceUtil::Exception public: BadOptException(const char*, int, const ::std::string&); - virtual ~BadOptException() throw(); - virtual ::std::string ice_name() const; + virtual ~BadOptException() ICE_NOEXCEPT; + virtual ::std::string ice_id() const; virtual void ice_print(std::ostream&) const; +#ifndef ICE_CPP11_MAPPING virtual BadOptException* ice_clone() const; +#endif virtual void ice_throw() const; ::std::string reason; - -private: - - static const char* _name; }; ICE_UTIL_API ::std::ostream& operator<<(::std::ostream&, const BadOptException&); diff --git a/cpp/include/IceUtil/ThreadException.h b/cpp/include/IceUtil/ThreadException.h index ebb827675c2..00af36c0b0d 100644 --- a/cpp/include/IceUtil/ThreadException.h +++ b/cpp/include/IceUtil/ThreadException.h @@ -21,13 +21,11 @@ class ICE_UTIL_API ThreadSyscallException : public SyscallException public: ThreadSyscallException(const char*, int, int); - virtual std::string ice_name() const; + virtual std::string ice_id() const; +#ifndef ICE_CPP11_MAPPING virtual ThreadSyscallException* ice_clone() const; +#endif virtual void ice_throw() const; - -private: - - static const char* _name; }; class ICE_UTIL_API ThreadLockedException : public Exception @@ -35,13 +33,11 @@ class ICE_UTIL_API ThreadLockedException : public Exception public: ThreadLockedException(const char*, int); - virtual std::string ice_name() const; + virtual std::string ice_id() const; +#ifndef ICE_CPP11_MAPPING virtual ThreadLockedException* ice_clone() const; +#endif virtual void ice_throw() const; - -private: - - static const char* _name; }; class ICE_UTIL_API ThreadStartedException : public Exception @@ -49,13 +45,11 @@ class ICE_UTIL_API ThreadStartedException : public Exception public: ThreadStartedException(const char*, int); - virtual std::string ice_name() const; + virtual std::string ice_id() const; +#ifndef ICE_CPP11_MAPPING virtual ThreadStartedException* ice_clone() const; +#endif virtual void ice_throw() const; - -private: - - static const char* _name; }; class ICE_UTIL_API ThreadNotStartedException : public Exception @@ -63,13 +57,11 @@ class ICE_UTIL_API ThreadNotStartedException : public Exception public: ThreadNotStartedException(const char*, int); - virtual std::string ice_name() const; + virtual std::string ice_id() const; +#ifndef ICE_CPP11_MAPPING virtual ThreadNotStartedException* ice_clone() const; +#endif virtual void ice_throw() const; - -private: - - static const char* _name; }; class ICE_UTIL_API BadThreadControlException : public Exception @@ -77,13 +69,11 @@ class ICE_UTIL_API BadThreadControlException : public Exception public: BadThreadControlException(const char*, int); - virtual std::string ice_name() const; + virtual std::string ice_id() const; +#ifndef ICE_CPP11_MAPPING virtual BadThreadControlException* ice_clone() const; +#endif virtual void ice_throw() const; - -private: - - static const char* _name; }; class ICE_UTIL_API InvalidTimeoutException : public Exception @@ -91,15 +81,16 @@ class ICE_UTIL_API InvalidTimeoutException : public Exception public: InvalidTimeoutException(const char*, int, const Time&); - virtual std::string ice_name() const; + virtual std::string ice_id() const; virtual void ice_print(std::ostream&) const; +#ifndef ICE_CPP11_MAPPING virtual InvalidTimeoutException* ice_clone() const; +#endif virtual void ice_throw() const; private: - + Time _timeout; - static const char* _name; }; } diff --git a/cpp/include/IceXML/Parser.h b/cpp/include/IceXML/Parser.h index b68bd9ed918..0be03456614 100644 --- a/cpp/include/IceXML/Parser.h +++ b/cpp/include/IceXML/Parser.h @@ -54,11 +54,13 @@ public: ParserException(const std::string&); ParserException(const char*, int, const std::string&); - virtual ~ParserException() throw(); + virtual ~ParserException() ICE_NOEXCEPT; - virtual std::string ice_name() const; + virtual std::string ice_id() const; virtual void ice_print(std::ostream&) const; +#ifndef ICE_CPP11_MAPPING virtual ParserException* ice_clone() const; +#endif virtual void ice_throw() const; std::string reason() const; diff --git a/cpp/include/Slice/FileTracker.h b/cpp/include/Slice/FileTracker.h index 07ed0b71ce7..b84bd766ae7 100644 --- a/cpp/include/Slice/FileTracker.h +++ b/cpp/include/Slice/FileTracker.h @@ -21,10 +21,12 @@ class SLICE_API FileException : public ::IceUtil::Exception public: FileException(const char*, int, const std::string&); - ~FileException() throw(); - virtual std::string ice_name() const; + ~FileException() ICE_NOEXCEPT; + virtual std::string ice_id() const; virtual void ice_print(std::ostream&) const; +#ifndef ICE_CPP11_MAPPING virtual FileException* ice_clone() const; +#endif virtual void ice_throw() const; std::string reason() const; diff --git a/cpp/src/Glacier2Lib/Application.cpp b/cpp/src/Glacier2Lib/Application.cpp index b8edf35c07c..85b092978cf 100644 --- a/cpp/src/Glacier2Lib/Application.cpp +++ b/cpp/src/Glacier2Lib/Application.cpp @@ -45,16 +45,18 @@ private: } string -Glacier2::RestartSessionException::ice_name() const +Glacier2::RestartSessionException::ice_id() const { - return "RestartSessionException"; + return "::Glacier2::RestartSessionException"; } +#ifndef ICE_CPP11_MAPPING Glacier2::RestartSessionException* Glacier2::RestartSessionException::ice_clone() const { return new RestartSessionException(*this); } +#endif void Glacier2::RestartSessionException::ice_throw() const diff --git a/cpp/src/Ice/Exception.cpp b/cpp/src/Ice/Exception.cpp index 8377c6c2230..7114d693664 100644 --- a/cpp/src/Ice/Exception.cpp +++ b/cpp/src/Ice/Exception.cpp @@ -129,7 +129,7 @@ Ice::LocalException::LocalException(const char* file, int line) : { } -Ice::LocalException::~LocalException() throw() +Ice::LocalException::~LocalException() ICE_NOEXCEPT { } @@ -138,7 +138,7 @@ Ice::SystemException::SystemException(const char* file, int line) : { } -Ice::SystemException::~SystemException() throw() +Ice::SystemException::~SystemException() ICE_NOEXCEPT { } diff --git a/cpp/src/IceDB/IceDB.cpp b/cpp/src/IceDB/IceDB.cpp index a679baa8819..48891521f5e 100644 --- a/cpp/src/IceDB/IceDB.cpp +++ b/cpp/src/IceDB/IceDB.cpp @@ -15,22 +15,20 @@ using namespace IceDB; using namespace std; -const char* IceDB::LMDBException::_name = "IceDB::LMDBException"; - LMDBException::LMDBException(const char* file, int line, int err) : IceUtil::Exception(file, line), _error(err) { } -LMDBException::~LMDBException() throw() +LMDBException::~LMDBException() ICE_NOEXCEPT { } string -LMDBException::ice_name() const +LMDBException::ice_id() const { - return _name; + return "::IceDB::LMDBException"; } void @@ -40,11 +38,13 @@ LMDBException::ice_print(ostream& out) const out << ": " << mdb_strerror(_error); } +#ifndef ICE_CPP11_MAPPING LMDBException* LMDBException::ice_clone() const { return new LMDBException(*this); } +#endif void LMDBException::ice_throw() const @@ -58,22 +58,20 @@ LMDBException::error() const return _error; } -const char* IceDB::KeyTooLongException::_name = "IceDB::KeyTooLongException"; - KeyTooLongException::KeyTooLongException(const char* file, int line, size_t size) : IceUtil::Exception(file, line), _size(size) { } -KeyTooLongException::~KeyTooLongException() throw() +KeyTooLongException::~KeyTooLongException() ICE_NOEXCEPT { } string -KeyTooLongException::ice_name() const +KeyTooLongException::ice_id() const { - return _name; + return "::IceDB::KeyTooLongException"; } void @@ -88,11 +86,13 @@ KeyTooLongException::ice_print(ostream& out) const out << "Max size = " << maxKeySize; } +#ifndef ICE_CPP11_MAPPING KeyTooLongException* KeyTooLongException::ice_clone() const { return new KeyTooLongException(*this); } +#endif void KeyTooLongException::ice_throw() const @@ -100,22 +100,20 @@ KeyTooLongException::ice_throw() const throw *this; } -const char* IceDB::BadEnvException::_name = "IceDB::BadEnvException"; - BadEnvException::BadEnvException(const char* file, int line, size_t size) : IceUtil::Exception(file, line), _size(size) { } -BadEnvException::~BadEnvException() throw() +BadEnvException::~BadEnvException() ICE_NOEXCEPT { } string -BadEnvException::ice_name() const +BadEnvException::ice_id() const { - return _name; + return "::IceDB::BadEnvException"; } void @@ -126,11 +124,13 @@ BadEnvException::ice_print(ostream& out) const out << ", IceDB max key size = " << maxKeySize; } +#ifndef ICE_CPP11_MAPPING BadEnvException* BadEnvException::ice_clone() const { return new BadEnvException(*this); } +#endif void BadEnvException::ice_throw() const diff --git a/cpp/src/IceDB/IceDB.h b/cpp/src/IceDB/IceDB.h index 56a36f9249d..16a60a4afee 100644 --- a/cpp/src/IceDB/IceDB.h +++ b/cpp/src/IceDB/IceDB.h @@ -58,11 +58,13 @@ class ICE_DB_API LMDBException : public IceUtil::Exception public: LMDBException(const char*, int, int); - virtual ~LMDBException() throw(); + virtual ~LMDBException() ICE_NOEXCEPT; - virtual std::string ice_name() const; + virtual std::string ice_id() const; virtual void ice_print(std::ostream&) const; +#ifndef ICE_CPP11_MAPPING virtual LMDBException* ice_clone() const; +#endif virtual void ice_throw() const; int error() const; @@ -82,11 +84,13 @@ class ICE_DB_API KeyTooLongException : public IceUtil::Exception public: KeyTooLongException(const char*, int, size_t); - virtual ~KeyTooLongException() throw(); + virtual ~KeyTooLongException() ICE_NOEXCEPT; - virtual std::string ice_name() const; + virtual std::string ice_id() const; virtual void ice_print(std::ostream&) const; +#ifndef ICE_CPP11_MAPPING virtual KeyTooLongException* ice_clone() const; +#endif virtual void ice_throw() const; private: @@ -104,11 +108,13 @@ class ICE_DB_API BadEnvException : public IceUtil::Exception public: BadEnvException(const char*, int, size_t); - virtual ~BadEnvException() throw(); + virtual ~BadEnvException() ICE_NOEXCEPT; - virtual std::string ice_name() const; + virtual std::string ice_id() const; virtual void ice_print(std::ostream&) const; +#ifndef ICE_CPP11_MAPPING virtual BadEnvException* ice_clone() const; +#endif virtual void ice_throw() const; private: diff --git a/cpp/src/IceSSL/Certificate.cpp b/cpp/src/IceSSL/Certificate.cpp index ee814eb420f..6ddde411ddb 100644 --- a/cpp/src/IceSSL/Certificate.cpp +++ b/cpp/src/IceSSL/Certificate.cpp @@ -47,8 +47,6 @@ using namespace std; using namespace Ice; using namespace IceSSL; -const char* IceSSL::CertificateReadException::_name = "IceSSL::CertificateReadException"; - #if defined(ICE_USE_SECURE_TRANSPORT) || defined(ICE_USE_SCHANNEL) // // Map a certificate OID to its alias @@ -429,21 +427,23 @@ CertificateReadException::CertificateReadException(const char* file, int line, c { } -CertificateReadException::~CertificateReadException() throw() +CertificateReadException::~CertificateReadException() ICE_NOEXCEPT { } string -CertificateReadException::ice_name() const +CertificateReadException::ice_id() const { - return _name; + return "::IceSSL::CertificateReadException"; } +#ifndef ICE_CPP11_MAPPING CertificateReadException* CertificateReadException::ice_clone() const { return new CertificateReadException(*this); } +#endif void CertificateReadException::ice_throw() const @@ -451,8 +451,6 @@ CertificateReadException::ice_throw() const throw *this; } -const char* IceSSL::CertificateEncodingException::_name = "IceSSL::CertificateEncodingException"; - #ifdef ICE_USE_SECURE_TRANSPORT CertificateEncodingException::CertificateEncodingException(const char* file, int line, CFErrorRef err) : Exception(file, line) @@ -469,21 +467,23 @@ CertificateEncodingException::CertificateEncodingException(const char* file, int { } -CertificateEncodingException::~CertificateEncodingException() throw() +CertificateEncodingException::~CertificateEncodingException() ICE_NOEXCEPT { } string -CertificateEncodingException::ice_name() const +CertificateEncodingException::ice_id() const { - return _name; + return "::IceSSL::CertificateEncodingException"; } +#ifndef ICE_CPP11_MAPPING CertificateEncodingException* CertificateEncodingException::ice_clone() const { return new CertificateEncodingException(*this); } +#endif void CertificateEncodingException::ice_throw() const @@ -663,29 +663,29 @@ convertGeneralNames(GENERAL_NAMES* gens) } #endif -const char* ParseException::_name = "IceSSL::ParseException"; - ParseException::ParseException(const char* file, int line, const string& r) : Exception(file, line), reason(r) { } -ParseException::~ParseException() throw() +ParseException::~ParseException() ICE_NOEXCEPT { } string -ParseException::ice_name() const +ParseException::ice_id() const { - return _name; + return "::IceSSL::ParseException"; } +#ifndef ICE_CPP11_MAPPING ParseException* ParseException::ice_clone() const { return new ParseException(*this); } +#endif void ParseException::ice_throw() const diff --git a/cpp/src/IceStorm/Parser.cpp b/cpp/src/IceStorm/Parser.cpp index ce7b7bf95bc..8957864f8dc 100644 --- a/cpp/src/IceStorm/Parser.cpp +++ b/cpp/src/IceStorm/Parser.cpp @@ -46,13 +46,14 @@ public: } virtual - ~UnknownManagerException() throw() + ~UnknownManagerException() ICE_NOEXCEPT { } + virtual string - ice_name() const + ice_id() const { - return "UnknownManagerException"; + return "::UnknownManagerException"; } virtual Exception* @@ -334,7 +335,7 @@ Parser::replica(const list<string>& args) } catch(const Exception& ex) { - cout << p->id << ": " << ex.ice_name() << endl; + cout << p->id << ": " << ex.ice_id() << endl; } } } diff --git a/cpp/src/IceUtil/CtrlCHandler.cpp b/cpp/src/IceUtil/CtrlCHandler.cpp index f21281f8a0d..3e0633172d6 100644 --- a/cpp/src/IceUtil/CtrlCHandler.cpp +++ b/cpp/src/IceUtil/CtrlCHandler.cpp @@ -55,24 +55,19 @@ CtrlCHandlerException::CtrlCHandlerException(const char* file, int line) : { } -namespace -{ - -const char* ctrlCHandlerName = "IceUtil::CtrlCHandlerException"; - -} - string -CtrlCHandlerException::ice_name() const +CtrlCHandlerException::ice_id() const { - return ctrlCHandlerName; + return "::IceUtil::CtrlCHandlerException"; } +#ifndef ICE_CPP11_MAPPING CtrlCHandlerException* CtrlCHandlerException::ice_clone() const { return new CtrlCHandlerException(*this); } +#endif void CtrlCHandlerException::ice_throw() const diff --git a/cpp/src/IceUtil/Exception.cpp b/cpp/src/IceUtil/Exception.cpp index eab14ddffa1..46a6de3749e 100644 --- a/cpp/src/IceUtil/Exception.cpp +++ b/cpp/src/IceUtil/Exception.cpp @@ -468,7 +468,7 @@ IceUtil::Exception::ice_clone() const string IceUtil::Exception::ice_name() const { - return "IceUtil::Exception"; + return ice_id().substr(2); } IceUtil::Exception* @@ -529,12 +529,6 @@ IceUtil::NullHandleException::ice_id() const } #ifndef ICE_CPP11_MAPPING -string -IceUtil::NullHandleException::ice_name() const -{ - return "IceUtil::NullHandleException"; -} - IceUtil::NullHandleException* IceUtil::NullHandleException::ice_clone() const { @@ -577,12 +571,6 @@ IceUtil::IllegalArgumentException::ice_id() const } #ifndef ICE_CPP11_MAPPING -string -IceUtil::IllegalArgumentException::ice_name() const -{ - return "IceUtil::IllegalArgumentException"; -} - IceUtil::IllegalArgumentException* IceUtil::IllegalArgumentException::ice_clone() const { @@ -633,12 +621,6 @@ IceUtil::IllegalConversionException::ice_id() const } #ifndef ICE_CPP11_MAPPING -string -IceUtil::IllegalConversionException::ice_name() const -{ - return "IceUtil::IllegalConversionException"; -} - IceUtil::IllegalConversionException* IceUtil::IllegalConversionException::ice_clone() const { @@ -683,13 +665,6 @@ IceUtil::SyscallException::ice_id() const } #ifndef ICE_CPP11_MAPPING - -string -IceUtil::SyscallException::ice_name() const -{ - return "IceUtil::SyscallException"; -} - IceUtil::SyscallException* IceUtil::SyscallException::ice_clone() const { @@ -739,12 +714,6 @@ IceUtil::FileLockException::ice_id() const } #ifndef ICE_CPP11_MAPPING -string -IceUtil::FileLockException::ice_name() const -{ - return "IceUtil::FileLockException"; -} - IceUtil::FileLockException* IceUtil::FileLockException::ice_clone() const { @@ -784,12 +753,6 @@ IceUtil::OptionalNotSetException::ice_id() const } #ifndef ICE_CPP11_MAPPING -string -IceUtil::OptionalNotSetException::ice_name() const -{ - return "IceUtil::OptionalNotSetException"; -} - IceUtil::OptionalNotSetException* IceUtil::OptionalNotSetException::ice_clone() const { @@ -828,12 +791,6 @@ IceUtil::IconvInitializationException::ice_id() const } #ifndef ICE_CPP11_MAPPING -string -IceUtil::IconvInitializationException::ice_name() const -{ - return "IceUtil::IconvInitializationException"; -} - IceUtil::IconvInitializationException* IceUtil::IconvInitializationException::ice_clone() const { diff --git a/cpp/src/IceUtil/Options.cpp b/cpp/src/IceUtil/Options.cpp index a2201deed1f..309a5303a64 100644 --- a/cpp/src/IceUtil/Options.cpp +++ b/cpp/src/IceUtil/Options.cpp @@ -20,16 +20,14 @@ IceUtilInternal::APIException::APIException(const char* file, int line, const st { } -IceUtilInternal::APIException::~APIException() throw() +IceUtilInternal::APIException::~APIException() ICE_NOEXCEPT { } -const char* IceUtilInternal::APIException::_name = "IceUtilInternal::APIException"; - string -IceUtilInternal::APIException::ice_name() const +IceUtilInternal::APIException::ice_id() const { - return _name; + return "::IceUtilInternal::APIException"; } void @@ -42,11 +40,13 @@ IceUtilInternal::APIException::ice_print(ostream& out) const } } +#ifndef ICE_CPP11_MAPPING IceUtilInternal::APIException* IceUtilInternal::APIException::ice_clone() const { return new APIException(*this); } +#endif void IceUtilInternal::APIException::ice_throw() const @@ -66,16 +66,14 @@ IceUtilInternal::BadOptException::BadOptException(const char* file, int line, co { } -IceUtilInternal::BadOptException::~BadOptException() throw() +IceUtilInternal::BadOptException::~BadOptException() ICE_NOEXCEPT { } -const char* IceUtilInternal::BadOptException::_name = "IceUtilInternal::BadOptException"; - string -IceUtilInternal::BadOptException::ice_name() const +IceUtilInternal::BadOptException::ice_id() const { - return _name; + return "::IceUtilInternal::BadOptException"; } void @@ -88,11 +86,13 @@ IceUtilInternal::BadOptException::ice_print(ostream& out) const } } +#ifndef ICE_CPP11_MAPPING IceUtilInternal::BadOptException* IceUtilInternal::BadOptException::ice_clone() const { return new BadOptException(*this); } +#endif void IceUtilInternal::BadOptException::ice_throw() const diff --git a/cpp/src/IceUtil/ThreadException.cpp b/cpp/src/IceUtil/ThreadException.cpp index 4ab221e8a03..8b1e1a450a2 100644 --- a/cpp/src/IceUtil/ThreadException.cpp +++ b/cpp/src/IceUtil/ThreadException.cpp @@ -15,20 +15,20 @@ IceUtil::ThreadSyscallException::ThreadSyscallException(const char* file, int li SyscallException(file, line, err) { } - -const char* IceUtil::ThreadSyscallException::_name = "IceUtil::ThreadSyscallException"; string -IceUtil::ThreadSyscallException::ice_name() const +IceUtil::ThreadSyscallException::ice_id() const { - return _name; + return "::IceUtil::ThreadSyscallException"; } +#ifndef ICE_CPP11_MAPPING IceUtil::ThreadSyscallException* IceUtil::ThreadSyscallException::ice_clone() const { return new ThreadSyscallException(*this); } +#endif void IceUtil::ThreadSyscallException::ice_throw() const @@ -41,19 +41,19 @@ IceUtil::ThreadLockedException::ThreadLockedException(const char* file, int line { } -const char* IceUtil::ThreadLockedException::_name = "IceUtil::ThreadLockedException"; - string -IceUtil::ThreadLockedException::ice_name() const +IceUtil::ThreadLockedException::ice_id() const { - return _name; + return "::IceUtil::ThreadLockedException"; } +#ifndef ICE_CPP11_MAPPING IceUtil::ThreadLockedException* IceUtil::ThreadLockedException::ice_clone() const { return new ThreadLockedException(*this); } +#endif void IceUtil::ThreadLockedException::ice_throw() const @@ -66,19 +66,19 @@ IceUtil::ThreadStartedException::ThreadStartedException(const char* file, int li { } -const char* IceUtil::ThreadStartedException::_name = "IceUtil::ThreadStartedException"; - string -IceUtil::ThreadStartedException::ice_name() const +IceUtil::ThreadStartedException::ice_id() const { - return _name; + return "::IceUtil::ThreadStartedException"; } +#ifndef ICE_CPP11_MAPPING IceUtil::ThreadStartedException* IceUtil::ThreadStartedException::ice_clone() const { return new ThreadStartedException(*this); } +#endif void IceUtil::ThreadStartedException::ice_throw() const @@ -91,19 +91,19 @@ IceUtil::ThreadNotStartedException::ThreadNotStartedException(const char* file, { } -const char* IceUtil::ThreadNotStartedException::_name = "IceUtil::ThreadNotStartedException"; - string -IceUtil::ThreadNotStartedException::ice_name() const +IceUtil::ThreadNotStartedException::ice_id() const { - return _name; + return "::IceUtil::ThreadNotStartedException"; } +#ifndef ICE_CPP11_MAPPING IceUtil::ThreadNotStartedException* IceUtil::ThreadNotStartedException::ice_clone() const { return new ThreadNotStartedException(*this); } +#endif void IceUtil::ThreadNotStartedException::ice_throw() const @@ -117,19 +117,19 @@ IceUtil::BadThreadControlException::BadThreadControlException(const char* file, { } -const char* IceUtil::BadThreadControlException::_name = "IceUtil::BadThreadControlException"; - string -IceUtil::BadThreadControlException::ice_name() const +IceUtil::BadThreadControlException::ice_id() const { - return _name; + return "::IceUtil::BadThreadControlException"; } +#ifndef ICE_CPP11_MAPPING IceUtil::BadThreadControlException* IceUtil::BadThreadControlException::ice_clone() const { return new BadThreadControlException(*this); } +#endif void IceUtil::BadThreadControlException::ice_throw() const @@ -143,13 +143,11 @@ IceUtil::InvalidTimeoutException::InvalidTimeoutException(const char* file, int _timeout(timeout) { } - -const char* IceUtil::InvalidTimeoutException::_name = "IceUtil::InvalidTimeoutException"; string -IceUtil::InvalidTimeoutException::ice_name() const +IceUtil::InvalidTimeoutException::ice_id() const { - return _name; + return "::IceUtil::InvalidTimeoutException"; } void @@ -159,11 +157,13 @@ IceUtil::InvalidTimeoutException::ice_print(ostream& os) const os << ":\ninvalid timeout: " << _timeout << " seconds"; } +#ifndef ICE_CPP11_MAPPING IceUtil::InvalidTimeoutException* IceUtil::InvalidTimeoutException::ice_clone() const { return new InvalidTimeoutException(*this); } +#endif void IceUtil::InvalidTimeoutException::ice_throw() const diff --git a/cpp/src/IceXML/Parser.cpp b/cpp/src/IceXML/Parser.cpp index 9a32636b47e..cdcf553a8c5 100644 --- a/cpp/src/IceXML/Parser.cpp +++ b/cpp/src/IceXML/Parser.cpp @@ -28,16 +28,14 @@ IceXML::ParserException::ParserException(const char* file, int line, const strin { } -IceXML::ParserException::~ParserException() throw() +IceXML::ParserException::~ParserException() ICE_NOEXCEPT { } -const char* IceXML::ParserException::_name = "IceXML::ParserException"; - string -IceXML::ParserException::ice_name() const +IceXML::ParserException::ice_id() const { - return _name; + return "::IceXML::ParserException"; } void @@ -54,11 +52,13 @@ IceXML::ParserException::ice_print(std::ostream& out) const } } +#ifndef ICE_CPP11_MAPPING IceXML::ParserException* IceXML::ParserException::ice_clone() const { return new ParserException(*this); } +#endif void IceXML::ParserException::ice_throw() const diff --git a/cpp/src/Slice/FileTracker.cpp b/cpp/src/Slice/FileTracker.cpp index fcf5060af5b..9b9149970e4 100644 --- a/cpp/src/Slice/FileTracker.cpp +++ b/cpp/src/Slice/FileTracker.cpp @@ -23,16 +23,14 @@ Slice::FileException::FileException(const char* file, int line, const string& r) { } -Slice::FileException::~FileException() throw() +Slice::FileException::~FileException() ICE_NOEXCEPT { } -const char* Slice::FileException::_name = "Slice::FileException"; - string -Slice::FileException::ice_name() const +Slice::FileException::ice_id() const { - return _name; + return "::Slice::FileException"; } void @@ -42,11 +40,13 @@ Slice::FileException::ice_print(ostream& out) const out << ": " << _reason; } +#ifndef ICE_CPP11_MAPPING Slice::FileException* Slice::FileException::ice_clone() const { return new FileException(*this); } +#endif void Slice::FileException::ice_throw() const diff --git a/cpp/src/Slice/PythonUtil.cpp b/cpp/src/Slice/PythonUtil.cpp index f5aa79cd100..f28a565a53c 100644 --- a/cpp/src/Slice/PythonUtil.cpp +++ b/cpp/src/Slice/PythonUtil.cpp @@ -1084,11 +1084,6 @@ Slice::Python::CodeVisitor::visitExceptionStart(const ExceptionPtr& p) _out << nl << "return IcePy.stringifyException(self)"; _out.dec(); _out << sp << nl << "__repr__ = __str__"; - - // - // _ice_name - // - _out << sp << nl << "_ice_name = '" << scoped.substr(2) << "'"; // // _ice_id diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp index bdc5e986be7..c496fec26e4 100644 --- a/cpp/src/slice2cpp/Gen.cpp +++ b/cpp/src/slice2cpp/Gen.cpp @@ -982,13 +982,6 @@ Slice::Gen::TypesVisitor::visitExceptionStart(const ExceptionPtr& p) C << scoped.substr(2) << "::~" << name << "() throw()"; C << sb; C << eb; - - H << nl << "ICE_DEPRECATED_API(\"ice_name() is deprecated, use ice_id() instead.\")"; - H << nl << "virtual ::std::string ice_name() const;"; - C << sp << nl << "::std::string" << nl << scoped.substr(2) << "::ice_name() const"; - C << sb; - C << nl << "return \"" << p->scoped().substr(2) << "\";"; - C << eb; H << nl << "virtual ::std::string ice_id() const;"; C << sp << nl << "::std::string" << nl << scoped.substr(2) << "::ice_id() const"; diff --git a/cpp/src/slice2cs/Gen.cpp b/cpp/src/slice2cs/Gen.cpp index 7c00c5afff0..cc588231114 100644 --- a/cpp/src/slice2cs/Gen.cpp +++ b/cpp/src/slice2cs/Gen.cpp @@ -3708,14 +3708,7 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) _out << sp << nl << "#endregion"; // Constructors - _out << sp; - emitGeneratedCodeAttribute(); - _out << nl << "[_System.Obsolete(\"ice_name() is deprecated, use ice_id() instead.\")]"; - _out << nl << "public override string ice_name()"; - _out << sb; - _out << nl << "return \"" << p->scoped().substr(2) << "\";"; - _out << eb; - + _out << sp; emitGeneratedCodeAttribute(); _out << nl << "public override string ice_id()"; _out << sb; diff --git a/cpp/src/slice2java/Gen.cpp b/cpp/src/slice2java/Gen.cpp index e9da95c087c..8df6121d117 100644 --- a/cpp/src/slice2java/Gen.cpp +++ b/cpp/src/slice2java/Gen.cpp @@ -3653,16 +3653,6 @@ Slice::Gen::TypesVisitor::visitExceptionStart(const ExceptionPtr& p) } } - out << sp; - out << nl << "/**"; - out << nl << " * @deprecated ice_name() is deprecated, use ice_id() instead."; - out << nl << " **/"; - out << nl << "@Deprecated"; - out << nl << "public String" << nl << "ice_name()"; - out << sb; - out << nl << "return \"" << scoped.substr(2) << "\";"; - out << eb; - out << sp << nl << "public String" << nl << "ice_id()"; out << sb; out << nl << "return \"" << scoped << "\";"; diff --git a/cpp/src/slice2objc/Gen.cpp b/cpp/src/slice2objc/Gen.cpp index 6455d87a4ce..361a8924b46 100644 --- a/cpp/src/slice2objc/Gen.cpp +++ b/cpp/src/slice2objc/Gen.cpp @@ -1283,15 +1283,6 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) } // - // ice_name - // - _H << nl << "-(NSString *) ice_name;"; - _M << sp << nl << "-(NSString *) ice_name"; - _M << sb; - _M << nl << "return @\"" << p->scoped().substr(2) << "\";"; - _M << eb; - - // // ice_id // _H << nl << "-(NSString *) ice_id;"; diff --git a/cpp/src/slice2php/Main.cpp b/cpp/src/slice2php/Main.cpp index 2e42bc8fb73..4163fc193c6 100644 --- a/cpp/src/slice2php/Main.cpp +++ b/cpp/src/slice2php/Main.cpp @@ -684,16 +684,7 @@ CodeVisitor::visitExceptionStart(const ExceptionPtr& p) _out << eb; // - // ice_name - // - _out << sp << nl << "public function ice_name()"; - _out << sb; - _out << nl << "trigger_error('ice_name() is deprecated use ice_id() instead.', E_DEPRECATED);"; - _out << nl << "return '" << scoped.substr(2) << "';"; - _out << eb; - - // - // ice_name + // ice_id // _out << sp << nl << "public function ice_id()"; _out << sb; diff --git a/cpp/test/Ice/interceptor/MyObjectI.cpp b/cpp/test/Ice/interceptor/MyObjectI.cpp index 0ebb06cdd17..72c64aba5fb 100644 --- a/cpp/test/Ice/interceptor/MyObjectI.cpp +++ b/cpp/test/Ice/interceptor/MyObjectI.cpp @@ -20,27 +20,23 @@ MySystemException::MySystemException(const char* file, int line) : { } -MySystemException::~MySystemException() throw() +MySystemException::~MySystemException() ICE_NOEXCEPT { } string MySystemException::ice_id() const { - return "MySystemException"; -} - -string -MySystemException::ice_name() const -{ - return ice_id(); + return "::MySystemException"; } +#ifndef ICE_CPP11_MAPPING MySystemException* MySystemException::ice_clone() const { return new MySystemException(*this); } +#endif void MySystemException::ice_throw() const diff --git a/cpp/test/Ice/interceptor/MyObjectI.h b/cpp/test/Ice/interceptor/MyObjectI.h index 9ba0c9f3e37..b7a61435a81 100644 --- a/cpp/test/Ice/interceptor/MyObjectI.h +++ b/cpp/test/Ice/interceptor/MyObjectI.h @@ -18,11 +18,12 @@ public: MySystemException(const char*, int); - virtual ~MySystemException() throw(); + virtual ~MySystemException() ICE_NOEXCEPT; - virtual std::string ice_name() const; virtual std::string ice_id() const; +#ifndef ICE_CPP11_MAPPING virtual MySystemException* ice_clone() const; +#endif virtual void ice_throw() const; }; diff --git a/cpp/test/Ice/plugin/Plugin.cpp b/cpp/test/Ice/plugin/Plugin.cpp index 8e4c23d8ffd..0e5e60b2e21 100644 --- a/cpp/test/Ice/plugin/Plugin.cpp +++ b/cpp/test/Ice/plugin/Plugin.cpp @@ -58,9 +58,9 @@ class PluginInitializeFailExeption : public std::exception public: - PluginInitializeFailExeption() throw() {} - virtual ~PluginInitializeFailExeption() throw() {} - virtual const char* what() const throw() { return "PluginInitializeFailExeption"; } + PluginInitializeFailExeption() ICE_NOEXCEPT {} + virtual ~PluginInitializeFailExeption() ICE_NOEXCEPT {} + virtual const char* what() const ICE_NOEXCEPT { return "PluginInitializeFailExeption"; } }; class PluginInitializeFail : public Ice::Plugin diff --git a/cpp/test/Ice/retry/SystemFailure.h b/cpp/test/Ice/retry/SystemFailure.h index a58c3d7b1b4..4ef97f37ffa 100644 --- a/cpp/test/Ice/retry/SystemFailure.h +++ b/cpp/test/Ice/retry/SystemFailure.h @@ -23,21 +23,18 @@ public: SystemFailure(const SystemFailure& ex) : Ice::SystemException(ex.ice_file(), ex.ice_line()) { } - - virtual std::string ice_name() const - { - return ice_id(); - } virtual std::string ice_id() const { return "SystemFailure"; } +#ifndef ICE_CPP11_MAPPING virtual SystemException* ice_clone() const { return new SystemFailure(*this); } +#endif virtual void ice_throw() const { diff --git a/cpp/test/include/TestCommon.h b/cpp/test/include/TestCommon.h index 322672478ac..cad96b6bc41 100644 --- a/cpp/test/include/TestCommon.h +++ b/cpp/test/include/TestCommon.h @@ -144,19 +144,21 @@ public: { } - virtual ~TestFailedException() throw() + virtual ~TestFailedException() ICE_NOEXCEPT { } - virtual ::std::string ice_name() const + virtual ::std::string ice_id() const { return "::TestFailedException"; } +#ifndef ICE_CPP11_MAPPING virtual TestFailedException* ice_clone() const { return new TestFailedException(*this); } +#endif virtual void ice_throw() const { |