OpenCV 4.12.0
开源计算机视觉
加载中...
搜索中...
无匹配项

传递给错误的类。 更多...

#include <opencv2/core.hpp>

cv::Exception 的协作图

公共成员函数

 Exception ()
 
 Exception (int _code, const String &_err, const String &_func, const String &_file, int _line)
 
virtual ~Exception () noexcept
 
void formatMessage ()
 
virtual const char * what () const noexcept override
 

公共属性

int code
 错误代码
 
String err
 错误描述
 
String file
 发生错误的源文件名
 
String func
 函数名。仅当编译器支持获取它时才可用
 
int line
 源文件中发生错误的行号
 
String msg
 格式化的错误消息
 

详细描述

传递给错误的类。

此类封装了程序中发生的所有或几乎所有必要的错误信息。异常通常通过 CV_Error 和 CV_Error_ 宏隐式构造和抛出。

另请参见
错误
示例
samples/cpp/pca.cppsamples/tapi/hog.cpp

构造函数 & 析构函数文档

◆ Exception() [1/2]

cv::Exception::Exception ( )

默认构造函数

◆ Exception() [2/2]

cv::Exception::Exception ( int _code,
const String & _err,
const String & _func,
const String & _file,
int _line )

完整构造函数。通常不显式调用构造函数。而是使用宏 CV_Error()CV_Error_()CV_Assert()

◆ ~Exception()

virtual cv::Exception::~Exception ( )
virtualnoexcept

成员函数文档

◆ formatMessage()

void cv::Exception::formatMessage ( )

◆ what()

virtual const char * cv::Exception::what ( ) const
overridevirtualnoexcept
返回
错误描述和上下文,以文本字符串形式。
示例
samples/tapi/hog.cpp.

成员数据文档

◆ code

int cv::Exception::code

错误代码

另请参见
CVStatus

◆ err

String cv::Exception::err

错误描述

◆ file

String cv::Exception::file

发生错误的源文件名

◆ func

String cv::Exception::func

函数名。仅当编译器支持获取它时才可用

◆ line

int cv::Exception::line

源文件中发生错误的行号

◆ msg

String cv::Exception::msg

格式化的错误消息

示例
samples/cpp/pca.cpp.

此类文档由以下文件生成