4 #ifndef LIBREALSENSE_RS2_CONTEXT_HPP 5 #define LIBREALSENSE_RS2_CONTEXT_HPP 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;
145 for (
auto&&
dev : query_devices())
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; }
273 #endif // LIBREALSENSE_RS2_CONTEXT_HPP
void on_devices_changed(rs2_device_list *removed, rs2_device_list *added) override
int rs2_device_list_contains(const rs2_device_list *info_list, const rs2_device *device, rs2_error **error)
bool is_connected(const device &dev) const
std::shared_ptr< rs2_device_hub > _device_hub
std::vector< sensor > query_all_sensors() const
Generate a flat list of all available sensors from all RealSense devices.
rs2_device_list * rs2_query_devices(const rs2_context *context, rs2_error **error)
const std::shared_ptr< rs2_device > & get() const
void unload_device(const std::string &file)
rs2_device_hub * rs2_create_device_hub(const rs2_context *context, rs2_error **error)
Creates RealSense device_hub .
device get_sensor_parent(const sensor &s) const
playback load_device(const std::string &file)
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.
device_list query_devices() const
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)
const rs2_device_list * get_list() const
GLsizei const GLchar *const * string
void unload_tracking_module()
def info(name, value, persistent=False)
std::shared_ptr< rs2_sensor > _sensor
rs2_device_list * rs2_query_devices_ex(const rs2_context *context, int product_mask, rs2_error **error)
std::shared_ptr< rs2_context > _context
int rs2_device_hub_is_device_connected(const rs2_device_hub *hub, const rs2_device *device, rs2_error **error)
context(std::shared_ptr< rs2_context > ctx)
void rs2_delete_device_hub(const rs2_device_hub *hub)
Frees the relevant device hub object.
std::shared_ptr< rs2_device > _dev
device_hub(std::shared_ptr< rs2_device_hub > hub)
device_list query_devices(int mask) const
static void handle(rs2_error *e)
void rs2_context_unload_tracking_module(rs2_context *ctx, rs2_error **error)
typename::boost::move_detail::remove_reference< T >::type && move(T &&t) BOOST_NOEXCEPT
void set_devices_changed_callback(T callback)
void rs2_set_devices_changed_callback_cpp(rs2_context *context, rs2_devices_changed_callback *callback, rs2_error **error)
devices_changed_callback(T callback)
void rs2_context_remove_device(rs2_context *ctx, const char *file, rs2_error **error)
device wait_for_device() const
void rs2_delete_device_list(rs2_device_list *info_list)
rs2_device * rs2_device_hub_wait_for_device(const rs2_device_hub *hub, rs2_error **error)
void copy(void *dst, void const *src, size_t size)