/* Copyright 2015-2020 The MathWorks, Inc. */ #ifndef MATLAB_EXCEPTION_HPP_ #define MATLAB_EXCEPTION_HPP_ #include "detail/ExceptionType.hpp" #include "detail/exception_interface.hpp" #include #include namespace matlab { /** * This is the base class for all External Data Interface exceptions. * * Concrete exception classes can inherit from std::exception or its subclasses (i.e. * std::bad_malloc) ONLY in cases when they are leaf classes. * */ class Exception { public: virtual ~Exception() MW_NOEXCEPT { } virtual const char* what() const MW_NOEXCEPT = 0; }; using OutOfMemoryException = data::detail::ArrayException; namespace data { using InvalidArrayIndexException = detail::ArrayException; using TypeMismatchException = detail::ArrayException; using InvalidArrayTypeException = detail::ArrayException; using InvalidMemoryLayoutException = detail::ArrayException; using InvalidDimensionsInRowMajorArrayException = detail::ArrayException; using InvalidTypeInRowMajorArrayException = detail::ArrayException; using SystemErrorException = detail::ArrayException; using InvalidFieldNameException = detail::ArrayException; using FailedToLoadLibMatlabDataArrayException = detail::ArrayException; using FailedToResolveSymbolException = detail::ArrayException; using WrongNumberOfEnumsSuppliedException = detail::ArrayException; using MustSpecifyClassNameException = detail::ArrayException; using TooManyIndicesProvidedException = detail::ArrayException; using NotEnoughIndicesProvidedException = detail::ArrayException; using StringIndexMustBeLastException = detail::ArrayException; using StringIndexNotValidException = detail::ArrayException; using CanOnlyUseOneStringIndexException = detail::ArrayException; using NonAsciiCharInInputDataException = detail::ArrayException; using NonAsciiCharInRequestedAsciiOutputException = detail::ArrayException; using InvalidDimensionsInSparseArrayException = detail::ArrayException; using DuplicateFieldNameInStructArrayException = detail::ArrayException; using CantIndexIntoEmptyArrayException = detail::ArrayException; using FeatureNotSupportedException = detail::ArrayException; using NumberOfElementsExceedsMaximumException = detail::ArrayException; using ObjectArrayIncompatibleTypesException = detail::ArrayException; using AccessingObjectNotSupportedException = detail::ArrayException; using InvalidNumberOfElementsProvidedException = detail::ArrayException; } // namespace data } // namespace matlab #endif