Intel® RealSense™ Cross Platform API
Intel Realsense Cross-platform API
Loading...
Searching...
No Matches
Namespaces | Macros | Functions
hresult.h File Reference
#include <string>
#include <Windows.h>
#include <functional>
#include <comdef.h>
#include <sstream>

Go to the source code of this file.

Namespaces

namespace  utilities
 
namespace  utilities::hresult
 

Macros

#define CHECK_HR_STR(call, hr)
 
#define LOG_HR_STR(call, hr)
 
#define CHECK_HR(x)   CHECK_HR_STR( #x, x )
 
#define LOG_HR(x)   LOG_HR_STR( #x, x )
 

Functions

std::string utilities::hresult::hr_to_string (HRESULT hr)
 

Macro Definition Documentation

◆ CHECK_HR

#define CHECK_HR (   x)    CHECK_HR_STR( #x, x )

◆ CHECK_HR_STR

#define CHECK_HR_STR (   call,
  hr 
)
Value:
if( FAILED( hr ) ) \
{ \
std::ostringstream ss; \
ss << call << " returned: " << utilities::hresult::hr_to_string( hr ); \
std::string descr = ss.str(); \
throw std::runtime_error( descr ); \
}
std::string hr_to_string(HRESULT hr)
Definition: hresult.h:15

◆ LOG_HR

#define LOG_HR (   x)    LOG_HR_STR( #x, x )

◆ LOG_HR_STR

#define LOG_HR_STR (   call,
  hr 
)
Value:
if( FAILED( hr ) ) \
{ \
std::ostringstream ss; \
ss << call << " returned: " << utilities::hresult::hr_to_string( hr ); \
std::string descr = ss.str(); \
LOG_DEBUG(descr); \
}