OpenCV 4.13.0
开源计算机视觉库 (Open Source Computer Vision)
正在加载...
正在搜索...
未找到匹配项

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

#include <opencv2/core.hpp>

cv::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
 格式化错误消息
 

详细说明

Class passed to an error.

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

另请参阅
错误
示例
samples/cpp/pca.cpp, 和 samples/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.

该类的文档由以下文件生成: