RealSenseNative.h
Go to the documentation of this file.
1 #pragma once
2 
3 #pragma warning(push)
4 #pragma warning(disable: 4456)
5 #pragma warning(disable: 4458)
6 #pragma warning(disable: 4577)
7 #include <librealsense2/rs.hpp>
8 #pragma warning(pop)
9 
10 namespace rs2 {
11 
12 inline void release_context_ref(rs2_context* Handle) {} // do nothing
13 
14 class context_ref : public context {
15 public:
16  context_ref(rs2_context* Handle) : context(std::shared_ptr<rs2_context>(Handle, release_context_ref)) { }
17 };
18 
19 class error_ref {
20 public:
21  inline error_ref() : m_error(nullptr) {}
22  inline ~error_ref() { release(); }
23  inline void release() { if (m_error) { rs2_free_error(m_error); m_error = nullptr; } }
24  inline rs2_error** operator&() { release(); return &m_error; }
25 
26  inline bool success() const { return m_error ? false : true; }
27  inline const char* get_message() const { return rs2_get_error_message(m_error); }
29 private:
31 };
32 
33 } // namespace
const char * get_message() const
rs2_exception_type
Exception types are the different categories of errors that RealSense API might return.
Definition: rs_types.h:30
void rs2_free_error(rs2_error *error)
Definition: rs.cpp:1256
void release_context_ref(rs2_context *Handle)
context_ref(rs2_context *Handle)
rs2_exception_type get_type() const
Definition: cah-model.h:10
bool success() const
const char * rs2_get_error_message(const rs2_error *error)
Definition: rs.cpp:1259
rs2_exception_type rs2_get_librealsense_exception_type(const rs2_error *error)
Definition: rs.cpp:1260
rs2_error ** operator&()
rs2_error * m_error


librealsense2
Author(s): Sergey Dorodnicov , Doron Hirshberg , Mark Horn , Reagan Lopez , Itay Carpis
autogenerated on Mon May 3 2021 02:47:39