LCOV - code coverage report
Current view: top level - include/Tools/Exception - exception.hpp (source / functions) Hit Total Coverage
Test: streampu_clean.info Lines: 0 1 0.0 %
Date: 2025-04-07 19:44:34 Functions: 0 2 0.0 %

          Line data    Source code
       1             : /*!
       2             :  * \file
       3             :  * \brief Class tools::exception.
       4             :  */
       5             : #ifndef EXCEPTION_HPP_
       6             : #define EXCEPTION_HPP_
       7             : 
       8             : #include <exception>
       9             : #include <string>
      10             : #ifdef SPU_STACKTRACE
      11             : #include <cpptrace/cpptrace.hpp>
      12             : #endif
      13             : 
      14             : #if !defined(SPU_EXPORT)
      15             : #if defined(WIN32) || defined(_WIN32)
      16             : #define SPU_EXPORT __declspec(dllexport)
      17             : #else
      18             : #define SPU_EXPORT __attribute__((visibility("default")))
      19             : #endif
      20             : #endif
      21             : 
      22             : #if !defined(SPU_EXPORT_EXCEPTION)
      23             : #if defined(__apple_build_version__)
      24             : #define SPU_EXPORT_EXCEPTION SPU_EXPORT
      25             : #else
      26             : #define SPU_EXPORT_EXCEPTION
      27             : #endif
      28             : #endif
      29             : 
      30             : namespace spu
      31             : {
      32             : namespace tools
      33             : {
      34             : #ifdef SPU_STACKTRACE
      35             : class exception : public cpptrace::exception_with_message
      36             : {
      37             : #else
      38             : class SPU_EXPORT_EXCEPTION exception : public std::exception
      39             : {
      40             : #endif
      41             :   public:
      42             :     static bool no_stacktrace;
      43             : 
      44             :   private:
      45             : #ifdef SPU_STACKTRACE
      46             :     mutable std::string what_string;
      47             : #else
      48             :     std::string message; // the message only
      49             : #endif
      50             : 
      51             :   public:
      52             :     exception() noexcept;
      53             :     explicit exception(std::string&& message) noexcept;
      54             :     exception(std::string&& filename, int&& line_num, std::string&& funcname = "", std::string&& message = "") noexcept;
      55             : 
      56           0 :     virtual ~exception() = default;
      57             : 
      58             :     const char* what() const noexcept override; // return the message and the back trace if enabled
      59             : };
      60             : }
      61             : }
      62             : 
      63             : // include specific exceptions
      64             : #include "Tools/Exception/cannot_allocate/cannot_allocate.hpp"
      65             : #include "Tools/Exception/control_flow_error/control_flow_error.hpp"
      66             : #include "Tools/Exception/domain_error/domain_error.hpp"
      67             : #include "Tools/Exception/invalid_argument/invalid_argument.hpp"
      68             : #include "Tools/Exception/length_error/length_error.hpp"
      69             : #include "Tools/Exception/logic_error/logic_error.hpp"
      70             : #include "Tools/Exception/out_of_range/out_of_range.hpp"
      71             : #include "Tools/Exception/overflow_error/overflow_error.hpp"
      72             : #include "Tools/Exception/processing_aborted/processing_aborted.hpp"
      73             : #include "Tools/Exception/range_error/range_error.hpp"
      74             : #include "Tools/Exception/runtime_error/runtime_error.hpp"
      75             : #include "Tools/Exception/underflow_error/underflow_error.hpp"
      76             : #include "Tools/Exception/unimplemented_error/unimplemented_error.hpp"
      77             : #include "Tools/Exception/waiting_canceled/waiting_canceled.hpp"
      78             : 
      79             : #endif /* EXCEPTION_HPP_ */

Generated by: LCOV version 1.14