4 #ifndef LIBREALSENSE_RS2_CONTEXT_HPP 5 #define LIBREALSENSE_RS2_CONTEXT_HPP 17 :_removed(removed), _added(added) {}
84 _context = std::shared_ptr<rs2_context>(
97 std::shared_ptr<rs2_device_list> list(
111 std::vector<sensor> results;
114 auto sensors = dev.query_sensors();
115 std::copy(sensors.begin(), sensors.end(), std::back_inserter(results));
124 std::shared_ptr<rs2_device> dev(
154 auto device = std::shared_ptr<rs2_device>(
186 : _ctx(std::move(ctx))
189 _device_hub = std::shared_ptr<rs2_device_hub>(
202 std::shared_ptr<rs2_device> dev(
221 return res > 0 ? true :
false;
226 std::shared_ptr<rs2_device_hub> _device_hub;
230 #endif // LIBREALSENSE_RS2_CONTEXT_HPP Definition: rs_record_playback.hpp:27
Definition: rs_sensor.hpp:232
void release() override
Definition: rs_context.hpp:68
void on_devices_changed(rs2_device_list *removed, rs2_device_list *added) override
Definition: rs_context.hpp:58
int rs2_device_list_contains(const rs2_device_list *info_list, const rs2_device *device, rs2_error **error)
#define RS2_API_VERSION
Definition: rs.h:37
bool is_connected(const device &dev) const
Definition: rs_context.hpp:215
rs2_device_list * rs2_query_devices(const rs2_context *context, rs2_error **error)
void unload_device(const std::string &file)
Definition: rs_context.hpp:162
rs2_device_hub * rs2_create_device_hub(const rs2_context *context, rs2_error **error)
Creates RealSense device_hub .
playback load_device(const std::string &file)
Definition: rs_context.hpp:151
rs2_device * rs2_create_device_from_sensor(const rs2_sensor *sensor, rs2_error **error)
void rs2_delete_device(rs2_device *device)
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_context(rs2_context *context)
Frees the relevant context object.
rs2_device * rs2_context_add_device(rs2_context *ctx, const char *file, rs2_error **error)
Definition: rs_context.hpp:11
Definition: rs_context.hpp:78
device_list query_devices() const
Definition: rs_context.hpp:94
device wait_for_device() const
Definition: rs_context.hpp:199
std::shared_ptr< rs2_sensor > _sensor
Definition: rs_sensor.hpp:421
std::shared_ptr< rs2_context > _context
Definition: rs_context.hpp:176
int rs2_device_hub_is_device_connected(const rs2_device_hub *hub, const rs2_device *device, rs2_error **error)
const std::shared_ptr< rs2_device > & get() const
Definition: rs_device.hpp:116
context(std::shared_ptr< rs2_context > ctx)
Definition: rs_context.hpp:173
void rs2_delete_device_hub(const rs2_device_hub *hub)
Frees the relevant device hub object.
std::vector< sensor > query_all_sensors() const
Generate a flat list of all available sensors from all RealSense devices.
Definition: rs_context.hpp:109
std::shared_ptr< rs2_device > _dev
Definition: rs_device.hpp:143
device get_sensor_parent(const sensor &s) const
Definition: rs_context.hpp:121
static void handle(rs2_error *e)
Definition: rs_types.hpp:121
Definition: rs_pipeline.hpp:335
rs2_device * rs2_device_hub_wait_for_device(rs2_context *ctx, const rs2_device_hub *hub, rs2_error **error)
Definition: rs_device.hpp:184
Definition: rs_context.hpp:182
context()
Definition: rs_context.hpp:81
void set_devices_changed_callback(T callback)
Definition: rs_context.hpp:136
void rs2_set_devices_changed_callback_cpp(rs2_context *context, rs2_devices_changed_callback *callback, rs2_error **error)
devices_changed_callback(T callback)
Definition: rs_context.hpp:56
void rs2_context_remove_device(rs2_context *ctx, const char *file, rs2_error **error)
struct rs2_device_list rs2_device_list
Definition: rs_types.h:156
Definition: rs_context.hpp:51
Definition: rs_types.hpp:53
struct rs2_error rs2_error
Definition: rs_types.h:149
void rs2_delete_device_list(rs2_device_list *info_list)
Definition: rs_device.hpp:18
const rs2_device_list * get_list() const
Definition: rs_device.hpp:281
device_hub(context ctx)
Definition: rs_context.hpp:185