A high-performance general-purpose compute library
exception Class Reference

An ArrayFire exception class. More...

#include <exception.h>

Inheritance diagram for exception:

Public Member Functions

af_err err ()
 
 exception ()
 
 exception (const char *msg)
 Creates a new af::exception given a message. The error code is AF_ERR_UNKNOWN. More...
 
 exception (const char *file, unsigned line, af_err err)
 Creates a new exception with a formatted error message for a given file and line number in the source code. More...
 
 exception (const char *msg, const char *file, unsigned line, af_err err)
 Creates a new af::exception with a formatted error message for a given an error code, file and line number in the source code. More...
 
 exception (const char *msg, const char *func, const char *file, unsigned line, af_err err)
 Creates a new exception given a message, function name, file name, line number and error code. More...
 
virtual ~exception () throw ()
 
virtual const char * what () const throw ()
 Returns an error message for the exception in a string format. More...
 

Friends

std::ostream & operator<< (std::ostream &s, const exception &e)
 Writes the exception to a stream. More...
 

Detailed Description

An ArrayFire exception class.

Examples
benchmarks/blas.cpp, benchmarks/fft.cpp, benchmarks/pi.cpp, computer_vision/fast.cpp, computer_vision/harris.cpp, computer_vision/matching.cpp, computer_vision/susan.cpp, financial/black_scholes_options.cpp, financial/heston_model.cpp, financial/monte_carlo_options.cpp, getting_started/convolve.cpp, getting_started/integer.cpp, getting_started/rainfall.cpp, getting_started/vectorize.cpp, graphics/conway.cpp, graphics/conway_pretty.cpp, graphics/field.cpp, graphics/fractal.cpp, graphics/gravity_sim.cpp, graphics/histogram.cpp, graphics/plot2d.cpp, graphics/plot3.cpp, graphics/surface.cpp, helloworld/helloworld.cpp, image_processing/adaptive_thresholding.cpp, image_processing/binary_thresholding.cpp, image_processing/brain_segmentation.cpp, image_processing/confidence_connected_components.cpp, image_processing/deconvolution.cpp, image_processing/edge.cpp, image_processing/filters.cpp, image_processing/gradient_diffusion.cpp, image_processing/image_demo.cpp, image_processing/image_editing.cpp, image_processing/morphing.cpp, image_processing/optical_flow.cpp, image_processing/pyramids.cpp, lin_algebra/cholesky.cpp, lin_algebra/lu.cpp, lin_algebra/qr.cpp, lin_algebra/svd.cpp, machine_learning/bagging.cpp, machine_learning/deep_belief_net.cpp, machine_learning/geneticalgorithm.cpp, machine_learning/kmeans.cpp, machine_learning/knn.cpp, machine_learning/logistic_regression.cpp, machine_learning/naive_bayes.cpp, machine_learning/neural_network.cpp, machine_learning/perceptron.cpp, machine_learning/rbm.cpp, machine_learning/softmax_regression.cpp, pde/swe.cpp, and unified/basic.cpp.

Definition at line 21 of file exception.h.

Constructor & Destructor Documentation

◆ exception() [1/5]

exception ( )

◆ exception() [2/5]

exception ( const char *  msg)

Creates a new af::exception given a message. The error code is AF_ERR_UNKNOWN.

◆ exception() [3/5]

exception ( const char *  file,
unsigned  line,
af_err  err 
)

Creates a new exception with a formatted error message for a given file and line number in the source code.

◆ exception() [4/5]

exception ( const char *  msg,
const char *  file,
unsigned  line,
af_err  err 
)

Creates a new af::exception with a formatted error message for a given an error code, file and line number in the source code.

◆ exception() [5/5]

exception ( const char *  msg,
const char *  func,
const char *  file,
unsigned  line,
af_err  err 
)

Creates a new exception given a message, function name, file name, line number and error code.

◆ ~exception()

virtual ~exception ( )
throw (
)
inlinevirtual

Definition at line 44 of file exception.h.

44{}

Member Function Documentation

◆ err()

af_err err ( )
inline

Definition at line 27 of file exception.h.

27{ return m_err; }

◆ what()

virtual const char * what ( ) const
throw (
)
inlinevirtual

Returns an error message for the exception in a string format.

Examples
benchmarks/blas.cpp, benchmarks/fft.cpp, benchmarks/pi.cpp, computer_vision/fast.cpp, computer_vision/harris.cpp, computer_vision/matching.cpp, computer_vision/susan.cpp, financial/black_scholes_options.cpp, financial/heston_model.cpp, financial/monte_carlo_options.cpp, getting_started/convolve.cpp, getting_started/integer.cpp, getting_started/rainfall.cpp, getting_started/vectorize.cpp, graphics/conway.cpp, graphics/conway_pretty.cpp, graphics/field.cpp, graphics/fractal.cpp, graphics/gravity_sim.cpp, graphics/histogram.cpp, graphics/plot2d.cpp, graphics/plot3.cpp, graphics/surface.cpp, helloworld/helloworld.cpp, image_processing/adaptive_thresholding.cpp, image_processing/binary_thresholding.cpp, image_processing/brain_segmentation.cpp, image_processing/confidence_connected_components.cpp, image_processing/deconvolution.cpp, image_processing/edge.cpp, image_processing/filters.cpp, image_processing/gradient_diffusion.cpp, image_processing/image_demo.cpp, image_processing/image_editing.cpp, image_processing/morphing.cpp, image_processing/optical_flow.cpp, image_processing/pyramids.cpp, lin_algebra/cholesky.cpp, lin_algebra/lu.cpp, lin_algebra/qr.cpp, lin_algebra/svd.cpp, machine_learning/bagging.cpp, machine_learning/deep_belief_net.cpp, machine_learning/geneticalgorithm.cpp, machine_learning/kmeans.cpp, machine_learning/knn.cpp, machine_learning/logistic_regression.cpp, machine_learning/naive_bayes.cpp, machine_learning/neural_network.cpp, machine_learning/perceptron.cpp, machine_learning/rbm.cpp, machine_learning/softmax_regression.cpp, pde/swe.cpp, and unified/basic.cpp.

Definition at line 46 of file exception.h.

46{ return m_msg; }

Friends And Related Function Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  s,
const exception e 
)
friend

Writes the exception to a stream.

Definition at line 49 of file exception.h.

50 { return s << e.what(); }

The documentation for this class was generated from the following file: