7#ifndef ARP_USE_ARP_SYSTEM_COMMONS_EXCEPTIONS
8#include "Arp/Base/Commons/Exceptions/InvalidCastException.hpp"
15#include "Arp/System/Commons/Exceptions/CommonException.hpp"
17namespace Arp {
namespace System {
namespace Commons
21class InvalidCastException :
public CommonException
24 template<
typename... Args>
25 InvalidCastException(
const char* message,
const Args& ... args);
26 InvalidCastException(
const String& message);
27 InvalidCastException(String&& message);
28 InvalidCastException(
const String& message,
const Exception& innerException);
29 InvalidCastException(String&& message, Exception&& innerException);
30 InvalidCastException(
const InvalidCastException& arg) =
default;
31 InvalidCastException(InvalidCastException&& arg) =
default;
32 virtual ~InvalidCastException(
void) =
default;
38 InvalidCastException& operator=(
const InvalidCastException& arg) =
delete;
45template<
typename... Args>
47 : CommonException(
ExceptionTypeId::InvalidCast, String::Format(message, args...))
52inline InvalidCastException::InvalidCastException(
const String& message)
53 : CommonException(ExceptionTypeId::InvalidCast, message)
58inline InvalidCastException::InvalidCastException(String&& message)
59 : CommonException(ExceptionTypeId::InvalidCast,
std::move(message))
64inline InvalidCastException::InvalidCastException(
const String& message,
const Exception& innerException)
65 : CommonException(ExceptionTypeId::InvalidCast, message, innerException)
70inline InvalidCastException::InvalidCastException(String&& message, Exception&& innerException)
71 : CommonException(ExceptionTypeId::InvalidCast,
std::move(message),
std::move(innerException))
79template<>
struct fmt::formatter<
Arp::System::Commons::InvalidCastException> :
public fmt::ostream_formatter {};
This exception is thrown when an invalid cast occurs.
Definition: InvalidCastException.hpp:17
InvalidCastException(const char *message, const Args &... args)
Creates an InvalidCastException with message.
Definition: InvalidCastException.hpp:68
std::unique_ptr< Exception > Ptr
The smart pointer type of this class.
Definition: Exception.hpp:27
ExceptionTypeId
Specifies the type id of any exception derived by <see cref="CommonException".
Definition: ExceptionTypeId.hpp:15
Root namespace for the PLCnext API
Namespace of the C++ standard library