1#ifndef QX_ABSTRACTERROR_H
2#define QX_ABSTRACTERROR_H
5#include "qx/core/qx_core_export.h"
17#include "qx/core/qx-global.h"
20#include "qx/utility/qx-stringliteral.h"
32 static inline const QString T_CODE_DUPE = u
"Error type code %1 is already claimed by %2!"_s;
33 static inline const QString T_NAME_DUPE = u
"Error type name %1 is already claimed!"_s;
34 static inline const QString T_CODE_RESERVED = u
"Error type code %1 is reserved!"_s;
36 static constexpr std::array<QStringView, 8> RESERVED_NAMES{
41 u
"Qx::DownloadManagerReport",
42 u
"Qx::DownloadOpReport",
54 static bool registerType(quint16 tc,
const QString& tn);
63 virtual quint32 deriveValue()
const;
64 virtual Severity deriveSeverity()
const;
65 virtual QString deriveCaption()
const;
66 virtual QString derivePrimary()
const;
67 virtual QString deriveSecondary()
const;
68 virtual QString deriveDetails()
const;
84template<StringLiteral EName, qu
int16 ECode>
94 static const bool REGISTER;
102 using IError::registerType;
136template<StringLiteral EName, qu
int16 ECode>
137const bool AbstractError<EName, ECode>::REGISTER = registerType(TYPE_CODE, TYPE_NAME);
140namespace AbstractErrorPrivate
142 template<Qx::StringLiteral Y, qu
int16 Z>
149 AbstractErrorPrivate::aeDerived(type);
155 !std::move_constructible<A> &&
156 !std::copy_constructible<A>;
158template<
class Able,
class Ater>
164#define QX_ERROR_TYPE(Type, Name, Code) \
165 Type final : public Qx::AbstractError<Name, Code>
The AbstractError template class completes the Error interface and acts as the base class from which ...
Definition qx-abstracterror.h:86
static constexpr QLatin1StringView TYPE_NAME
Definition qx-abstracterror.h:91
bool operator==(const AbstractError &other) const =default
static constexpr quint16 TYPE_CODE
Definition qx-abstracterror.h:90
bool operator!=(const AbstractError &other) const =default
The Error class acts as an interface for an extensible variety of error objects.
Definition qx-error.h:38
IError defines the baseline inheritance interface for Qx error types.
Definition qx-abstracterror.h:28
bool operator!=(const IError &other) const =default
virtual quint32 deriveValue() const
Definition qx-abstracterror.cpp:78
bool operator==(const IError &other) const =default
Specifies that two types form a Qx error adaptation.
Definition qx-abstracterror.h:159
Specifies that a type is a Qx error adapter.
Definition qx-abstracterror.h:153
Specifies that a type is a Qx error type.
Definition qx-abstracterror.h:148
The Qx namespace is the main namespace through which all non-global functionality of the Qx library i...
Definition qx-processwaiter.cpp:5
Severity
Definition qx-global.h:11