PLSSVM - Parallel Least Squares Support Vector Machine  2.0.0
A Least Squares Support Vector Machine implementation using different backends.
Public Member Functions | Private Attributes | List of all members
plssvm::exception Class Reference

Base class for all custom exception types. Forwards its message to std::runtime_error and saves the exception name and the call side source location information. More...

#include <exceptions.hpp>

Inheritance diagram for plssvm::exception:
[legend]
Collaboration diagram for plssvm::exception:
[legend]

Public Member Functions

 exception (const std::string &msg, std::string_view class_name="exception", source_location loc=source_location::current())
 Construct a new exception forwarding the exception message to std::runtime_error. More...
 
const source_locationloc () const noexcept
 Returns the information of the call side where the exception was thrown. More...
 
std::string what_with_loc () const
 Returns a string containing the exception's what() message, the name of the thrown exception class, and information about the call side where the exception has been thrown. More...
 

Private Attributes

std::string_view class_name_
 The name of the thrown exception class.
 
source_location loc_
 The call side source location information.
 

Detailed Description

Base class for all custom exception types. Forwards its message to std::runtime_error and saves the exception name and the call side source location information.

Constructor & Destructor Documentation

◆ exception()

plssvm::exception::exception ( const std::string &  msg,
std::string_view  class_name = "exception",
source_location  loc = source_location::current() 
)
explicit

Construct a new exception forwarding the exception message to std::runtime_error.

Parameters
[in]msgthe exception's what() message
[in]class_namethe name of the thrown exception class
[in]locthe exception's call side information

Member Function Documentation

◆ loc()

const source_location& plssvm::exception::loc ( ) const
noexcept

Returns the information of the call side where the exception was thrown.

Returns
the exception's call side information ([[nodiscard]])

◆ what_with_loc()

std::string plssvm::exception::what_with_loc ( ) const

Returns a string containing the exception's what() message, the name of the thrown exception class, and information about the call side where the exception has been thrown.

Returns
the exception's what() message including source location information ([[nodiscard]])

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