RealSense Cross Platform API
RealSense Cross-platform API
Toggle main menu visibility
Loading...
Searching...
No Matches
include
librealsense2
hpp
rs_rum.hpp
Go to the documentation of this file.
1
// License: Apache 2.0. See LICENSE file in root directory.
2
// Copyright(c) 2026 RealSense, Inc. All Rights Reserved.
3
4
#ifndef LIBREALSENSE_RS2_RUM_HPP
5
#define LIBREALSENSE_RS2_RUM_HPP
6
7
#include "
rs_types.hpp
"
8
#include "
../h/rs_rum.h
"
9
10
#include <string>
11
#include <memory>
12
13
namespace
rs2
14
{
15
namespace
rum
16
{
17
// Path of the on-disk RUM report file (read that file to inspect or upload the report).
18
inline
std::string
get_report_path
()
19
{
20
rs2_error
* e =
nullptr
;
21
std::shared_ptr<const rs2_raw_data_buffer> buffer(
22
rs2_rum_get_report_path
(&e),
rs2_delete_raw_data
);
23
error::handle
(e);
24
if
(!buffer)
25
return
std::string();
26
auto
size =
rs2_get_raw_data_size
(buffer.get(), &e);
27
error::handle
(e);
28
auto
data =
rs2_get_raw_data
(buffer.get(), &e);
29
error::handle
(e);
30
if
(!data)
31
return
std::string();
32
return
std::string(
reinterpret_cast<
const
char
*
>
(data), size);
33
}
34
35
// Set the cloud-upload consent flag; persists to the per-user config file.
36
inline
void
set_cloud_enabled
(
bool
enabled)
37
{
38
rs2_error
* e =
nullptr
;
39
rs2_rum_set_cloud_enabled
(enabled ? 1 : 0, &e);
40
error::handle
(e);
41
}
42
43
// Resolved cloud-upload consent (env var overrides the config file).
44
inline
bool
is_cloud_enabled
()
45
{
46
rs2_error
* e =
nullptr
;
47
auto
enabled =
rs2_rum_is_cloud_enabled
(&e);
48
error::handle
(e);
49
return
enabled != 0;
50
}
51
}
52
}
53
54
#endif
// LIBREALSENSE_RS2_RUM_HPP
rs2::error::handle
static void handle(rs2_error *e)
Definition
rs_types.hpp:162
rs2::rum
Definition
rs_rum.hpp:16
rs2::rum::is_cloud_enabled
bool is_cloud_enabled()
Definition
rs_rum.hpp:44
rs2::rum::set_cloud_enabled
void set_cloud_enabled(bool enabled)
Definition
rs_rum.hpp:36
rs2::rum::get_report_path
std::string get_report_path()
Definition
rs_rum.hpp:18
rs2
Definition
rs_processing_gl.hpp:13
rs2_get_raw_data
const unsigned char * rs2_get_raw_data(const rs2_raw_data_buffer *buffer, rs2_error **error)
rs2_get_raw_data_size
int rs2_get_raw_data_size(const rs2_raw_data_buffer *buffer, rs2_error **error)
rs2_delete_raw_data
void rs2_delete_raw_data(const rs2_raw_data_buffer *buffer)
rs_rum.h
Exposes RUM (Real User Monitoring) functionality for C compilers.
rs2_rum_is_cloud_enabled
int rs2_rum_is_cloud_enabled(rs2_error **error)
rs2_rum_get_report_path
const rs2_raw_data_buffer * rs2_rum_get_report_path(rs2_error **error)
rs2_rum_set_cloud_enabled
void rs2_rum_set_cloud_enabled(int enabled, rs2_error **error)
rs2_error
struct rs2_error rs2_error
Definition
rs_types.h:296
rs_types.hpp
Generated by
1.18.0