ViSP  2.6.2
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

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 92 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 115 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.