Visual Servoing Platform  version 3.0.1
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
vpException Class Reference

#include <visp3/core/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 ()
 
const char * what () const throw ()
 
Inherited functionalities from vpException
int getCode (void)
 
const std::string & getStringMessage (void) const
 
const char * getMessage (void) const
 

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, grabFlyCapture.cpp, grabOpenCV.cpp, grabRealSense.cpp, grabV4l2.cpp, grabV4l2MultiCpp11Thread.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, mbtEdgeKltMultiTracking.cpp, mbtEdgeKltTracking.cpp, mbtEdgeMultiTracking.cpp, mbtEdgeTracking.cpp, mbtKltMultiTracking.cpp, mbtKltTracking.cpp, moveAfma4.cpp, moveBiclops.cpp, movePioneer.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, servoViper850Point2DArtVelocity-jointAvoidance-gpa.cpp, SickLDMRS-Acq.cpp, SickLDMRS-Process.cpp, simulateCircle2DCamVelocity.cpp, simulateFourPoints2DCartesianCamVelocity.cpp, simulateFourPoints2DPolarCamVelocity.cpp, sonarPioneerReader.cpp, templateTracker.cpp, testAfma4.cpp, testAfma6.cpp, testClient.cpp, testConversion.cpp, testCrop.cpp, testCropAdvanced.cpp, testDisplacement.cpp, testDisplays.cpp, testFeature.cpp, testFeatureSegment.cpp, testFindMatch.cpp, testHistogram.cpp, testImageAddSub.cpp, testImageComparison.cpp, testImageFilter.cpp, testImageMorphology.cpp, testImageResize.cpp, testIoPGM.cpp, testIoPPM.cpp, testKalmanAcceleration.cpp, testKalmanVelocity.cpp, testKeyPoint-2.cpp, testKeyPoint-3.cpp, testKeyPoint-4.cpp, testKeyPoint-5.cpp, testKeyPoint-6.cpp, testKeyPoint-7.cpp, testKeyPoint.cpp, testMatrix.cpp, testMatrixException.cpp, testMatrixInverse.cpp, testNurbs.cpp, testPerformanceLUT.cpp, testPose.cpp, testPoseFeatures.cpp, testPoseRansac.cpp, testPoseRansac2.cpp, testReadImage.cpp, testRealSense.cpp, testRobotAfma4.cpp, testRobotAfma6.cpp, testRobotAfma6Pose.cpp, testRobotViper650-frames.cpp, testRobotViper850-frames.cpp, testRobotViper850.cpp, testRobotViper850Pose.cpp, testRobust.cpp, testServer.cpp, testSurfKeyPoint.cpp, testSvd.cpp, testTime.cpp, testTrackDot.cpp, testTwistMatrix.cpp, testUndistortImage.cpp, testVideoDeviceDual.cpp, testViper650.cpp, testViper850.cpp, testVirtuose.cpp, testVirtuoseAfma6.cpp, testVirtuoseHapticBox.cpp, testVirtuoseJointLimits.cpp, testVirtuosePeriodicFunction.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-detection-object-mbt2.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-flycapture.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-display-scaled-auto.cpp, tutorial-image-display-scaled-manu.cpp, tutorial-image-display.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-mb-tracker-full.cpp, tutorial-mb-tracker-stereo-mono.cpp, tutorial-mb-tracker-stereo.cpp, tutorial-mb-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-pose-from-qrcode-image.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 73 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 91 of file vpException.h.

Constructor & Destructor Documentation

vpException::vpException ( )
inlineprotected

forbid the empty constructor (protected)

Definition at line 87 of file vpException.h.

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

Definition at line 69 of file vpException.cpp.

References setMessage().

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

Definition at line 60 of file vpException.cpp.

References setMessage().

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

Definition at line 55 of file vpException.cpp.

vpException::vpException ( const int  code)

Definition at line 50 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 108 of file vpException.cpp.

References code.

const std::string & vpException::getStringMessage ( void  ) const
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.
Examples:
grabV4l2MultiCpp11Thread.cpp, testHistogram.cpp, testImageFilter.cpp, testKeyPoint-2.cpp, testKeyPoint-3.cpp, testKeyPoint-4.cpp, testKeyPoint-5.cpp, testKeyPoint-6.cpp, testKeyPoint-7.cpp, testKeyPoint.cpp, testPerformanceLUT.cpp, and testRealSense.cpp.

Definition at line 119 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 134 of file vpException.cpp.

Member Data Documentation

int vpException::code
protected

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

Definition at line 78 of file vpException.h.

Referenced by getCode(), and vpSimulatorException::vpSimulatorException().

std::string vpException::message
protected

Contains an error message (can be empty)

Definition at line 81 of file vpException.h.

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