4 #ifndef LIBREALSENSE_RS2_CONTEXT_HPP 5 #define LIBREALSENSE_RS2_CONTEXT_HPP 17 :_removed(removed), _added(added) {}
110 _context = std::shared_ptr<rs2_context>(
123 std::shared_ptr<rs2_device_list> list(
138 std::shared_ptr<rs2_device_list> list(
152 std::vector<sensor> results;
155 auto sensors = dev.query_sensors();
156 std::copy(sensors.begin(), sensors.end(), std::back_inserter(results));
165 std::shared_ptr<rs2_device> dev(
195 auto device = std::shared_ptr<rs2_device>(
227 : _ctx(std::move(ctx))
230 _device_hub = std::shared_ptr<rs2_device_hub>(
243 std::shared_ptr<rs2_device> dev(
262 return res > 0 ? true :
false;
267 std::shared_ptr<rs2_device_hub> _device_hub;
271 #endif // LIBREALSENSE_RS2_CONTEXT_HPP Definition: rs_record_playback.hpp:27
Definition: rs_sensor.hpp:232
void release() override
Definition: rs_context.hpp:94
void on_devices_changed(rs2_device_list *removed, rs2_device_list *added) override
Definition: rs_context.hpp:84
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:256
rs2_device_list * rs2_query_devices(const rs2_context *context, rs2_error **error)
void unload_device(const std::string &file)
Definition: rs_context.hpp:203
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:192
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:104
device_list query_devices() const
Definition: rs_context.hpp:120
device wait_for_device() const
Definition: rs_context.hpp:240
std::shared_ptr< rs2_sensor > _sensor
Definition: rs_sensor.hpp:421
rs2_device_list * rs2_query_devices_ex(const rs2_context *context, int product_mask, rs2_error **error)
std::shared_ptr< rs2_context > _context
Definition: rs_context.hpp:217
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:214
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:150
std::shared_ptr< rs2_device > _dev
Definition: rs_device.hpp:143
device get_sensor_parent(const sensor &s) const
Definition: rs_context.hpp:162
device_list query_devices(int mask) const
Definition: rs_context.hpp:135
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:223
context()
Definition: rs_context.hpp:107
void set_devices_changed_callback(T callback)
Definition: rs_context.hpp:177
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:82
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:77
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:226