|
CGRAOmp
0.1
|
A custom error used to notice the specified configuration file is invalid. More...
#include <CGRAModel.hpp>
Public Member Functions | |
| ModelError (StringRef filename, StringRef missed_key) | |
| Construct a new ModelError when missing a required item. More... | |
| ModelError (StringRef filename, StringRef key, StringRef exptected_type, json::Value *v=nullptr) | |
| Construct a new ModelError when unexpected value type is specified. More... | |
| ModelError (StringRef filename, std::pair< StringRef, StringRef > config) | |
| Construct a new ModelError when not implemented configuration is specified. More... | |
| ModelError (StringRef filename, StringRef key, StringRef val, ArrayRef< StringRef > list) | |
| Construct a new ModelError when a value is invalid for the specified key. More... | |
| void | setRegion (StringRef region_str) |
| set a region where parse error ocurrs More... | |
| std::error_code | convertToErrorCode () const override |
| void | log (raw_ostream &OS) const override |
| bool | isMissingKey () |
| check if the error cause if due to missing key More... | |
Static Public Attributes | |
| static char | ID = 0 |
Private Types | |
| enum | ErrorType { ErrorType::MissingKey, ErrorType::InvalidDataType, ErrorType::InvalidValue, ErrorType::NoImplemented } |
| Type of error cause. More... | |
Private Attributes | |
| ErrorType | errtype |
| std::string | json_val = "" |
| StringRef | filename |
| StringRef | error_key |
| std::string | error_val |
| StringRef | exptected_type |
| StringRef | region = "" |
| SmallVector< StringRef > | valid_values |
A custom error used to notice the specified configuration file is invalid.
|
strongprivate |
|
inline |
Construct a new ModelError when missing a required item.
| filename | filename of the parsed configration file |
| missed_key | key string of missing item |
|
inline |
Construct a new ModelError when unexpected value type is specified.
| filename | filename of the parsed configration file |
| key | key string containing invalid type of value |
| exptected_type | the expected type of string |
| v | (optional) the invalid json::Value instance |
|
inline |
Construct a new ModelError when not implemented configuration is specified.
| filename | filename of the parsed configration file |
| config | a pair of key and value string for the configuration |
| ModelError::ModelError | ( | StringRef | filename, |
| StringRef | key, | ||
| StringRef | val, | ||
| ArrayRef< StringRef > | list | ||
| ) |
Construct a new ModelError when a value is invalid for the specified key.
| filename | filename of the parsed configration file |
| key | key string containing invalid value |
| val | the invalid value string |
| list | list of valid values |
|
inlineoverride |
|
inline |
check if the error cause if due to missing key
|
override |
|
inline |
set a region where parse error ocurrs
| region_str | a string of region info for error message |
|
private |
|
private |
|
private |
|
private |
|
private |
|
static |
|
private |
|
private |
|
private |
1.8.17