ViSP  2.9.0
vpImageException Class Reference

#include <vpImageException.h>

+ Inheritance diagram for vpImageException:

Public Types

enum  errorImageCodeEnum {
  ioError, noFileNameError, notInitializedError, incorrectInitializationError,
  notInTheImage
}
 
enum  generalExceptionEnum {
  memoryAllocationError, memoryFreeError, functionNotImplementedError, ioError,
  cannotUseConstructorError, notImplementedError, divideByZeroError, dimensionError,
  fatalError, badValue, notInitialized
}
 

Public Member Functions

 vpImageException (const int id, const char *format,...)
 
 vpImageException (const int id, const std::string &msg)
 
 vpImageException (const int id)
 
int getCode (void)
 
const std::string & getStringMessage (void)
 
const char * getMessage (void)
 
const char * what () const throw ()
 

Protected Member Functions

void setMessage (const char *format, va_list args)
 

Protected Attributes

int code
 
std::string message
 

Detailed Description

Error that can be emited by the vpImage class and its derivates.

Examples:
testIoPPM.cpp.

Definition at line 74 of file vpImageException.h.

Member Enumeration Documentation

Lists the possible error than can be emmited while calling vpImage member.

Enumerator
ioError 
noFileNameError 
notInitializedError 
incorrectInitializationError 
notInTheImage 

Definition at line 81 of file vpImageException.h.

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 94 of file vpException.h.

Constructor & Destructor Documentation

vpImageException::vpImageException ( const int  id,
const char *  format,
  ... 
)
inline

Definition at line 91 of file vpImageException.h.

References vpException::setMessage().

vpImageException::vpImageException ( const int  id,
const std::string &  msg 
)
inline

Definition at line 99 of file vpImageException.h.

vpImageException::vpImageException ( const int  id)
inline

Definition at line 101 of file vpImageException.h.

Member Function Documentation

int vpException::getCode ( void  )
inherited

send the object code

Examples:
parallelPort.cpp, and ringLight.cpp.

Definition at line 112 of file vpException.cpp.

References vpException::code.

const char * vpException::getMessage ( void  )
inherited

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

Examples:
fernClassifier.cpp, and tutorial-image-reader.cpp.

Definition at line 101 of file vpException.cpp.

References vpException::message.

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

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

Definition at line 106 of file vpException.cpp.

References vpException::message.

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

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 123 of file vpException.cpp.

References vpException::message.

Member Data Documentation

int vpException::code
protectedinherited

Contains the error code, see the errorCodeEnum table for details.

Definition at line 81 of file vpException.h.

Referenced by vpException::getCode(), and vpParallelPortException::vpParallelPortException().

std::string vpException::message
protectedinherited

Contains an error message (can be empty)

Definition at line 84 of file vpException.h.

Referenced by vpException::getMessage(), vpException::getStringMessage(), vpException::setMessage(), and vpException::what().