Issue 18612: API corrections required to src/hpp/dds/core/Exception.hpp (dds-psm-cxx-rtf) Source: Micro Focus (Mr. Simon McQueen, simon.mcqueen(at)microfocus.com) Nature: Revision Severity: Summary: Name: Simon McQueen Employer: PrismTech Specification: DDS CXX PSM RTF FormalNumber: ptc/12-10-03 Nature: Revision _Issues_: API requires warning suppression with MS Visual Studio. MS symbol export macros missing. Missing constructor. Incorrect comments. Some in-line definition remaining in declaration only file. _Suggested resolution_: diff --git a/src/hpp/dds/core/Exception.hpp b/src/hpp/dds/core/Exception.hpp index 84c7c28..22b05ab 100644 --- a/src/hpp/dds/core/Exception.hpp +++ b/src/hpp/dds/core/Exception.hpp @@ -23,15 +23,21 @@ #include <string> #include <dds/core/macros.hpp> +#if defined _MSC_VER +# pragma warning (push) +# pragma warning (disable:4275) // non dll-interface class 'std::foo_error' used as base for dll-interface class 'dds::core::BarError' +#endif + namespace dds { namespace core { /** - * This files contains the exceptions corresponding to DDS errors. - * In the DDS-PSM-Cxx in place of DDS errors the associated expcetion + * @file + * This file contains the exceptions corresponding to DDS errors. + * In the DDS-PSM-Cxx in place of DDS errors the associated exception * should be raised. Please section 7.5.5 of the DDS-PSM-C++ specification. */ - class Exception + class OMG_DDS_API Exception { protected: Exception(); @@ -42,12 +48,11 @@ namespace dds { namespace core { virtual const char* what() const throw () = 0; }; - class Error : public Exception, public std::exception + class OMG_DDS_API Error : public Exception, public std::logic_error { public: - Error(); + explicit Error(const std::string& msg); Error(const Error& src); - public: virtual ~Error() throw (); public: @@ -55,7 +60,7 @@ namespace dds { namespace core { }; - class AlreadyClosedError : public Exception, public std::logic_error + class OMG_DDS_API AlreadyClosedError : public Exception, public std::logic_error { public: explicit AlreadyClosedError(const std::string& msg); @@ -67,7 +72,7 @@ namespace dds { namespace core { }; - class IllegalOperationError : public Exception, public std::logic_error + class OMG_DDS_API IllegalOperationError : public Exception, public std::logic_error { public: explicit IllegalOperationError(const std::string& msg); @@ -79,7 +84,7 @@ namespace dds { namespace core { }; - class ImmutablePolicyError : public Exception, public std::logic_error + class OMG_DDS_API ImmutablePolicyError : public Exception, public std::logic_error { public: explicit ImmutablePolicyError(const std::string& msg); @@ -91,7 +96,7 @@ namespace dds { namespace core { }; - class InconsistentPolicyError : public Exception, public std::logic_error + class OMG_DDS_API InconsistentPolicyError : public Exception, public std::logic_error { public: explicit InconsistentPolicyError(const std::string& msg); @@ -103,7 +108,7 @@ namespace dds { namespace core { }; - class InvalidArgumentError : public Exception, public std::invalid_argument + class OMG_DDS_API InvalidArgumentError : public Exception, public std::invalid_argument { public: explicit InvalidArgumentError(const std::string& msg); @@ -115,7 +120,7 @@ namespace dds { namespace core { }; - class NotEnabledError : public Exception, public std::logic_error + class OMG_DDS_API NotEnabledError : public Exception, public std::logic_error { public: explicit NotEnabledError(const std::string& msg); @@ -127,7 +132,7 @@ namespace dds { namespace core { }; - class OutOfResourcesError : public Exception, public std::runtime_error + class OMG_DDS_API OutOfResourcesError : public Exception, public std::runtime_error { public: explicit OutOfResourcesError(const std::string& msg); @@ -139,22 +144,19 @@ namespace dds { namespace core { }; - class PreconditionNotMetError : public Exception, public std::logic_error + class OMG_DDS_API PreconditionNotMetError : public Exception, public std::logic_error { public: - explicit PreconditionNotMetError(const std::string& msg) : std::logic_error(msg) { } - PreconditionNotMetError(const PreconditionNotMetError& src) : std::logic_error(src.what()) {} - virtual ~PreconditionNotMetError() throw () { } + explicit PreconditionNotMetError(const std::string& msg); + PreconditionNotMetError(const PreconditionNotMetError& src); + virtual ~PreconditionNotMetError() throw (); public: - virtual const char* what() const throw () { - return this->std::logic_error::what(); - } - + virtual const char* what() const throw (); }; - class TimeoutError : public Exception, public std::runtime_error + class OMG_DDS_API TimeoutError : public Exception, public std::runtime_error { public: explicit TimeoutError(const std::string& msg); @@ -166,7 +168,7 @@ namespace dds { namespace core { }; - class UnsupportedError : public Exception, public std::logic_error + class OMG_DDS_API UnsupportedError : public Exception, public std::logic_error { public: explicit UnsupportedError(const std::string& msg); @@ -177,7 +179,7 @@ namespace dds { namespace core { virtual const char* what() const throw (); }; - class InvalidDowncastError : public Exception, public std::runtime_error + class OMG_DDS_API InvalidDowncastError : public Exception, public std::runtime_error { public: explicit InvalidDowncastError(const std::string& msg); @@ -188,7 +190,7 @@ namespace dds { namespace core { virtual const char* what() const throw (); }; - class NullReferenceError : public Exception, public std::runtime_error + class OMG_DDS_API NullReferenceError : public Exception, public std::runtime_error { public: explicit NullReferenceError(const std::string& msg); @@ -200,7 +202,7 @@ namespace dds { namespace core { }; - class InvalidDataError : public Exception, public std::logic_error + class OMG_DDS_API InvalidDataError : public Exception, public std::logic_error { public: explicit InvalidDataError(const std::string& msg); @@ -213,4 +215,9 @@ namespace dds { namespace core { }} +#if defined _MSC_VER +# pragma warning (pop) +#endif + + #endif /* OMG_DDS_CORE_EXCEPTION_HPP_ */ Resolution: Revised Text: Actions taken: April 3, 2013: received issue Discussion: End of Annotations:===== ogle-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding:x-gm-message-state; bh=A6VGalqYlCsj9EjlGsmfNsjNrSHx/ajoxJS3pJZRLac=; b=A9bg4AD4QLU5qhaPRY34BQGSAOXJlyMtgSCEoyB7JsT8M/gf/b9DGt4Gh6CPuKR5dS nhVlMqDsaGcLrMBycs3A/OTK8Vx1NErGBzOfvSuH3DVtPbHYYhuFJbThjZejmTWTq4vg cZQCmrTNAsaLupVcGXN0U5AoEiXej/XiK/BYvsEDulBT1ojANU33JMetypiMGDGDD7wM vbDO5liyzcf/SoC9x5H+i5XrBMCwraXXnFaXwOhv26R8xJ0oqJccNV9Z3H6HLIRR4umK x+OCEZBWomHFwnedUl+arO40sfBryTT0l/KFTap0DZtG0RPwzsmEtsJ5EKxA6rCb1vmS IaDw== X-Received: by 10.194.173.228 with SMTP id bn4mr3864511wjc.20.1365005379414; Wed, 03 Apr 2013 09:09:39 -0700 (PDT) Date: Wed, 03 Apr 2013 17:09:31 +0100 From: Simon McQueen User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130307 Thunderbird/17.0.4 To: issues@omg.org Subject: API corrections required to src/hpp/dds/core/Exception.hpp X-Gm-Message-State: ALoCoQm0OKiw8pHuSZbafxSSZ61aR+zRLUBjRIgMl6hV9H+r25CepJv20w4fDfKBndE29YEnEJgi X-Virus-Scanned: amavisd-new at omg.org X-Brightmail-Tracker: AAAAARoK1yw= X-Brightmail-Tracker: AAAAAA== Name: Simon McQueen Employer: PrismTech Specification: DDS CXX PSM RTF FormalNumber: ptc/12-10-03 Nature: Revision _Issues_: API requires warning suppression with MS Visual Studio. MS symbol export macros missing. Missing constructor. Incorrect comments. Some in-line definition remaining in declaration only file. _Suggested resolution_: diff --git a/src/hpp/dds/core/Exception.hpp b/src/hpp/dds/core/Exception.hpp index 84c7c28..22b05ab 100644 --- a/src/hpp/dds/core/Exception.hpp +++ b/src/hpp/dds/core/Exception.hpp @@ -23,15 +23,21 @@ #include #include +#if defined _MSC_VER +# pragma warning (push) +# pragma warning (disable:4275) // non dll-interface class 'std::foo_error' used as base for dll-interface class 'dds::core::BarError' +#endif + namespace dds { namespace core { /** - * This files contains the exceptions corresponding to DDS errors. - * In the DDS-PSM-Cxx in place of DDS errors the associated expcetion + * @file + * This file contains the exceptions corresponding to DDS errors. + * In the DDS-PSM-Cxx in place of DDS errors the associated exception * should be raised. Please section 7.5.5 of the DDS-PSM-C++ specification. */ - class Exception + class OMG_DDS_API Exception { protected: Exception(); @@ -42,12 +48,11 @@ namespace dds { namespace core { virtual const char* what() const throw () = 0; }; - class Error : public Exception, public std::exception + class OMG_DDS_API Error : public Exception, public std::logic_error { public: - Error(); + explicit Error(const std::string& msg); Error(const Error& src); - public: virtual ~Error() throw (); public: @@ -55,7 +60,7 @@ namespace dds { namespace core { }; - class AlreadyClosedError : public Exception, public std::logic_error + class OMG_DDS_API AlreadyClosedError : public Exception, public std::logic_error { public: explicit AlreadyClosedError(const std::string& msg); @@ -67,7 +72,7 @@ namespace dds { namespace core { }; - class IllegalOperationError : public Exception, public std::logic_error + class OMG_DDS_API IllegalOperationError : public Exception, public std::logic_error { public: explicit IllegalOperationError(const std::string& msg); @@ -79,7 +84,7 @@ namespace dds { namespace core { }; - class ImmutablePolicyError : public Exception, public std::logic_error + class OMG_DDS_API ImmutablePolicyError : public Exception, public std::logic_error { public: explicit ImmutablePolicyError(const std::string& msg); @@ -91,7 +96,7 @@ namespace dds { namespace core { }; - class InconsistentPolicyError : public Exception, public std::logic_error + class OMG_DDS_API InconsistentPolicyError : public Exception, public std::logic_error { public: explicit InconsistentPolicyError(const std::string& msg); @@ -103,7 +108,7 @@ namespace dds { namespace core { }; - class InvalidArgumentError : public Exception, public std::invalid_argument + class OMG_DDS_API InvalidArgumentError : public Exception, public std::invalid_argument { public: explicit InvalidArgumentError(const std::string& msg); @@ -115,7 +120,7 @@ namespace dds { namespace core { }; - class NotEnabledError : public Exception, public std::logic_error + class OMG_DDS_API NotEnabledError : public Exception, public std::logic_error { public: explicit NotEnabledError(const std::string& msg); @@ -127,7 +132,7 @@ namespace dds { namespace core { }; - class OutOfResourcesError : public Exception, public std::runtime_error + class OMG_DDS_API OutOfResourcesError : public Exception, public std::runtime_error { public: explicit OutOfResourcesError(const std::string& msg); @@ -139,22 +144,19 @@ namespace dds { namespace core { }; - class PreconditionNotMetError : public Exception, public std::logic_error + class OMG_DDS_API PreconditionNotMetError : public Exception, public std::logic_error { public: - explicit PreconditionNotMetError(const std::string& msg) : std::logic_error(msg) { } - PreconditionNotMetError(const PreconditionNotMetError& src) : std::logic_error(src.what()) {} - virtual ~PreconditionNotMetError() throw () { } + explicit PreconditionNotMetError(const std::string& msg); + PreconditionNotMetError(const PreconditionNotMetError& src); + virtual ~PreconditionNotMetError() throw (); public: - virtual const char* what() const throw () { - return this->std::logic_error::what(); - } - + virtual const char* what() const throw (); }; - class TimeoutError : public Exception, public std::runtime_error + class OMG_DDS_API TimeoutError : public Exception, public std::runtime_error { public: explicit TimeoutError(const std::string& msg); @@ -166,7 +168,7 @@ namespace dds { namespace core { }; - class UnsupportedError : public Exception, public std::logic_error + class OMG_DDS_API UnsupportedError : public Exception, public std::logic_error { public: explicit UnsupportedError(const std::string& msg); @@ -177,7 +179,7 @@ namespace dds { namespace core { virtual const char* what() const throw (); }; - class InvalidDowncastError : public Exception, public std::runtime_error + class OMG_DDS_API InvalidDowncastError : public Exception, public std::runtime_error { public: explicit InvalidDowncastError(const std::string& msg); @@ -188,7 +190,7 @@ namespace dds { namespace core { virtual const char* what() const throw (); }; - class NullReferenceError : public Exception, public std::runtime_error + class OMG_DDS_API NullReferenceError : public Exception, public std::runtime_error { public: explicit NullReferenceError(const std::string& msg); @@ -200,7 +202,7 @@ namespace dds { namespace core { }; - class InvalidDataError : public Exception, public std::logic_error + class OMG_DDS_API InvalidDataError : public Exception, public std::logic_error { public: explicit InvalidDataError(const std::string& msg); @@ -213,4 +215,9 @@ namespace dds { namespace core { }} +#if defined _MSC_VER +# pragma warning (pop) +#endif + + #endif /* OMG_DDS_CORE_EXCEPTION_HPP_ */