ADTF
Loading...
Searching...
No Matches
error_description.h
Go to the documentation of this file.
1
14
15#ifndef A_UTIL_UTIL_RESULT_IMPL_ERROR_DESCRIPTION_HEADER_INCLUDED
16#define A_UTIL_UTIL_RESULT_IMPL_ERROR_DESCRIPTION_HEADER_INCLUDED
17
20
21#include <string>
22
23namespace a_util {
24namespace result {
25namespace detail {
29class ErrorDescription final : public IErrorDescription {
30public: // const members, disable copy and move semantics
31 ErrorDescription(const ErrorDescription&) = delete;
32 ErrorDescription& operator=(const ErrorDescription&) = delete;
33
34 ErrorDescription(ErrorDescription&&) = delete;
35 ErrorDescription& operator=(ErrorDescription&&) = delete;
36
38 ~ErrorDescription() = default;
39
50 inline ErrorDescription(std::int32_t error_code,
51 const char* error_description,
52 std::int32_t line,
53 const char* file,
54 const char* function,
55 const char* error_label);
56
61 inline std::int32_t getErrorCode() const;
62
67 inline std::int32_t getLine() const;
68
73 inline const char* getErrorDescription() const;
74
79 inline const char* getFileName() const;
80
85 inline const char* getFunctionName() const;
86
91 inline const char* getErrorCodeLabel() const;
92
93private:
94 const std::int32_t _error_code;
95 const std::int32_t _line_number;
96 const std::string _error_description;
97 const std::string _file_name;
98 const std::string _function_name;
99 const std::string _error_label;
100}; // class ErrorDescription
101
104
113template <typename T, template <typename = T> class = ::a_util::result::ResultInfo>
115public:
120 inline std::int32_t getErrorCode() const override;
121
126 inline const char* getErrorCodeLabel() const override;
127
128private:
133 inline std::int32_t getLine() const override;
134
139 inline const char* getErrorDescription() const override;
140
145 inline const char* getFileName() const override;
146
151 inline const char* getFunctionName() const override;
152};
153
154} // namespace detail
155} // namespace result
156} // namespace a_util
157
159
160#endif // A_UTIL_UTIL_RESULT_IMPL_ERROR_DESCRIPTION_HEADER_INCLUDED
Definition error_description.h:29
std::int32_t getLine() const
Get line in source file where the error was reported.
Definition error_description_impl.h:43
const char * getFunctionName() const
Get name of the function the error was reported in.
Definition error_description_impl.h:58
const char * getErrorCodeLabel() const
Get error code label.
Definition error_description_impl.h:63
const char * getErrorDescription() const
Get error code as string representation.
Definition error_description_impl.h:48
const char * getFileName() const
Get name of the file the error was reported in.
Definition error_description_impl.h:53
std::int32_t getErrorCode() const
Get error code.
Definition error_description_impl.h:38
Definition error_description_intf.h:28
Definition error_description.h:114
std::int32_t getErrorCode() const override
Definition error_description_impl.h:69
const char * getErrorCodeLabel() const override
Definition error_description_impl.h:99
Serves as namespace for result implementation details.
Definition result.h:22
Serves as component for functionality handling error and return types.
Definition result.h:20
Serves as the root component, with common functionality documented in core functionality.
Definition base.h:24
Definition result_info_decl.h:86
type needed for reference counting
Definition reference_counted_object_disable_dynamic_alloc.h:27