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

#include <rs_context.hpp>

Public Types

enum  uninitialized_t { uninitialized }
 

Public Member Functions

 context (uninitialized_t)
 
 context (char const *json_settings=nullptr)
 
 context (std::string const &json_settings)
 
 operator bool () const
 
device_list query_devices () const
 
device_list query_devices (int mask) 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)
 
void unload_tracking_module ()
 
 context (std::shared_ptr< rs2_context > ctx)
 
 operator std::shared_ptr< rs2_context > ()
 

Protected Attributes

std::shared_ptr< rs2_context_context
 

Friends

class rs2::pipeline
 
class rs2::device_hub
 
class rs2::software_device
 

Detailed Description

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

Member Enumeration Documentation

◆ uninitialized_t

Enumerator
uninitialized 

Constructor & Destructor Documentation

◆ context() [1/4]

rs2::context::context ( uninitialized_t  )
inline

◆ context() [2/4]

rs2::context::context ( char const *  json_settings = nullptr)
inline

◆ context() [3/4]

rs2::context::context ( std::string const &  json_settings)
inline

◆ context() [4/4]

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

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

◆ operator bool()

rs2::context::operator bool ( ) const
inline

◆ operator std::shared_ptr< rs2_context >()

rs2::context::operator std::shared_ptr< rs2_context > ( )
inlineexplicit

◆ 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() [1/2]

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

◆ query_devices() [2/2]

device_list rs2::context::query_devices ( int  mask) 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

◆ unload_tracking_module()

void rs2::context::unload_tracking_module ( )
inline

Friends And Related Function Documentation

◆ rs2::device_hub

friend class rs2::device_hub
friend

◆ rs2::pipeline

friend class rs2::pipeline
friend

◆ rs2::software_device

friend class rs2::software_device
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: