Intel® RealSense™ Cross Platform API
Intel Realsense Cross-platform API
include
librealsense2-net
rs_net.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
#ifndef LIBREALSENSE_RS2_NET_HPP
5
#define LIBREALSENSE_RS2_NET_HPP
6
7
#include <
librealsense2/rs.hpp
>
8
#include "
rs_net.h
"
9
10
#include <memory>
11
12
namespace
rs2
13
{
14
class
net_device
:
public
rs2::device
15
{
16
public
:
17
net_device
(
const
std::string& address) :
rs2
::
device
(init(address)) { }
18
26
void
add_to
(
context
& ctx)
27
{
28
rs2_error
* e =
nullptr
;
29
rs2_context_add_software_device
(((std::shared_ptr<rs2_context>)ctx).
get
(),
_dev
.get(), &e);
30
error::handle
(e);
31
}
32
33
34
private
:
35
std::shared_ptr<rs2_device> init(
const
std::string& address)
36
{
37
rs2_error
* e =
nullptr
;
38
auto
dev = std::shared_ptr<rs2_device>(
39
rs2_create_net_device
(
RS2_API_VERSION
, address.c_str(), &e),
40
rs2_delete_device
);
41
error::handle
(e);
42
43
return
dev;
44
}
45
};
46
}
47
#endif // LIBREALSENSE_RS2_NET_HPP
rs2::device
Definition:
rs_device.hpp:19
rs2_context_add_software_device
void rs2_context_add_software_device(rs2_context *ctx, rs2_device *dev, rs2_error **error)
rs_net.h
rs2::device::get
const std::shared_ptr< rs2_device > & get() const
Definition:
rs_device.hpp:116
rs2_create_net_device
rs2_device * rs2_create_net_device(int api_version, const char *address, rs2_error **error)
rs.hpp
rs2::device::_dev
std::shared_ptr< rs2_device > _dev
Definition:
rs_device.hpp:146
rs2
Definition:
rs_context.hpp:12
rs2::net_device::net_device
net_device(const std::string &address)
Definition:
rs_net.hpp:17
rs2_delete_device
void rs2_delete_device(rs2_device *device)
rs2::net_device::add_to
void add_to(context &ctx)
Definition:
rs_net.hpp:26
RS2_API_VERSION
#define RS2_API_VERSION
Definition:
rs.h:41
rs2::context
Definition:
rs_context.hpp:97
rs2::net_device
Definition:
rs_net.hpp:15
rs2::error::handle
static void handle(rs2_error *e)
Definition:
rs_types.hpp:144
rs2_error
struct rs2_error rs2_error
Definition:
rs_types.h:247
Generated by
1.8.18