Loading...
Searching...
No Matches
exception.hpp File Reference
`#include <uhd/config.hpp>`
`#include <stdexcept>`
`#include <string>`
Include dependency graph for exception.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Classes

struct | uhd::exception
struct | uhd::assertion_error
struct | uhd::lookup_error
struct | uhd::index_error
struct | uhd::key_error
struct | uhd::type_error
struct | uhd::value_error
struct | uhd::narrowing_error
struct | uhd::runtime_error
struct | uhd::usb_error
struct | uhd::not_implemented_error
struct | uhd::access_error
struct | uhd::environment_error
struct | uhd::io_error
struct | uhd::os_error
struct | uhd::system_error
struct | uhd::syntax_error
struct | uhd::rfnoc_error
struct | uhd::op_failed
struct | uhd::op_timeout
struct | uhd::op_seqerr
struct | uhd::op_timerr
struct | uhd::resolve_error
struct | uhd::routing_error

## Namespaces

namespace | uhd

## Macros

#define | UHD_THROW_SITE_INFO(what)
#define | UHD_THROW_INVALID_CODE_PATH()
#define | UHD_ASSERT_THROW(code)

## Macro Definition Documentation

## UHD_ASSERT_THROW

#define UHD_ASSERT_THROW | ( |  | code | ) |

Value:
{ \
if (not(code)) \
throw uhd::assertion_error(UHD_THROW_SITE_INFO(#code)); \
}
UHD_THROW_SITE_INFO
#define UHD_THROW_SITE_INFO(what)
Definition exception.hpp:304
uhd::assertion_error
Definition exception.hpp:48

Assert the result of the code evaluation. If the code evaluates to false, throw an assertion error.

Parameters

  code | the code that resolved to a boolean

## UHD_THROW_INVALID_CODE_PATH

#define UHD_THROW_INVALID_CODE_PATH | ( |  | ) |

Value:
throw uhd::system_error(UHD_THROW_SITE_INFO("invalid code path"))
uhd::system_error
Definition exception.hpp:208

Throws an invalid code path exception with throw-site information. Use this macro in places that code execution is not supposed to go.

## UHD_THROW_SITE_INFO

#define UHD_THROW_SITE_INFO | ( |  | what | ) |

Value:
std::string(std::string(what) + "\n" + " in " + std::string(UHD_FUNCTION) + "\n" \
+ " at " + std::string(__FILE__) + ":" + std::to_string(__LINE__) \
+ "\n")
UHD_FUNCTION
#define UHD_FUNCTION
Definition config.hpp:127

Create a formatted string with throw-site information. Fills in the function name, file name, and line number.

Parameters

  what | the std::exception message

Returns
  the formatted exception message