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 
17 using namespace eprosima::fastcdr::exception;
18 
19 const 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 
33 #if HAVE_CXX0X
35  BadParamException&& ex) noexcept
36  : Exception(std::move(ex))
37 {
38 }
39 
40 #endif // if HAVE_CXX0X
41 
43  const BadParamException& ex) noexcept
44 {
45  if (this != &ex)
46  {
48  ex);
49  }
50 
51  return *this;
52 }
53 
54 #if HAVE_CXX0X
56  BadParamException&& ex) noexcept
57 {
58  if (this != &ex)
59  {
61  std::move(ex));
62  }
63 
64  return *this;
65 }
66 
67 #endif // if HAVE_CXX0X
68 
70 {
71 }
72 
74 {
75  throw *this;
76 }
This abstract class is used to create exceptions.
Definition: Exception.h:29
virtual Cdr_DllAPI void raise() const
This function throws the object as exception.
Cdr_DllAPI Exception & operator=(const Exception &ex) noexcept
Assigment operation.
Definition: Exception.cpp:40
static Cdr_DllAPI const char *const BAD_PARAM_MESSAGE_DEFAULT
Default message used in the library.
Cdr_DllAPI BadParamException(const char *const &message) noexcept
Default constructor.
This class is thrown as an exception when a invalid parameter was being serialized.
const T & move(const T &v)
Definition: backward.hpp:394
virtual Cdr_DllAPI ~BadParamException() noexcept
Default constructor.
Cdr_DllAPI BadParamException & operator=(const BadParamException &ex) noexcept
Assigment operation.


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