pjmsg_mcap_wrapper
Loading...
Searching...
No Matches
BadParamException.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
19const char* const BadParamException::BAD_PARAM_MESSAGE_DEFAULT = "Bad parameter";
20
22 const char* const& message) noexcept
23 : Exception(message)
24{
25}
26
28 const BadParamException& ex) noexcept
29 : Exception(ex)
30{
31}
32
34 BadParamException&& ex) noexcept
35 : Exception(std::move(ex))
36{
37}
38
40 const BadParamException& ex) noexcept
41{
42 if (this != &ex)
43 {
45 ex);
46 }
47
48 return *this;
49}
50
52 BadParamException&& ex) noexcept
53{
54 if (this != &ex)
55 {
57 std::move(ex));
58 }
59
60 return *this;
61}
62
66
68{
69 throw *this;
70}
This class is thrown as an exception when an invalid parameter is being serialized.
Cdr_DllAPI BadParamException(const char *const &message) noexcept
Default constructor.
virtual Cdr_DllAPI ~BadParamException() noexcept
Default destructor.
Cdr_DllAPI BadParamException & operator=(const BadParamException &ex) noexcept
Assigment operation.
static Cdr_DllAPI const char *const BAD_PARAM_MESSAGE_DEFAULT
Default message used in the library.
Cdr_DllAPI void raise() const override
This function throws the object as exception.
This abstract class is used to create exceptions.
Definition Exception.h:30
Cdr_DllAPI Exception & operator=(const Exception &ex) noexcept
Assigment operation.
Definition Exception.cpp:37