BadOptionalAccessException.cpp
Go to the documentation of this file.
1 // Copyright 2023 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  "Bad optional access: value not set";
21 
23  const char* const& message) noexcept
24  : Exception(message)
25 {
26 }
27 
29  const BadOptionalAccessException& ex) noexcept
30  : Exception(ex)
31 {
32 }
33 
35  BadOptionalAccessException&& ex) noexcept
36  : Exception(std::move(ex))
37 {
38 }
39 
41  const BadOptionalAccessException& ex) noexcept
42 {
43  if (this != &ex)
44  {
46  ex);
47  }
48 
49  return *this;
50 }
51 
53  BadOptionalAccessException&& ex) noexcept
54 {
55  if (this != &ex)
56  {
58  std::move(ex));
59  }
60 
61  return *this;
62 }
63 
65 {
66 }
67 
69 {
70  throw *this;
71 }
eprosima::fastcdr::exception::BadOptionalAccessException
This class is thrown as an exception when accessing the value of a null optional.
Definition: BadOptionalAccessException.hpp:27
eprosima::fastcdr::exception::BadOptionalAccessException::~BadOptionalAccessException
virtual Cdr_DllAPI ~BadOptionalAccessException() noexcept
Default destructor.
Definition: BadOptionalAccessException.cpp:64
eprosima::fastcdr::exception::BadOptionalAccessException::BAD_OPTIONAL_ACCESS_MESSAGE_DEFAULT
static const Cdr_DllAPI char *const BAD_OPTIONAL_ACCESS_MESSAGE_DEFAULT
Default message used in the library.
Definition: BadOptionalAccessException.hpp:78
BadOptionalAccessException.hpp
backward::details::move
const T & move(const T &v)
Definition: backward.hpp:394
eprosima::fastcdr::exception::Exception::operator=
Cdr_DllAPI Exception & operator=(const Exception &ex) noexcept
Assigment operation.
Definition: Exception.cpp:37
eprosima::fastcdr::exception::BadOptionalAccessException::raise
Cdr_DllAPI void raise() const override
This function throws the object as exception.
Definition: BadOptionalAccessException.cpp:68
eprosima::fastcdr::exception::Exception
This abstract class is used to create exceptions.
Definition: Exception.h:29
eprosima::fastcdr::exception::BadOptionalAccessException::operator=
Cdr_DllAPI BadOptionalAccessException & operator=(const BadOptionalAccessException &ex) noexcept
Assigment operation.
Definition: BadOptionalAccessException.cpp:40
eprosima::fastcdr::exception::BadOptionalAccessException::BadOptionalAccessException
Cdr_DllAPI BadOptionalAccessException(const char *const &message) noexcept
Default constructor.
Definition: BadOptionalAccessException.cpp:22
eprosima::fastcdr::exception
Definition: BadOptionalAccessException.hpp:22


plotjuggler
Author(s): Davide Faconti
autogenerated on Sun Aug 11 2024 02:24:21