Exception.h
Go to the documentation of this file.
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 #ifndef _FASTCDR_EXCEPTIONS_EXCEPTION_H_
16 #define _FASTCDR_EXCEPTIONS_EXCEPTION_H_
17 
18 #include "../fastcdr_dll.h"
19 #include <string>
20 #include <exception>
21 
22 namespace eprosima {
23 namespace fastcdr {
24 namespace exception {
29 class Exception : public std::exception
30 {
31 public:
32 
34  virtual Cdr_DllAPI ~Exception() noexcept;
35 
37  virtual Cdr_DllAPI void raise() const = 0;
38 
44  virtual Cdr_DllAPI const char* what() const noexcept override;
45 
46 protected:
47 
54  const char* const& message) noexcept;
55 
62  const Exception& ex) noexcept;
63 
64 #if HAVE_CXX0X
65 
71  Exception&& ex) noexcept;
72 #endif // if HAVE_CXX0X
73 
80  const Exception& ex) noexcept;
81 
82 #if HAVE_CXX0X
83 
89  Exception&&) noexcept;
90 #endif // if HAVE_CXX0X
91 
92 private:
93 
94  const char* m_message;
95 };
96 } //namespace exception
97 } //namespace fastcdr
98 } //namespace eprosima
99 
100 #endif // _FASTCDR_EXCEPTIONS_EXCEPTION_H_
This abstract class is used to create exceptions.
Definition: Exception.h:29
Cdr_DllAPI Exception & operator=(const Exception &ex) noexcept
Assigment operation.
Definition: Exception.cpp:40
Definition: Cdr.h:37
#define Cdr_DllAPI
Definition: fastcdr_dll.h:51
virtual Cdr_DllAPI ~Exception() noexcept
Default destructor.
Definition: Exception.cpp:57
virtual Cdr_DllAPI const char * what() const noexcept override
This function returns the error message.
Definition: Exception.cpp:61
Cdr_DllAPI Exception(const char *const &message) noexcept
Default constructor.
Definition: Exception.cpp:19


plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Jun 19 2023 03:01:02