nndeploy C++ API  0.2.0
nndeploy C++ API
Classes | Namespaces | Macros | Enumerations | Functions
status.h File Reference
#include "nndeploy/base/glic_stl_include.h"
#include "nndeploy/base/log.h"
#include "nndeploy/base/macro.h"
Include dependency graph for status.h:

Go to the source code of this file.

Classes

class  nndeploy::base::Maybe< T >
 
class  nndeploy::base::Status
 

Namespaces

 nndeploy
 
 nndeploy::base
 

Macros

#define NNDEPLOY_ASSERT(x)
 
#define NNDEPLOY_CHECK_PARAM_NULL_RET_NULL(param, str)
 
#define NNDEPLOY_CHECK_PARAM_NULL_RET_STATUS(param, str)
 
#define NNDEPLOY_LOGD(fmt, ...)
 
#define NNDEPLOY_LOGDT(fmt, tag, ...)
 
#define NNDEPLOY_RETURN_ON_EQ(status, expected, str)
 
#define NNDEPLOY_RETURN_ON_NEQ(status, expected, str)
 
#define NNDEPLOY_RETURN_VALUE_ON_EQ(status, expected, value, str)
 
#define NNDEPLOY_RETURN_VALUE_ON_NEQ(status, expected, value, str)
 

Enumerations

enum  nndeploy::base::StatusCode : int {
  nndeploy::base::kStatusCodeOk = 0x0000 , nndeploy::base::kStatusCodeErrorUnknown , nndeploy::base::kStatusCodeErrorOutOfMemory , nndeploy::base::kStatusCodeErrorNotSupport ,
  nndeploy::base::kStatusCodeErrorNotImplement , nndeploy::base::kStatusCodeErrorInvalidValue , nndeploy::base::kStatusCodeErrorInvalidParam , nndeploy::base::kStatusCodeErrorNullParam ,
  nndeploy::base::kStatusCodeErrorThreadPool , nndeploy::base::kStatusCodeErrorIO , nndeploy::base::kStatusCodeErrorDeviceCpu , nndeploy::base::kStatusCodeErrorDeviceArm ,
  nndeploy::base::kStatusCodeErrorDeviceX86 , nndeploy::base::kStatusCodeErrorDeviceRiscV , nndeploy::base::kStatusCodeErrorDeviceCuda , nndeploy::base::kStatusCodeErrorDeviceRocm ,
  nndeploy::base::kStatusCodeErrorDeviceSyCL , nndeploy::base::kStatusCodeErrorDeviceOpenCL , nndeploy::base::kStatusCodeErrorDeviceOpenGL , nndeploy::base::kStatusCodeErrorDeviceMetal ,
  nndeploy::base::kStatusCodeErrorDeviceVulkan , nndeploy::base::kStatusCodeErrorDeviceHexagon , nndeploy::base::kStatusCodeErrorDeviceMtkVpu , nndeploy::base::kStatusCodeErrorDeviceAscendCL ,
  nndeploy::base::kStatusCodeErrorDeviceAppleNpu , nndeploy::base::kStatusCodeErrorDeviceRkNpu , nndeploy::base::kStatusCodeErrorDeviceQualcommNpu , nndeploy::base::kStatusCodeErrorDeviceMtkNpu ,
  nndeploy::base::kStatusCodeErrorDeviceSophonNpu , nndeploy::base::kStatusCodeErrorOpAscendCL , nndeploy::base::kStatusCodeErrorInferenceDefault , nndeploy::base::kStatusCodeErrorInferenceOpenVino ,
  nndeploy::base::kStatusCodeErrorInferenceTensorRt , nndeploy::base::kStatusCodeErrorInferenceCoreML , nndeploy::base::kStatusCodeErrorInferenceTfLite , nndeploy::base::kStatusCodeErrorInferenceOnnxRuntime ,
  nndeploy::base::kStatusCodeErrorInferenceAscendCL , nndeploy::base::kStatusCodeErrorInferenceNcnn , nndeploy::base::kStatusCodeErrorInferenceTnn , nndeploy::base::kStatusCodeErrorInferenceMnn ,
  nndeploy::base::kStatusCodeErrorInferencePaddleLite , nndeploy::base::kStatusCodeErrorInferenceRknn , nndeploy::base::kStatusCodeErrorInferenceTvm , nndeploy::base::kStatusCodeErrorInferenceAITemplate ,
  nndeploy::base::kStatusCodeErrorInferenceSnpe , nndeploy::base::kStatusCodeErrorInferenceQnn , nndeploy::base::kStatusCodeErrorInferenceSophon , nndeploy::base::kStatusCodeErrorInferenceTorch ,
  nndeploy::base::kStatusCodeErrorInferenceTensorFlow , nndeploy::base::kStatusCodeErrorInferenceNeuroPilot , nndeploy::base::kStatusCodeErrorInferenceVllm , nndeploy::base::kStatusCodeErrorInferenceSGLang ,
  nndeploy::base::kStatusCodeErrorInferenceLmdeploy , nndeploy::base::kStatusCodeErrorInferenceLlamaCpp , nndeploy::base::kStatusCodeErrorInferenceLLM , nndeploy::base::kStatusCodeErrorInferenceXDit ,
  nndeploy::base::kStatusCodeErrorInferenceOneDiff , nndeploy::base::kStatusCodeErrorInferenceDiffusers , nndeploy::base::kStatusCodeErrorInferenceDiff , nndeploy::base::kStatusCodeErrorInferenceOther ,
  nndeploy::base::kStatusCodeErrorDag , nndeploy::base::kStatusCodeNodeInterrupt
}
 

Functions

std::string nndeploy::base::statusCodeToString (StatusCode code)
 

Macro Definition Documentation

◆ NNDEPLOY_ASSERT

#define NNDEPLOY_ASSERT (   x)
Value:
{ \
int res = (x); \
if (!res) { \
NNDEPLOY_LOGE("Error: assert failed\n"); \
assert(res); \
} \
}

Definition at line 150 of file status.h.

◆ NNDEPLOY_CHECK_PARAM_NULL_RET_NULL

#define NNDEPLOY_CHECK_PARAM_NULL_RET_NULL (   param,
  str 
)
Value:
do { \
if (!param) { \
NNDEPLOY_LOGE("%s\n", str); \
return nullptr; \
} \
} while (0)

Definition at line 207 of file status.h.

◆ NNDEPLOY_CHECK_PARAM_NULL_RET_STATUS

#define NNDEPLOY_CHECK_PARAM_NULL_RET_STATUS (   param,
  str 
)
Value:
do { \
if (!param) { \
NNDEPLOY_LOGE("%s\n", str); \
} \
} while (0)
@ kStatusCodeErrorNullParam
Definition: status.h:22

Definition at line 199 of file status.h.

◆ NNDEPLOY_LOGD

#define NNDEPLOY_LOGD (   fmt,
  ... 
)

Definition at line 162 of file status.h.

◆ NNDEPLOY_LOGDT

#define NNDEPLOY_LOGDT (   fmt,
  tag,
  ... 
)

Definition at line 161 of file status.h.

◆ NNDEPLOY_RETURN_ON_EQ

#define NNDEPLOY_RETURN_ON_EQ (   status,
  expected,
  str 
)
Value:
do { \
if (status == (expected)) { \
NNDEPLOY_LOGE("%s\n", str); \
return status; \
} \
} while (0)

Definition at line 191 of file status.h.

◆ NNDEPLOY_RETURN_ON_NEQ

#define NNDEPLOY_RETURN_ON_NEQ (   status,
  expected,
  str 
)
Value:
do { \
if (status != (expected)) { \
NNDEPLOY_LOGE("%s\n", str); \
return status; \
} \
} while (0)

Definition at line 183 of file status.h.

◆ NNDEPLOY_RETURN_VALUE_ON_EQ

#define NNDEPLOY_RETURN_VALUE_ON_EQ (   status,
  expected,
  value,
  str 
)
Value:
do { \
if (status == (expected)) { \
NNDEPLOY_LOGE("%s\n", str); \
return (value); \
} \
} while (0)

Definition at line 175 of file status.h.

◆ NNDEPLOY_RETURN_VALUE_ON_NEQ

#define NNDEPLOY_RETURN_VALUE_ON_NEQ (   status,
  expected,
  value,
  str 
)
Value:
do { \
if (status != (expected)) { \
NNDEPLOY_LOGE("%s\n", str); \
return (value); \
} \
} while (0)

Definition at line 167 of file status.h.