#include "context.h"
#include "core/extension.h"
#include "device.h"
#include <type_traits>
#include <iostream>
Go to the source code of this file.
|
#define | BEGIN_API_CALL try |
|
#define | HANDLE_EXCEPTIONS_AND_RETURN(R, ...) catch(...) { std::ostringstream ss; librealsense::stream_args(ss, #__VA_ARGS__, __VA_ARGS__); librealsense::translate_exception(__FUNCTION__, ss.str(), error); return R; } |
|
#define | NOARGS_HANDLE_EXCEPTIONS_AND_RETURN(R) catch(...) { librealsense::translate_exception(__FUNCTION__, "", error); return R; } |
|
#define | NOARGS_HANDLE_EXCEPTIONS_AND_RETURN_VOID() catch(...) { librealsense::translate_exception(__FUNCTION__, "", error); } |
|
#define | NOEXCEPT_RETURN(R, ...) catch(...) { std::ostringstream ss; librealsense::stream_args(ss, #__VA_ARGS__, __VA_ARGS__); rs2_error* e; librealsense::translate_exception(__FUNCTION__, ss.str(), &e); LOG_WARNING(rs2_get_error_message(e)); rs2_free_error(e); return R; } |
|
#define | VALIDATE_ENUM(ARG) if(!librealsense::is_valid(ARG)) { std::ostringstream ss; ss << "invalid enum value for argument \"" #ARG "\""; throw librealsense::invalid_value_exception(ss.str()); } |
|
#define | VALIDATE_FIXED_SIZE(ARG, SIZE) if((ARG) != (SIZE)) { std::ostringstream ss; ss << "Unsupported size provided { " << ARG << " }," " expecting { " << SIZE << " }"; throw librealsense::invalid_value_exception(ss.str()); } |
|
#define | VALIDATE_INTERFACE(X, T) |
|
#define | VALIDATE_INTERFACE_NO_THROW(X, T) |
|
#define | VALIDATE_LE(ARG, MAX) if((ARG) > (MAX)) { std::ostringstream ss; ss << "out of range value for argument \"" #ARG "\""; throw std::runtime_error(ss.str()); } |
|
#define | VALIDATE_NOT_NULL(ARG) if(!(ARG)) throw std::runtime_error("null pointer passed for argument \"" #ARG "\""); |
|
#define | VALIDATE_OPTION(OBJ, OPT_ID) if(!OBJ->options->supports_option(OPT_ID)) { std::ostringstream ss; ss << "object doesn't support option #" << std::to_string(OPT_ID); throw librealsense::invalid_value_exception(ss.str()); } |
|
#define | VALIDATE_RANGE(ARG, MIN, MAX) if((ARG) < (MIN) || (ARG) > (MAX)) { std::ostringstream ss; ss << "out of range value for argument \"" #ARG "\""; throw librealsense::invalid_value_exception(ss.str()); } |
|
|
std::string | api_version_to_string (int version) |
|
int | lrs_major (int version) |
|
int | lrs_minor (int version) |
|
int | lrs_patch (int version) |
|
void | report_version_mismatch (int runtime, int compiletime) |
|
rs2_error * | rs2_create_error (const char *what, const char *name, const char *args, rs2_exception_type type) |
|
template<class T > |
void | librealsense::stream_args (std::ostream &out, const char *names, const T &last) |
|
template<class T , class... U> |
void | librealsense::stream_args (std::ostream &out, const char *names, const T &first, const U &...rest) |
|
static void | librealsense::translate_exception (const char *name, std::string args, rs2_error **error) |
|
void | verify_version_compatibility (int api_version) |
|
#define BEGIN_API_CALL try |
#define VALIDATE_FIXED_SIZE |
( |
|
ARG, |
|
|
|
SIZE |
|
) |
| if((ARG) != (SIZE)) { std::ostringstream ss; ss << "Unsupported size provided { " << ARG << " }," " expecting { " << SIZE << " }"; throw librealsense::invalid_value_exception(ss.str()); } |
#define VALIDATE_INTERFACE |
( |
|
X, |
|
|
|
T |
|
) |
| |
Value: if(p == nullptr) \
throw std::runtime_error(
"Object does not support \"" #
T "\" interface! " ); \
})()
#define VALIDATE_INTERFACE_NO_THROW(X, T)
Definition at line 428 of file api.h.
#define VALIDATE_INTERFACE_NO_THROW |
( |
|
X, |
|
|
|
T |
|
) |
| |
Value: T*
p =
dynamic_cast<T*
>(&(*X)); \
if (p == nullptr) \
{ \
if (ext == nullptr) return nullptr; \
else \
{ \
return nullptr; \
} \
} \
})()
Definition at line 411 of file api.h.
#define VALIDATE_LE |
( |
|
ARG, |
|
|
|
MAX |
|
) |
| if((ARG) > (MAX)) { std::ostringstream ss; ss << "out of range value for argument \"" #ARG "\""; throw std::runtime_error(ss.str()); } |
#define VALIDATE_NOT_NULL |
( |
|
ARG | ) |
if(!(ARG)) throw std::runtime_error("null pointer passed for argument \"" #ARG "\""); |
#define VALIDATE_OPTION |
( |
|
OBJ, |
|
|
|
OPT_ID |
|
) |
| if(!OBJ->options->supports_option(OPT_ID)) { std::ostringstream ss; ss << "object doesn't support option #" << std::to_string(OPT_ID); throw librealsense::invalid_value_exception(ss.str()); } |
Definition at line 18 of file api.h.
int lrs_major |
( |
int |
version | ) |
|
|
inline |
int lrs_minor |
( |
int |
version | ) |
|
|
inline |
int lrs_patch |
( |
int |
version | ) |
|
|
inline |
void report_version_mismatch |
( |
int |
runtime, |
|
|
int |
compiletime |
|
) |
| |
|
inline |
void verify_version_compatibility |
( |
int |
api_version | ) |
|
|
inline |