Loading...
Searching...
No Matches
safe_call.hpp
Go to the documentation of this file.
//
// Copyright 2011 Ettus Research LLC
// Copyright 2018 Ettus Research, a National Instruments Company
//
// SPDX-License-Identifier: GPL-3.0-or-later
//
#pragma once
#include <uhd/config.hpp>
#include <uhd/exception.hpp>
#include <uhd/utils/log.hpp>
#define _UHD_SAFE_CALL_WARNING(code, what) \
UHD_LOGGER_WARNING("UHD") << UHD_THROW_SITE_INFO("Exception caught in safe-call.") \
+ #code + " -> " + what;
#define UHD_SAFE_CALL(code) \
try { \
code; \
} catch (const std::exception& e) { \
_UHD_SAFE_CALL_WARNING(code, e.what()); \
} catch (...) { \
_UHD_SAFE_CALL_WARNING(code, "unknown exception"); \
}
config.hpp
exception.hpp
log.hpp