cv::Exception Class Reference 核心功能 » 实用程序、系统函数及宏


Class passed to an error. 更多...

#include <opencv2/core.hpp>

Inheritance diagram for cv::Exception:

Public Member Functions

  Exception ()
 
  Exception (int _code, const 字符串 &_err, const 字符串 &_func, const 字符串 &_file, int _line)
 
virtual  ~Exception () throw ()
 
void  formatMessage ()
 
virtual const char *  what () const CV_OVERRIDE throw ()
 

Public Attributes

int  code
  error code 更多...
 
字符串   err
  error description 更多...
 
字符串   file
  source file name where the error has occurred 更多...
 
字符串   func
  function name. Available only when the compiler supports getting it 更多...
 
int  line
  line number in the source file where the error has occurred 更多...
 
字符串   msg
  the formatted error message 更多...
 

详细描述

Class passed to an error.

This class encapsulates all or almost all necessary information about the error happened in the program. The exception is usually constructed and thrown implicitly via CV_Error and CV_Error_ macros.

另请参阅
error
范例:
samples/cpp/pca.cpp ,和 samples/tapi/hog.cpp .

Constructor & Destructor Documentation

◆  Exception() [1/2]

cv::Exception::Exception ( )

Default constructor

◆  Exception() [2/2]

cv::Exception::Exception ( int  _code ,
const 字符串 _err ,
const 字符串 _func ,
const 字符串 _file ,
int  _line  
)

Full constructor. Normally the constructor is not called explicitly. Instead, the macros CV_Error() , CV_Error_() and CV_Assert() are used.

◆  ~Exception()

virtual cv::Exception::~Exception ( )
throw (
)
virtual

成员函数文档编制

◆  formatMessage()

void cv::Exception::formatMessage ( )

◆  what()

virtual const char* cv::Exception::what ( ) const
throw (
)
virtual
返回
the error description and the context as a text string.
范例:
samples/tapi/hog.cpp .

Member Data Documentation

◆  code

int cv::Exception::code

error code

另请参阅
CVStatus

◆  err

字符串 cv::Exception::err

error description

◆  file

字符串 cv::Exception::file

source file name where the error has occurred

◆  func

字符串 cv::Exception::func

function name. Available only when the compiler supports getting it

◆  line

int cv::Exception::line

line number in the source file where the error has occurred

◆  msg

字符串 cv::Exception::msg

the formatted error message

范例:
samples/cpp/pca.cpp .

The documentation for this class was generated from the following file: