ViSP  2.8.0
vpException Class Reference

#include <vpException.h>

+ Inheritance diagram for vpException:

Public Types

enum  generalExceptionEnum {
  memoryAllocationError, memoryFreeError, functionNotImplementedError, ioError,
  cannotUseConstructorError, notImplementedError, divideByZeroError, dimensionError,
  fatalError, badValue, notInitialized
}
 

Public Member Functions

 vpException (const int code, const char *msg)
 
 vpException (const int code, const std::string &msg)
 
 vpException (const int code)
 
virtual ~vpException () throw ()
 
int getCode (void)
 
const std::string & getStringMessage (void)
 
const char * getMessage (void)
 
const char * what () const throw ()
 

Friends

VISP_EXPORT std::ostream & operator<< (std::ostream &os, const vpException &art)
 

Detailed Description

error that can be emited by ViSP classes.

This class inherites from the standard std::exception contained in the C++ STL. It is therefore possible to catch vpException with any other derivative of std::exception in the same catch.

Examples:
AROgre.cpp, AROgreBasic.cpp, fernClassifier.cpp, grabV4l2.cpp, manServoMomentsSimple.cpp, servoMomentImage.cpp, servoMomentPoints.cpp, and servoMomentPolygon.cpp.

Definition at line 75 of file vpException.h.

Member Enumeration Documentation

Enumerator
memoryAllocationError 
memoryFreeError 
functionNotImplementedError 
ioError 
cannotUseConstructorError 
notImplementedError 
divideByZeroError 
dimensionError 
fatalError 
badValue 

Used to indicate that a value is not in the allowed range.

notInitialized 

Used to indicate that a parameter is not initialized.

Definition at line 93 of file vpException.h.

Constructor & Destructor Documentation

vpException::vpException ( const int  code,
const char *  msg 
)

Definition at line 76 of file vpException.cpp.

vpException::vpException ( const int  code,
const std::string &  msg 
)

Definition at line 65 of file vpException.cpp.

vpException::vpException ( const int  code)

Definition at line 55 of file vpException.cpp.

virtual vpException::~vpException ( )
throw (
)
inlinevirtual

Basic destructor. Do nothing but implemented to fit the inheritance from std::exception

Definition at line 116 of file vpException.h.

Member Function Documentation

int vpException::getCode ( void  )

send the object code

Examples:
parallelPort.cpp, and ringLight.cpp.

Definition at line 111 of file vpException.cpp.

const char * vpException::getMessage ( void  )

send a pointer on the array of char related to the error string. Cannot be NULL.

Examples:
fernClassifier.cpp, and grabV4l2.cpp.

Definition at line 100 of file vpException.cpp.

const std::string & vpException::getStringMessage ( void  )

send a reference (constant) related the error message (can be empty)

Definition at line 105 of file vpException.cpp.

const char * vpException::what ( ) const
throw (
)

Overloading of the what() method of std::exception to return the vpException message.

Returns
pointer on the array of char related to the error string.

Definition at line 122 of file vpException.cpp.

Friends And Related Function Documentation

VISP_EXPORT std::ostream& operator<< ( std::ostream &  os,
const vpException art 
)
friend

print the error structure

Definition at line 137 of file vpException.cpp.