Exception.cpp
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 
16 
17 using namespace eprosima::fastcdr::exception;
18 
20  const char* const& message) noexcept
21  : m_message(message)
22 {
23 }
24 
26  const Exception& ex) noexcept
27  : m_message(ex.m_message)
28 {
29 }
30 
31 #if HAVE_CXX0X
33  Exception&& ex) noexcept
34  : m_message(std::move(ex.m_message))
35 {
36 }
37 
38 #endif // if HAVE_CXX0X
39 
41  const Exception& ex) noexcept
42 {
43  m_message = ex.m_message;
44  return *this;
45 }
46 
47 #if HAVE_CXX0X
49  Exception&& ex) noexcept
50 {
51  m_message = std::move(ex.m_message);
52  return *this;
53 }
54 
55 #endif // if HAVE_CXX0X
56 
58 {
59 }
60 
61 const char* Exception::what() const noexcept
62 {
63  return m_message;
64 }
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
virtual Cdr_DllAPI ~Exception() noexcept
Default destructor.
Definition: Exception.cpp:57
const T & move(const T &v)
Definition: backward.hpp:394
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