NVIDIA DeepStream SDK API Reference

9.2 Release
sources/libs/ds3d/3rdparty/realsense2/include/librealsense2/hpp/rs_serializable_device.hpp
Go to the documentation of this file.
1 // License: Apache 2.0. See LICENSE file in root directory.
2 // Copyright(c) 2020 Intel Corporation. All Rights Reserved.
3 
4 #pragma once
5 #include "rs_types.hpp"
6 #include "rs_device.hpp"
7 #include <array>
8 #include <string>
9 
10 namespace rs2
11 {
13  {
14  public:
16  : rs2::device(d.get())
17  {
18  rs2_error* e = nullptr;
20  {
21  _dev = nullptr;
22  }
24  }
25 
26  std::string serialize_json() const
27  {
28  std::string results;
29 
30  rs2_error* e = nullptr;
31  std::shared_ptr<rs2_raw_data_buffer> json_data(
32  rs2_serialize_json(_dev.get(), &e),
35 
36  auto size = rs2_get_raw_data_size(json_data.get(), &e);
38 
39  auto start = rs2_get_raw_data(json_data.get(), &e);
41 
42  results.insert(results.begin(), start, start + size);
43 
44  return results;
45  }
46 
47  void load_json(const std::string& json_content) const
48  {
49  rs2_error* e = nullptr;
50  rs2_load_json(_dev.get(),
51  json_content.data(),
52  (unsigned int)json_content.size(),
53  &e);
55  }
56  };
57 }
rs2::device
Definition: sources/libs/ds3d/3rdparty/realsense2/include/librealsense2/hpp/rs_device.hpp:18
rs2::serializable_device::serializable_device
serializable_device(rs2::device d)
Definition: sources/libs/ds3d/3rdparty/realsense2/include/librealsense2/hpp/rs_serializable_device.hpp:15
RS2_EXTENSION_SERIALIZABLE
@ RS2_EXTENSION_SERIALIZABLE
Definition: sources/libs/ds3d/3rdparty/realsense2/include/librealsense2/h/rs_types.h:214
rs2_is_device_extendable_to
int rs2_is_device_extendable_to(const rs2_device *device, rs2_extension extension, rs2_error **error)
Test if the given device can be extended to the requested extension.
rs_types.hpp
rs_device.hpp
rs2::serializable_device::load_json
void load_json(const std::string &json_content) const
Definition: sources/libs/ds3d/3rdparty/realsense2/include/librealsense2/hpp/rs_serializable_device.hpp:47
rs2::serializable_device
Definition: sources/libs/ds3d/3rdparty/realsense2/include/librealsense2/hpp/rs_serializable_device.hpp:12
pydeepstreamdoc::osd::ArrowHeadDoc::start
constexpr const char * start
Definition: service-maker/sources/python/src/bindings/docstrings/osddoc.h:33
rs2::device::get
const std::shared_ptr< rs2_device > & get() const
Definition: sources/libs/ds3d/3rdparty/realsense2/include/librealsense2/hpp/rs_device.hpp:116
rs2
Definition: sources/libs/ds3d/3rdparty/realsense2/include/librealsense2/rs.hpp:17
rs2_delete_raw_data
void rs2_delete_raw_data(const rs2_raw_data_buffer *buffer)
Delete rs2_raw_data_buffer.
pydeepstreamdoc::tensor::TensorDoc::size
constexpr const char * size
Definition: service-maker/sources/python/src/bindings/docstrings/tensordoc.h:46
rs2_serialize_json
rs2_raw_data_buffer * rs2_serialize_json(rs2_device *dev, rs2_error **error)
rs2_get_raw_data_size
int rs2_get_raw_data_size(const rs2_raw_data_buffer *buffer, rs2_error **error)
get the size of rs2_raw_data_buffer
rs2::serializable_device::serialize_json
std::string serialize_json() const
Definition: sources/libs/ds3d/3rdparty/realsense2/include/librealsense2/hpp/rs_serializable_device.hpp:26
rs2::error::handle
static void handle(rs2_error *e)
Definition: sources/libs/ds3d/3rdparty/realsense2/include/librealsense2/hpp/rs_types.hpp:144
rs2::device::_dev
std::shared_ptr< rs2_device > _dev
Definition: sources/libs/ds3d/3rdparty/realsense2/include/librealsense2/hpp/rs_device.hpp:146
rs2_load_json
void rs2_load_json(rs2_device *dev, const void *json_content, unsigned content_size, rs2_error **error)
rs2_get_raw_data
const unsigned char * rs2_get_raw_data(const rs2_raw_data_buffer *buffer, rs2_error **error)
Retrieve char array from rs2_raw_data_buffer.
rs2_error
struct rs2_error rs2_error
Definition: sources/libs/ds3d/3rdparty/realsense2/include/librealsense2/h/rs_types.h:258