mmCEsim 0.3.0
mmWave Channel Estimation Simulation
error_code.h File Reference

Error Codes (Including Warnings) More...

#include "log_global.h"
#include "meta.h"
#include "term.h"
#include <cassert>
#include <iostream>
#include <string>
#include <type_traits>
Include dependency graph for error_code.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum class  Err : int {
  SUCCESS = 0 , CLI_OPTIONS = 100 , NO_GUI , INPUT_NOT_EXISTS ,
  UNKOWN_CMD , OUTPUT_FILE_EXISTS , CANNOT_OPEN_OUTPUT_FILE , YAML_SYNTAX ,
  YAML_DTYPE , VERSION_STRING_ERROR , TOO_MANY_TX , TOO_MANY_RX ,
  ASTYLE_ERROR , COMPILE_ERROR , SIMULATE_ERROR , CONFIG_ERROR ,
  CANNOT_COPY_FROM_INCLUDE , ALG_EXPORT_ESTIMATION , ALG_EXPORT_GEN_BF , ALG_EXPORT_ALGORITHM ,
  VERSION_NOT_SPECIFIED = 200
}
 Error Code. More...
 

Functions

static int errorCode (const Err &e) noexcept
 Return the integer of the error code from class Err. More...
 
static std::string errorMsg (const Err &e) noexcept
 Return the error message of the error code from class Err. More...
 
static bool isError (const Err &e) noexcept
 Check if the error code corresponds to an error. More...
 
static bool isWarning (const Err &e) noexcept
 Check if the error code corresponds to a warning. More...
 
static bool isSuccess (const Err &e) noexcept
 Check if the error code corresponds to a warning. More...
 
static void errorExit (const Err &e, bool show_error=true) noexcept
 Print error message and exit with exit code. More...
 

Detailed Description

Error Codes (Including Warnings)

Author
Wuqiong Zhao (wqzha.nosp@m.o@se.nosp@m.u.edu.nosp@m..cn)
Version
0.3.0
Date
2024-01-21

Enumeration Type Documentation

◆ Err

enum class Err : int
strong

Error Code.

Each error has its corresponding error. It is worth noting that SUCCESS is also listed here.

Enumerator
SUCCESS 
CLI_OPTIONS 
NO_GUI 
INPUT_NOT_EXISTS 
UNKOWN_CMD 
OUTPUT_FILE_EXISTS 
CANNOT_OPEN_OUTPUT_FILE 
YAML_SYNTAX 
YAML_DTYPE 
VERSION_STRING_ERROR 
TOO_MANY_TX 
TOO_MANY_RX 
ASTYLE_ERROR 
COMPILE_ERROR 
SIMULATE_ERROR 
CONFIG_ERROR 
CANNOT_COPY_FROM_INCLUDE 
ALG_EXPORT_ESTIMATION 
ALG_EXPORT_GEN_BF 
ALG_EXPORT_ALGORITHM 
VERSION_NOT_SPECIFIED 

Function Documentation

◆ errorCode()

static int errorCode ( const Err e)
inlinestaticnoexcept

Return the integer of the error code from class Err.

Parameters
eError Code (class Err)
Returns
int (The error code.)
Here is the caller graph for this function:

◆ errorExit()

static void errorExit ( const Err e,
bool  show_error = true 
)
inlinestaticnoexcept

Print error message and exit with exit code.

Parameters
eError code (class Err).
Here is the call graph for this function:
Here is the caller graph for this function:

◆ errorMsg()

static std::string errorMsg ( const Err e)
inlinestaticnoexcept

Return the error message of the error code from class Err.

Parameters
eError code (class Err).
Returns
std::string (The error message.)
Here is the caller graph for this function:

◆ isError()

static bool isError ( const Err e)
inlinestaticnoexcept

Check if the error code corresponds to an error.

Parameters
eError code (class Err).
Return values
trueThis is not an error.
falseThis is a real error.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isSuccess()

static bool isSuccess ( const Err e)
inlinestaticnoexcept

Check if the error code corresponds to a warning.

This is used to check if it is Err::SUCCESS.

Parameters
eError code (class Err).
Return values
trueThis is success.
falseThis is not success.

◆ isWarning()

static bool isWarning ( const Err e)
inlinestaticnoexcept

Check if the error code corresponds to a warning.

Parameters
eError code (class Err).
Return values
trueThis is not a warning.
falseThis is a real warning.
Here is the call graph for this function: