ViSP  2.10.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 *format, va_list args)
 
 vpException (const int code, const char *format,...)
 
 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 ()
 

Protected Member Functions

void setMessage (const char *format, va_list args)
 
 vpException ()
 

Protected Attributes

int code
 
std::string message
 

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, BSpline.cpp, calibrateTsai.cpp, displayD3D.cpp, displayGTK.cpp, displayOpenCV.cpp, displaySequence.cpp, displayX.cpp, displayXMulti.cpp, exponentialMap.cpp, fernClassifier.cpp, grab1394CMU.cpp, grab1394Two.cpp, grabDirectShow.cpp, grabDirectShowMulti.cpp, grabDisk.cpp, grabOpenCV-2.cpp, grabV4l2.cpp, HelloWorldOgre.cpp, HelloWorldOgreAdvanced.cpp, histogram.cpp, homographyHartleyDLT2DObject.cpp, homographyHLM2DObject.cpp, homographyHLM3DObject.cpp, homographyRansac2DObject.cpp, imageDiskRW.cpp, imageSequenceReader.cpp, keyPointSurf.cpp, kinectAcquisition.cpp, manDisplay.cpp, manGeometricFeatures.cpp, manGrab1394-2.cpp, manGrabDirectShow.cpp, manGrabDisk.cpp, manGrabV4l2.cpp, manServo4PointsDisplay.cpp, manServoMomentsSimple.cpp, manSimu4Dots.cpp, manSimu4Points.cpp, mbtEdgeKltTracking.cpp, mbtEdgeTracking.cpp, mbtKltTracking.cpp, moveAfma4.cpp, movePioneer.cpp, Nurbs.cpp, parse-argv1.cpp, parse-argv2.cpp, photometricVisualServoing.cpp, planarObjectDetector.cpp, plot2d.cpp, plot3d.cpp, poseVirtualVS.cpp, servoAfma4Point2DArtVelocity.cpp, servoAfma4Point2DCamVelocity.cpp, servoAfma4Point2DCamVelocityKalman.cpp, servoMomentImage.cpp, servoMomentPoints.cpp, servoMomentPolygon.cpp, servoPioneerPanSegment3D.cpp, servoPioneerPoint2DDepth.cpp, servoPioneerPoint2DDepthWithoutVpServo.cpp, servoSimu3D_cdMc_CamVelocity.cpp, servoSimu3D_cdMc_CamVelocityWithoutVpServo.cpp, servoSimu3D_cMcd_CamVelocity.cpp, servoSimu3D_cMcd_CamVelocityWithoutVpServo.cpp, servoSimu4Points.cpp, servoSimuAfma6FourPoints2DCamVelocity.cpp, servoSimuCircle2DCamVelocity.cpp, servoSimuCircle2DCamVelocityDisplay.cpp, servoSimuCylinder.cpp, servoSimuCylinder2DCamVelocityDisplay.cpp, servoSimuCylinder2DCamVelocityDisplaySecondaryTask.cpp, servoSimuFourPoints2DCamVelocity.cpp, servoSimuFourPoints2DCamVelocityDisplay.cpp, servoSimuFourPoints2DPolarCamVelocityDisplay.cpp, servoSimuLine2DCamVelocityDisplay.cpp, servoSimuPoint2DCamVelocity1.cpp, servoSimuPoint2DCamVelocity2.cpp, servoSimuPoint2DCamVelocity3.cpp, servoSimuPoint2DhalfCamVelocity1.cpp, servoSimuPoint2DhalfCamVelocity2.cpp, servoSimuPoint2DhalfCamVelocity3.cpp, servoSimuPoint3DCamVelocity.cpp, servoSimuSphere.cpp, servoSimuSphere2DCamVelocity.cpp, servoSimuSphere2DCamVelocitySecondaryTask.cpp, servoSimuSquareLine2DCamVelocityDisplay.cpp, servoSimuThetaUCamVelocity.cpp, servoSimuViper850FourPoints2DCamVelocity.cpp, SickLDMRS-Acq.cpp, SickLDMRS-Process.cpp, simulateCircle2DCamVelocity.cpp, simulateFourPoints2DCartesianCamVelocity.cpp, simulateFourPoints2DPolarCamVelocity.cpp, sonarPioneerReader.cpp, templateTracker.cpp, testAfma4.cpp, testAfma6.cpp, testClient.cpp, testColvector.cpp, testConversion.cpp, testCreateSubImage.cpp, testDisplacement.cpp, testFeature.cpp, testFeatureSegment.cpp, testFindMatch.cpp, testIoPGM.cpp, testIoPPM.cpp, testKalmanAcceleration.cpp, testKalmanVelocity.cpp, testMatrix.cpp, testMatrixException.cpp, testMatrixInverse.cpp, testPose.cpp, testPoseFeatures.cpp, testPoseRansac.cpp, testReadImage.cpp, testRobotAfma4.cpp, testRobotAfma6.cpp, testRobotAfma6Pose.cpp, testRobotViper850.cpp, testRobotViper850Pose.cpp, testRobust.cpp, testServer.cpp, testSurfKeyPoint.cpp, testSvd.cpp, testTime.cpp, testTrackDot.cpp, testTwistMatrix.cpp, testUndistortImage.cpp, testVideoDeviceDual.cpp, testViper850.cpp, testXmlParser.cpp, trackDot.cpp, trackDot2.cpp, trackDot2WithAutoDetection.cpp, trackKltOpencv.cpp, trackMeCircle.cpp, trackMeEllipse.cpp, trackMeLine.cpp, trackMeNurbs.cpp, tutorial-barcode-detector-live.cpp, tutorial-barcode-detector.cpp, tutorial-blob-auto-tracker.cpp, tutorial-detection-object-mbt.cpp, tutorial-face-detector-live.cpp, tutorial-face-detector.cpp, tutorial-grabber-1394-writer.cpp, tutorial-grabber-1394.cpp, tutorial-grabber-CMU1394.cpp, tutorial-grabber-opencv-bis.cpp, tutorial-grabber-opencv.cpp, tutorial-grabber-v4l2.cpp, tutorial-ibvs-4pts-display.cpp, tutorial-ibvs-4pts-image-tracking.cpp, tutorial-ibvs-4pts-ogre-tracking.cpp, tutorial-ibvs-4pts-ogre.cpp, tutorial-ibvs-4pts-plotter-continuous-gain-adaptive.cpp, tutorial-ibvs-4pts-plotter-gain-adaptive.cpp, tutorial-ibvs-4pts-plotter.cpp, tutorial-ibvs-4pts-wireframe-camera.cpp, tutorial-ibvs-4pts-wireframe-robot-afma6.cpp, tutorial-ibvs-4pts-wireframe-robot-viper.cpp, tutorial-ibvs-4pts.cpp, tutorial-image-converter.cpp, tutorial-image-filter.cpp, tutorial-image-manipulation.cpp, tutorial-image-reader.cpp, tutorial-image-simulator.cpp, tutorial-image-viewer.cpp, tutorial-klt-tracker-live-v4l2.cpp, tutorial-klt-tracker-with-reinit.cpp, tutorial-klt-tracker.cpp, tutorial-mb-edge-tracker.cpp, tutorial-mb-hybrid-tracker.cpp, tutorial-mb-klt-tracker.cpp, tutorial-me-ellipse-tracker.cpp, tutorial-me-line-tracker.cpp, tutorial-pioneer-robot.cpp, tutorial-pose-from-points-image.cpp, tutorial-pose-from-points-tracking.cpp, tutorial-simu-pioneer-continuous-gain-adaptive.cpp, tutorial-simu-pioneer-continuous-gain-constant.cpp, tutorial-simu-pioneer-pan.cpp, tutorial-simu-pioneer.cpp, tutorial-undistort.cpp, tutorial-video-reader.cpp, tutorial-video-recorder.cpp, tutorial-viewer.cpp, videoReader.cpp, and wireframeSimulator.cpp.

Definition at line 76 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 94 of file vpException.h.

Constructor & Destructor Documentation

vpException::vpException ( )
inlineprotected

forbid the empty constructor (protected)

Definition at line 90 of file vpException.h.

vpException::vpException ( const int  code,
const char *  format,
va_list  args 
)

Definition at line 73 of file vpException.cpp.

References setMessage().

vpException::vpException ( const int  code,
const char *  format,
  ... 
)

Definition at line 64 of file vpException.cpp.

References setMessage().

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

Definition at line 59 of file vpException.cpp.

vpException::vpException ( const int  code)

Definition at line 54 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 118 of file vpException.h.

Member Function Documentation

int vpException::getCode ( void  )

send the object code

Examples:
parallelPort.cpp, and ringLight.cpp.

Definition at line 112 of file vpException.cpp.

References code.

const char * vpException::getMessage ( void  )

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

Examples:
fernClassifier.cpp, tutorial-face-detector-live.cpp, tutorial-face-detector.cpp, tutorial-image-reader.cpp, and tutorial-video-reader.cpp.

Definition at line 101 of file vpException.cpp.

References message.

Referenced by vpTemplateTracker::trackPyr().

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

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

Definition at line 106 of file vpException.cpp.

References message.

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

References message.

Referenced by vpKeyPoint::computePose().

Friends And Related Function Documentation

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

print the error structure

Definition at line 138 of file vpException.cpp.

Member Data Documentation

int vpException::code
protected

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

Definition at line 81 of file vpException.h.

Referenced by getCode().

std::string vpException::message
protected

Contains an error message (can be empty)

Definition at line 84 of file vpException.h.

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