pjmsg_mcap_wrapper
Loading...
Searching...
No Matches
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
17using 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
32 Exception&& ex) noexcept
33 : m_message(std::move(ex.m_message))
34{
35}
36
38 const Exception& ex) noexcept
39{
40 m_message = ex.m_message;
41 return *this;
42}
43
45 Exception&& ex) noexcept
46{
47 m_message = std::move(ex.m_message);
48 return *this;
49}
50
52{
53}
54
55const char* Exception::what() const noexcept
56{
57 return m_message;
58}
This abstract class is used to create exceptions.
Definition Exception.h:30
virtual Cdr_DllAPI ~Exception() noexcept
Default destructor.
Definition Exception.cpp:51
virtual Cdr_DllAPI const char * what() const noexcept override
This function returns the error message.
Definition Exception.cpp:55
Cdr_DllAPI Exception & operator=(const Exception &ex) noexcept
Assigment operation.
Definition Exception.cpp:37
Cdr_DllAPI Exception(const char *const &message) noexcept
Default constructor.
Definition Exception.cpp:19