Intel® RealSense™ Cross Platform API
Intel Realsense Cross-platform API
|
Go to the documentation of this file.
4 #ifndef LIBREALSENSE_RS2_CONTEXT_HPP
5 #define LIBREALSENSE_RS2_CONTEXT_HPP
17 :_removed(removed), _added(added) {}
90 class software_device;
102 _context = std::shared_ptr<rs2_context>(
115 std::shared_ptr<rs2_device_list> list(
130 std::shared_ptr<rs2_device_list> list(
144 std::vector<sensor> results;
147 auto sensors = dev.query_sensors();
148 std::copy(sensors.begin(), sensors.end(), std::back_inserter(results));
157 std::shared_ptr<rs2_device> dev(
187 auto device = std::shared_ptr<rs2_device>(
212 explicit operator std::shared_ptr<rs2_context>() {
return _context; };
230 _device_hub = std::shared_ptr<rs2_device_hub>(
243 std::shared_ptr<rs2_device> dev(
262 return res > 0 ? true :
false;
266 explicit operator std::shared_ptr<rs2_device_hub>() {
return _device_hub; }
267 explicit device_hub(std::shared_ptr<rs2_device_hub> hub) : _device_hub(std::move(hub)) {}
269 std::shared_ptr<rs2_device_hub> _device_hub;
273 #endif // LIBREALSENSE_RS2_CONTEXT_HPP
Definition: rs_device.hpp:18
devices_changed_callback(T callback)
Definition: rs_context.hpp:73
rs2_device * rs2_device_hub_wait_for_device(const rs2_device_hub *hub, rs2_error **error)
void rs2_context_unload_tracking_module(rs2_context *ctx, rs2_error **error)
rs2_device_list * rs2_query_devices(const rs2_context *context, rs2_error **error)
Definition: rs_record_playback.hpp:27
void rs2_set_devices_changed_callback_cpp(rs2_context *context, rs2_devices_changed_callback *callback, rs2_error **error)
void unload_device(const std::string &file)
Definition: rs_context.hpp:195
Definition: rs_internal.hpp:210
playback load_device(const std::string &file)
Definition: rs_context.hpp:184
Definition: rs_types.hpp:55
Definition: rs_device.hpp:565
void rs2_delete_context(rs2_context *context)
Frees the relevant context object.
device_hub(std::shared_ptr< rs2_device_hub > hub)
Definition: rs_context.hpp:267
context(std::shared_ptr< rs2_context > ctx)
Definition: rs_context.hpp:209
int rs2_device_list_contains(const rs2_device_list *info_list, const rs2_device *device, rs2_error **error)
Definition: rs_context.hpp:224
context()
Definition: rs_context.hpp:99
std::shared_ptr< rs2_context > _context
Definition: rs_context.hpp:218
rs2_context * rs2_create_context(int api_version, rs2_error **error)
Creates RealSense context that is required for the rest of the API.
void rs2_delete_device_list(rs2_device_list *info_list)
const rs2_device_list * get_list() const
Definition: rs_device.hpp:662
const std::shared_ptr< rs2_device > & get() const
Definition: rs_device.hpp:116
std::shared_ptr< rs2_device > _dev
Definition: rs_device.hpp:146
int rs2_device_hub_is_device_connected(const rs2_device_hub *hub, const rs2_device *device, rs2_error **error)
void on_devices_changed(rs2_device_list *removed, rs2_device_list *added) override
Definition: rs_context.hpp:75
Definition: rs_context.hpp:11
Definition: rs_sensor.hpp:103
rs2_device * rs2_context_add_device(rs2_context *ctx, const char *file, rs2_error **error)
void rs2_context_remove_device(rs2_context *ctx, const char *file, rs2_error **error)
void rs2_delete_device(rs2_device *device)
void rs2_delete_device_hub(const rs2_device_hub *hub)
Frees the relevant device hub object.
void unload_tracking_module()
Definition: rs_context.hpp:202
rs2_device_list * rs2_query_devices_ex(const rs2_context *context, int product_mask, rs2_error **error)
std::shared_ptr< rs2_sensor > _sensor
Definition: rs_sensor.hpp:327
#define RS2_API_VERSION
Definition: rs.h:41
device get_sensor_parent(const sensor &s) const
Definition: rs_context.hpp:154
device_list query_devices(int mask) const
Definition: rs_context.hpp:127
Definition: rs_context.hpp:96
device_list query_devices() const
Definition: rs_context.hpp:112
std::vector< sensor > query_all_sensors() const
Generate a flat list of all available sensors from all RealSense devices.
Definition: rs_context.hpp:142
static void handle(rs2_error *e)
Definition: rs_types.hpp:130
Definition: rs_context.hpp:68
Definition: rs_pipeline.hpp:362
rs2_device * rs2_create_device_from_sensor(const rs2_sensor *sensor, rs2_error **error)
rs2_device_hub * rs2_create_device_hub(const rs2_context *context, rs2_error **error)
Creates RealSense device_hub .
void release() override
Definition: rs_context.hpp:85
void set_devices_changed_callback(T callback)
Definition: rs_context.hpp:169
bool is_connected(const device &dev) const
Definition: rs_context.hpp:256
device wait_for_device() const
Definition: rs_context.hpp:240
struct rs2_device_list rs2_device_list
Definition: rs_types.h:225
device_hub(context ctx)
Definition: rs_context.hpp:227
struct rs2_error rs2_error
Definition: rs_types.h:217