Sound Open Firmware
Loading...
Searching...
No Matches
system_error.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-3-Clause
2 *
3 * Copyright(c) 2022 Intel Corporation. All rights reserved.
4 */
6
7#ifndef _ADSP_SYSTEM_ERROR_H_
8#define _ADSP_SYSTEM_ERROR_H_
9
10#include <module/iadk/adsp_error_code.h>
11
12namespace intel_adsp
13{
18 struct ErrorCode {
20 typedef int Type;
21
23 enum Enum {
24 NO_ERROR = ADSP_NO_ERROR,
25 INVALID_PARAMETERS = ADSP_INVALID_PARAMETERS,
26 BUSY = ADSP_BUSY_RESOURCE,
27 FATAL_FAILURE = ADSP_FATAL_FAILURE,
28
29 };
30
31 static Enum const MinValue = NO_ERROR;
33 static Enum const MaxValue = FATAL_FAILURE;
34
37 : value_(value) { }
38
41 {
42 return value_;
43 }
44
46 operator Type(void) const
47 {
48 return value_;
49 }
50
53 {
54 return value_ == a;
55 }
56
60 const Type & Value() const
61 {
62 return value_;
63 }
64
65 protected:
70 {
71 return value_;
72 }
73
74 private:
75 Type value_;
76 };
77}
78
79#endif /*_ADSP_SYSTEM_ERROR_H_ */
Definition fixed_array.h:13
static Enum const MinValue
Indicates the minimal value in the enumeration list.
Definition system_error.h:31
Type & Value()
Gets a reference on the error code value.
Definition system_error.h:69
static Enum const MaxValue
Indicates the maximal value in the enumeration list.
Definition system_error.h:33
bool operator==(Type a)
Evaluates the ErrorCode value against a given value.
Definition system_error.h:52
const Type & Value() const
Gets a const reference on the error code value.
Definition system_error.h:60
Enum
list of named error codes
Definition system_error.h:23
@ INVALID_PARAMETERS
Definition system_error.h:25
@ FATAL_FAILURE
Definition system_error.h:27
@ NO_ERROR
Definition system_error.h:24
@ BUSY
Definition system_error.h:26
ErrorCode(Type value)
Initializes a new ErrorCode instance given a value of error code.
Definition system_error.h:36
int Type
type of the error code value
Definition system_error.h:20
Type operator()() const
Returns the current value of the ErrorCode.
Definition system_error.h:40
char value[]
Definition tlv.h:2