Visual Servoing Platform  version 3.1.0
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, grabRealSense2.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, mbtGenericTracking.cpp, mbtGenericTracking2.cpp, mbtGenericTrackingDepth.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, servoViper650FourPoints2DArtVelocityInteractionCurrent.cpp, servoViper650FourPoints2DCamVelocityInteractionCurrent-SR300.cpp, servoViper650FourPoints2DCamVelocityInteractionCurrent.cpp, servoViper650Point2DCamVelocity.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, testAprilTag.cpp, testAutoThreshold.cpp, testClient.cpp, testConnectedComponents.cpp, testContours.cpp, testConversion.cpp, testCrop.cpp, testCropAdvanced.cpp, testDisplacement.cpp, testDisplays.cpp, testFeature.cpp, testFeatureSegment.cpp, testFindMatch.cpp, testFloodFill.cpp, testHistogram.cpp, testImageAddSub.cpp, testImageComparison.cpp, testImageFilter.cpp, testImageMorphology.cpp, testImageResize.cpp, testImgproc.cpp, testIoPGM.cpp, testIoPPM.cpp, testIoTools.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, testMatrixDeterminant.cpp, testMatrixException.cpp, testMatrixInverse.cpp, testMatrixPseudoInverse.cpp, testNurbs.cpp, testPerformanceLUT.cpp, testPose.cpp, testPoseFeatures.cpp, testPoseRansac.cpp, testPoseRansac2.cpp, testReadImage.cpp, testRealSense_R200.cpp, testRealSense_SR300.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, testUDPClient.cpp, testUDPServer.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-apriltag-detector-live.cpp, tutorial-apriltag-detector.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-basler-pylon.cpp, tutorial-grabber-CMU1394.cpp, tutorial-grabber-flycapture.cpp, tutorial-grabber-opencv.cpp, tutorial-grabber-realsense.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-generic-tracker-stereo-mono.cpp, tutorial-mb-generic-tracker-stereo.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 71 of file vpException.h.

Member Enumeration Documentation

◆ generalExceptionEnum

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

Constructor & Destructor Documentation

◆ vpException() [1/5]

vpException::vpException ( )
inlineprotected

forbid the empty constructor (protected)

Definition at line 84 of file vpException.h.

◆ vpException() [2/5]

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

Definition at line 64 of file vpException.cpp.

References setMessage().

◆ vpException() [3/5]

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

Definition at line 56 of file vpException.cpp.

References setMessage().

◆ vpException() [4/5]

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

Definition at line 54 of file vpException.cpp.

◆ vpException() [5/5]

vpException::vpException ( const int  code)
explicit

Definition at line 52 of file vpException.cpp.

◆ ~vpException()

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

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

Definition at line 112 of file vpException.h.

Member Function Documentation

◆ getCode()

int vpException::getCode ( void  )

Send the object code.

Examples:
parallelPort.cpp, and ringLight.cpp.

Definition at line 94 of file vpException.cpp.

References code.

◆ getMessage()

◆ getStringMessage()

◆ setMessage()

◆ what()

Friends And Related Function Documentation

◆ operator<<

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

Print the error structure.

Definition at line 118 of file vpException.cpp.

Member Data Documentation

◆ code

int vpException::code
protected

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

Definition at line 75 of file vpException.h.

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

◆ message

std::string vpException::message
protected

Contains an error message (can be empty)

Definition at line 78 of file vpException.h.

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