SecurityException.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. // Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. /*!
  15. * @file SecurityException.h
  16. */
  17. #ifndef _FASTDDS_RTPS_SECURITY_EXCEPTIONS_SECURITYEXCEPTION_H_
  18. #define _FASTDDS_RTPS_SECURITY_EXCEPTIONS_SECURITYEXCEPTION_H_
  19. #include <fastdds/rtps/exceptions/Exception.h>
  20. namespace eprosima {
  21. namespace fastrtps {
  22. namespace rtps {
  23. namespace security {
  24. /**
  25. * @brief This class is thrown as an exception when there is an error in security module.
  26. * @ingroup EXCEPTIONMODULE
  27. */
  28. class SecurityException : public Exception
  29. {
  30. public:
  31. RTPS_DllAPI SecurityException() {}
  32. /**
  33. * @brief Default constructor.
  34. * @param message An error message. This message is copied.
  35. */
  36. RTPS_DllAPI SecurityException(const std::string& message) : Exception(message.c_str(), 1) {}
  37. /**
  38. * @brief Default copy constructor.
  39. * @param ex SecurityException that will be copied.
  40. */
  41. RTPS_DllAPI SecurityException(const SecurityException &ex);
  42. /**
  43. * @brief Default move constructor.
  44. * @param ex SecurityException that will be moved.
  45. */
  46. RTPS_DllAPI SecurityException(SecurityException&& ex);
  47. /**
  48. * @brief Assigment operation.
  49. * @param ex SecurityException that will be copied.
  50. */
  51. RTPS_DllAPI SecurityException& operator=(const SecurityException &ex);
  52. /**
  53. * @brief Assigment operation.
  54. * @param ex SecurityException that will be moved.
  55. */
  56. RTPS_DllAPI SecurityException& operator=(SecurityException&& ex);
  57. /// \brief Default constructor
  58. virtual RTPS_DllAPI ~SecurityException() throw();
  59. /// \brief This function throws the object as an exception.
  60. virtual RTPS_DllAPI void raise() const;
  61. };
  62. } // namespace security
  63. } // namespace rtps
  64. } // namespace fastrtps
  65. } // namespace eprosima
  66. #endif // _FASTDDS_RTPS_SECURITY_EXCEPTIONS_SECURITYEXCEPTION_H_