Intel® RealSense™ Cross Platform API  2.13.0
Intel Realsense Cross-platform API
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
rs2::context Class Reference

#include <rs_context.hpp>

Inheritance diagram for rs2::context:
rs2::mock_context rs2::recording_context

Public Member Functions

 context ()
 
device_list query_devices () const
 
std::vector< sensorquery_all_sensors () const
 Generate a flat list of all available sensors from all RealSense devices. More...
 
device get_sensor_parent (const sensor &s) const
 
template<class T >
void set_devices_changed_callback (T callback)
 
playback load_device (const std::string &file)
 
void unload_device (const std::string &file)
 

Protected Member Functions

 context (std::shared_ptr< rs2_context > ctx)
 

Protected Attributes

std::shared_ptr< rs2_context_context
 

Friends

class rs2::pipeline
 
class rs2::device_hub
 

Detailed Description

default librealsense context class includes realsense API version as provided by RS2_API_VERSION macro

Constructor & Destructor Documentation

◆ context() [1/2]

rs2::context::context ( )
inline

◆ context() [2/2]

rs2::context::context ( std::shared_ptr< rs2_context ctx)
inlineprotected

Member Function Documentation

◆ get_sensor_parent()

device rs2::context::get_sensor_parent ( const sensor s) const
inline

◆ load_device()

playback rs2::context::load_device ( const std::string &  file)
inline

Creates a device from a RealSense file

On successful load, the device will be appended to the context and a devices_changed event triggered

Parameters
filePath to a RealSense File
Returns
A playback device matching the given file

◆ query_all_sensors()

std::vector<sensor> rs2::context::query_all_sensors ( ) const
inline

Generate a flat list of all available sensors from all RealSense devices.

Returns
List of sensors

◆ query_devices()

device_list rs2::context::query_devices ( ) const
inline

create a static snapshot of all connected devices at the time of the call

Returns
the list of devices connected devices at the time of the call

◆ set_devices_changed_callback()

template<class T >
void rs2::context::set_devices_changed_callback ( callback)
inline

register devices changed callback

Parameters
[in]callbackdevices changed callback

◆ unload_device()

void rs2::context::unload_device ( const std::string &  file)
inline

Friends And Related Function Documentation

◆ rs2::device_hub

friend class rs2::device_hub
friend

◆ rs2::pipeline

friend class rs2::pipeline
friend

Member Data Documentation

◆ _context

std::shared_ptr<rs2_context> rs2::context::_context
protected

The documentation for this class was generated from the following file: