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 
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),
41  error::handle(e);
42 
43  return dev;
44  }
45  };
46 }
47 #endif // LIBREALSENSE_RS2_NET_HPP
void add_to(context &ctx)
Definition: rs_net.hpp:26
#define RS2_API_VERSION
Definition: rs.h:41
net_device(const std::string &address)
Definition: rs_net.hpp:17
void rs2_delete_device(rs2_device *device)
Definition: rs.cpp:301
Definition: cah-model.h:10
GLsizei const GLchar *const * string
rs2_device * rs2_create_net_device(int api_version, const char *address, rs2_error **error)
Definition: ip_device.cpp:403
e
Definition: rmse.py:177
std::shared_ptr< rs2_device > init(const std::string &address)
Definition: rs_net.hpp:35
std::shared_ptr< rs2_device > _dev
Definition: rs_device.hpp:146
static void handle(rs2_error *e)
Definition: rs_types.hpp:144
void rs2_context_add_software_device(rs2_context *ctx, rs2_device *dev, rs2_error **error)
Definition: rs.cpp:1529
GLuint GLuint64EXT address
Definition: glext.h:11417


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