RealSense Cross Platform API
RealSense Cross-platform API
rs_options.hpp
Go to the documentation of this file.
1 // License: Apache 2.0. See LICENSE file in root directory.
2 // Copyright(c) 2019 RealSense, Inc. All Rights Reserved.
3 
4 #ifndef LIBREALSENSE_RS2_OPTIONS_HPP
5 #define LIBREALSENSE_RS2_OPTIONS_HPP
6 
7 #include "rs_types.hpp"
8 #include "../h/rs_types.h"
9 #include "../h/rs_composite_option.h"
10 #include "../h/rs_dpp_header.h" // DPP_HEADER_CURRENT_VERSION - see check_version_supported() below
11 
12 #include <memory>
13 #include <vector>
14 #include <cstdint>
15 #include <cstddef>
16 #include <cstring>
17 #include <string>
18 #include <stdexcept>
19 #include <type_traits>
20 #include <utility>
21 #include <limits>
22 
23 
24 namespace rs2
25 {
27  {
28  std::shared_ptr< const rs2_option_value > _value;
29 
30  // Set only for values taken out of an options-list, which is what carries the ranges
31  std::shared_ptr< rs2_options_list > _list;
32  int _index = -1;
33 
34  public:
35  explicit option_value( rs2_option_value const * handle )
36  : _value( handle, rs2_delete_option_value )
37  {
38  }
39  option_value( rs2_option_value const * handle, std::shared_ptr< rs2_options_list > list, int index )
40  : _value( handle, rs2_delete_option_value )
41  , _list( std::move( list ) )
42  , _index( index )
43  {
44  }
45  option_value( option_value const & ) = default;
46  option_value( option_value && ) = default;
47  option_value() = default;
48 
49  enum invalid_t { invalid };
51  : _value( new rs2_option_value{ option_id, false, RS2_OPTION_TYPE_COUNT } ) {}
52 
53  option_value( rs2_option option_id, int64_t as_integer )
54  : _value( new rs2_option_value{ option_id, true, RS2_OPTION_TYPE_INTEGER } )
55  {
56  const_cast< rs2_option_value * >( _value.get() )->as_integer = as_integer;
57  }
58  option_value( rs2_option option_id, float as_float )
59  : _value( new rs2_option_value{ option_id, true, RS2_OPTION_TYPE_FLOAT } )
60  {
61  const_cast< rs2_option_value * >( _value.get() )->as_float = as_float;
62  }
63  option_value( rs2_option option_id, char const * as_string )
64  : _value( new rs2_option_value{ option_id, true, RS2_OPTION_TYPE_STRING } )
65  {
66  const_cast< rs2_option_value * >( _value.get() )->as_string = as_string;
67  }
68  option_value( rs2_option option_id, bool as_boolean )
69  : _value( new rs2_option_value{ option_id, true, RS2_OPTION_TYPE_BOOLEAN } )
70  {
71  const_cast<rs2_option_value *>(_value.get())->as_integer = as_boolean;
72  }
73 
74  option_value & operator=( option_value const & ) = default;
75  option_value & operator=( option_value && ) = default;
76 
77  rs2_option_value const * operator->() const { return _value.get(); }
78  operator rs2_option_value const *() const { return _value.get(); }
79 
83  bool has_range() const
84  {
86  return get_range( range );
87  }
88 
93  {
95  if( ! get_range( range ) )
96  throw std::runtime_error( std::string( "no range available for option " )
97  + rs2_option_to_string( _value ? _value->id : RS2_OPTION_COUNT ) );
98  return { range.min, range.max, range.def, range.step };
99  }
100 
101  private:
102  bool get_range( rs2_option_range & range ) const
103  {
104  if( ! _list )
105  return false;
106  rs2_error * e = nullptr;
107  int const has_range = rs2_get_option_range_from_list( _list.get(), _index, &range, &e );
108  error::handle( e );
109  return has_range != 0;
110  }
111  };
112 
114  {
115  public:
116  options_list( options_list const & ) = default;
117  options_list( options_list && ) = default;
118 
119  explicit options_list( std::shared_ptr< rs2_options_list > list )
120  : _list( std::move( list ) )
121  {
122  rs2_error * e = nullptr;
123  _size = rs2_get_options_list_size( _list.get(), &e );
124  error::handle( e );
125  }
126 
128  : _list( nullptr )
129  , _size( 0 )
130  {
131  }
132 
133  option_value operator[]( size_t index ) const
134  {
135  rs2_error * e = nullptr;
136  auto value = rs2_get_option_value_from_list( _list.get(), static_cast< int >( index ), &e );
137  error::handle( e );
138  return option_value( value, _list, static_cast< int >( index ) );
139  }
140 
141  size_t size() const { return _size; }
142 
143  option_value front() const { return ( *this )[0]; }
144  option_value back() const { return ( *this )[size() - 1]; }
145 
146  class iterator
147  {
148  iterator( const options_list & list, size_t index )
149  : _list( list )
150  , _index( index )
151  {
152  }
153 
154  public:
155  option_value operator*() const { return _list[_index]; }
156 
157  bool operator!=( const iterator & other ) const
158  {
159  return other._index != _index || &other._list != &_list;
160  }
161  bool operator==( const iterator & other ) const
162  {
163  return ! ( *this != other );
164  }
165 
167  {
168  _index++;
169  return *this;
170  }
171 
172  private:
173  friend options_list;
174  const options_list & _list;
175  size_t _index;
176  };
177 
178  iterator begin() const { return iterator( *this, 0 ); }
179  iterator end() const { return iterator( *this, size() ); }
180 
181  std::shared_ptr< rs2_options_list > get() const { return _list; };
182 
183  private:
184  std::shared_ptr< rs2_options_list > _list;
185  size_t _size;
186  };
187 
189  {
190  std::function< void( const options_list & ) > _callback;
191 
192  public:
193  explicit options_changed_callback( const std::function< void( const options_list & ) > & callback )
194  : _callback( callback )
195  {
196  }
197 
198  void on_value_changed( rs2_options_list * list ) override
199  {
200  std::shared_ptr< rs2_options_list > sptr( list, rs2_delete_options_list );
201  options_list opt_list( sptr );
202  _callback( opt_list );
203  }
204 
205  void release() override { delete this; }
206  };
207 
208  class options
209  {
210  public:
216  bool supports(rs2_option option) const
217  {
218  rs2_error* e = nullptr;
219  auto res = rs2_supports_option(_options, option, &e);
220  error::handle(e);
221  return res > 0;
222  }
223 
229  const char* get_option_description(rs2_option option) const
230  {
231  rs2_error* e = nullptr;
232  auto res = rs2_get_option_description(_options, option, &e);
233  error::handle(e);
234  return res;
235  }
236 
242  const char* get_option_name(rs2_option option) const
243  {
244  rs2_error* e = nullptr;
245  auto res = rs2_get_option_name(_options, option, &e);
246  error::handle(e);
247  return res;
248  }
249 
256  const char* get_option_value_description(rs2_option option, float val) const
257  {
258  rs2_error* e = nullptr;
259  auto res = rs2_get_option_value_description(_options, option, val, &e);
260  error::handle(e);
261  return res;
262  }
263 
269  float get_option(rs2_option option) const
270  {
271  rs2_error* e = nullptr;
272  auto res = rs2_get_option(_options, option, &e);
273  error::handle(e);
274  return res;
275  }
276 
283  {
284  rs2_error * e = nullptr;
285  auto value = rs2_get_option_value( _options, option_id, &e );
286  error::handle( e );
287  return option_value( value );
288  }
289 
295  {
296  option_range result;
297  rs2_error* e = nullptr;
298  rs2_get_option_range(_options, option,
299  &result.min, &result.max, &result.step, &result.def, &e);
300  error::handle(e);
301  return result;
302  }
303 
309  void set_option(rs2_option option, float value) const
310  {
311  rs2_error* e = nullptr;
312  rs2_set_option(_options, option, value, &e);
313  error::handle(e);
314  }
315 
321  void set_option_value( option_value const & value ) const
322  {
323  rs2_error * e = nullptr;
324  rs2_set_option_value( _options, value, &e );
325  error::handle( e );
326  }
327 
333  bool is_option_read_only(rs2_option option) const
334  {
335  rs2_error* e = nullptr;
336  auto res = rs2_is_option_read_only(_options, option, &e);
337  error::handle(e);
338  return res > 0;
339  }
340 
345  void on_options_changed( std::function< void( const options_list & ) > callback ) const
346  {
347  rs2_error * e = nullptr;
348  rs2_set_options_changed_callback_cpp( _options, new options_changed_callback( callback ), &e );
349  error::handle( e );
350  }
351 
352  std::vector<rs2_option> get_supported_options()
353  {
354  std::vector<rs2_option> res;
355  rs2_error* e = nullptr;
356  std::shared_ptr< rs2_options_list > options_list( rs2_get_options_list(_options, &e), rs2_delete_options_list);
357  error::handle( e );
358 
359  for (auto opt = 0; opt < rs2_get_options_list_size(options_list.get(), &e);opt++)
360  {
361  res.push_back(rs2_get_option_from_list(options_list.get(), opt, &e));
362  }
363  return res;
364  };
365 
367  {
368  rs2_error * e = nullptr;
369  std::shared_ptr< rs2_options_list > sptr(
370  rs2_get_options_list( _options, &e ),
372  error::handle( e );
373  return options_list( sptr );
374  };
375 
387  void set_composite_option( rs2_composite_option_id id, const void * data, size_t size ) const
388  {
389  // The C API takes an unsigned int; guard the narrowing cast rather than silently
390  // truncating a caller-supplied size_t larger than UINT_MAX into a smaller, wrong value.
391  if( size > (std::numeric_limits< unsigned int >::max)() )
392  throw std::runtime_error( "composite option payload size (" + std::to_string( size )
393  + ") exceeds what the C API can represent" );
394 
395  rs2_error * e = nullptr;
396  rs2_set_composite_option( _options, id, data, static_cast< unsigned int >( size ), &e );
397  error::handle( e );
398  }
399 
406  std::vector< uint8_t > get_composite_option( rs2_composite_option_id id ) const
407  {
408  rs2_error * e = nullptr;
409  auto buffer = rs2_get_composite_option( _options, id, &e );
410  return unwrap_raw_data_buffer( buffer, e );
411  }
412 
418  std::vector< uint8_t > get_composite_option_range( rs2_composite_option_id id ) const
419  {
420  rs2_error * e = nullptr;
421  auto buffer = rs2_get_composite_option_range( _options, id, &e );
422  return unwrap_raw_data_buffer( buffer, e );
423  }
424 
432  template< typename T >
434  {
435  T value{};
436  cast_composite_payload( get_composite_option( id ), value );
437  return value;
438  }
439 
447  template< typename TRange >
449  {
450  TRange range{};
451  cast_composite_payload( get_composite_option_range( id ), range );
452  return range;
453  }
454 
462  template< typename T >
463  void set_composite_option_from( rs2_composite_option_id id, const T & value ) const
464  {
465  check_version_supported( value );
466  set_composite_option( id, &value, sizeof( T ) );
467  }
468 
475  {
476  rs2_error * e = nullptr;
477  auto res = rs2_supports_composite_option( _options, id, &e );
478  error::handle( e );
479  return res > 0;
480  }
481 
488  {
489  rs2_error * e = nullptr;
490  auto res = rs2_is_composite_option_read_only( _options, id, &e );
491  error::handle( e );
492  return res > 0;
493  }
494 
501  {
502  rs2_error * e = nullptr;
503  auto res = rs2_get_composite_option_description( _options, id, &e );
504  error::handle( e );
505  return res;
506  }
507 
511  std::vector< rs2_composite_option_id > get_supported_composite_options() const
512  {
513  std::vector< rs2_composite_option_id > res;
514  rs2_error * e = nullptr;
515  std::shared_ptr< rs2_composite_options_list > list( rs2_get_composite_options_list( _options, &e ),
517  error::handle( e );
518 
519  auto size = rs2_get_composite_options_list_size( list.get(), &e );
520  error::handle( e );
521  for( auto i = 0; i < size; i++ )
522  {
523  res.push_back( rs2_get_composite_option_from_list( list.get(), i, &e ) );
524  error::handle( e );
525  }
526  return res;
527  }
528 
529  options& operator=(const options& other)
530  {
531  _options = other._options;
532  return *this;
533  }
534  // if operator= is ok, this should be ok too
535  options(const options& other) : _options(other._options) {}
536 
537  virtual ~options() = default;
538 
539  protected:
540  explicit options(rs2_options* o = nullptr) : _options(o)
541  {
542  }
543 
544  template<class T>
545  options& operator=(const T& dev)
546  {
547  _options = (rs2_options*)(dev.get());
548  return *this;
549  }
550 
551  private:
552  // Shared unwrap helper for get_composite_option()/get_composite_option_range() - hides the
553  // raw rs2_raw_data_buffer/manual-free (mirrors safety_sensor::get_safety_preset's pattern).
554  static std::vector< uint8_t > unwrap_raw_data_buffer( const rs2_raw_data_buffer * buffer, rs2_error * e )
555  {
556  std::shared_ptr< const rs2_raw_data_buffer > guard( buffer, rs2_delete_raw_data );
557  error::handle( e );
558 
559  rs2_error * e2 = nullptr;
560  auto size = rs2_get_raw_data_size( guard.get(), &e2 );
561  error::handle( e2 );
562 
563  auto start = rs2_get_raw_data( guard.get(), &e2 );
564  error::handle( e2 );
565 
566  std::vector< uint8_t > result;
567  result.insert( result.begin(), start, start + size );
568  return result;
569  }
570 
571  // ---- typed composite-option cast helpers (get_composite_option_as() and friends) -----
572  // Detects whether T has a `.header.version` member via a composed dpp_header - value
573  // structs like rs2_hdrd_control.
574  template< typename U >
575  class has_header_version
576  {
577  template< typename V > static auto test( int ) -> decltype( std::declval< V >().header.version, std::true_type{} );
578  template< typename > static std::false_type test( ... );
579  public:
580  static const bool value = decltype( test< U >( 0 ) )::value;
581  };
582 
583  // Detects whether T is a {min,max,step,def} range wrapper whose ELEMENTS each carry their
584  // own `.header.version` - e.g. rs2_hdrd_control_range. The wrapper itself has no version
585  // field of its own (see rs_hdrd_control.h) - each of its four bounds does.
586  template< typename U >
587  class has_min_header_version
588  {
589  template< typename V > static auto test( int ) -> decltype( std::declval< V >().min.header.version, std::true_type{} );
590  template< typename > static std::false_type test( ... );
591  public:
592  static const bool value = decltype( test< U >( 0 ) )::value;
593  };
594 
595  // T has neither shape - no dpp_header anywhere in it - nothing to check. Every composite-
596  // option struct currently in the SDK has one or the other, but a future one might not
597  // (e.g. a control outside the HKR DPP family entirely).
598  template< typename T >
599  static typename std::enable_if< ! has_header_version< T >::value && ! has_min_header_version< T >::value >::type
600  check_version_supported( const T & )
601  {
602  }
603 
604  // This is what makes the version field worth having: reject anything other than
605  // DPP_HEADER_CURRENT_VERSION up front - including 0, the "never populated" sentinel - rather
606  // than silently misreading a struct laid out by a wire version this build doesn't know.
607  template< typename T >
608  static typename std::enable_if< has_header_version< T >::value >::type
609  check_version_supported( const T & value )
610  {
611  if( value.header.version != DPP_HEADER_CURRENT_VERSION )
612  throw std::runtime_error( "composite option struct has unsupported wire version "
613  + std::to_string( (int)value.header.version ) + " (this SDK build supports version "
614  + std::to_string( (int)DPP_HEADER_CURRENT_VERSION )
615  + ") - wrong struct for this option id, a zero-initialized header about to "
616  "be sent, or a newer device/firmware speaking a wire version this build "
617  "doesn't know yet?" );
618  }
619 
620  // Range wrapper (e.g. rs2_hdrd_control_range) - checks each of the four bounds' own
621  // header.version the same way, since the wrapper carries none of its own.
622  template< typename T >
623  static typename std::enable_if< has_min_header_version< T >::value >::type
624  check_version_supported( const T & value )
625  {
626  check_version_supported( value.min );
627  check_version_supported( value.max );
628  check_version_supported( value.step );
629  check_version_supported( value.def );
630  }
631 
632  template< typename T >
633  static void cast_composite_payload( const std::vector< uint8_t > & raw, T & out )
634  {
635  if( raw.size() != sizeof( T ) )
636  throw std::runtime_error( "composite option payload size (" + std::to_string( raw.size() )
637  + ") does not match sizeof(T) (" + std::to_string( sizeof( T ) )
638  + ") - wrong struct for this option id?" );
639  std::memcpy( &out, raw.data(), sizeof( T ) );
640  check_version_supported( out );
641  }
642 
643  rs2_options* _options;
644  };
645 
646 
647 }
648 #endif // LIBREALSENSE_RS2_OIPTIONS_HPP
options_list get_supported_option_values()
Definition: rs_options.hpp:366
void rs2_set_option_value(rs2_options const *options, rs2_option_value const *option_value, rs2_error **error)
std::vector< uint8_t > get_composite_option_range(rs2_composite_option_id id) const
Definition: rs_options.hpp:418
Definition: rs_option.h:147
rs2_option_value const * rs2_get_option_value(const rs2_options *options, rs2_option option_id, rs2_error **error)
Definition: rs_types.hpp:100
float rs2_get_option(const rs2_options *options, rs2_option option, rs2_error **error)
struct rs2_raw_data_buffer rs2_raw_data_buffer
Definition: rs_types.h:298
bool supports(rs2_option option) const
Definition: rs_options.hpp:216
void set_composite_option_from(rs2_composite_option_id id, const T &value) const
Definition: rs_options.hpp:463
Definition: rs_option.h:168
bool supports_composite_option(rs2_composite_option_id id) const
Definition: rs_options.hpp:474
rs2_option
Defines general configuration controls. These can generally be mapped to camera UVC controls...
Definition: rs_option.h:26
option_value operator[](size_t index) const
Definition: rs_options.hpp:133
virtual ~options()=default
const char * get_option_name(rs2_option option) const
Definition: rs_options.hpp:242
Definition: rs_options.hpp:146
const char * rs2_option_to_string(rs2_option option)
void on_options_changed(std::function< void(const options_list &) > callback) const
Definition: rs_options.hpp:345
size_t size() const
Definition: rs_options.hpp:141
const unsigned char * rs2_get_raw_data(const rs2_raw_data_buffer *buffer, rs2_error **error)
float min
Definition: rs_types.hpp:196
TRange get_composite_option_range_as(rs2_composite_option_id id) const
Definition: rs_options.hpp:448
options & operator=(const T &dev)
Definition: rs_options.hpp:545
Definition: rs_context.hpp:11
rs2_option_value const * rs2_get_option_value_from_list(const rs2_options_list *options, int i, rs2_error **error)
void rs2_delete_raw_data(const rs2_raw_data_buffer *buffer)
options_list(std::shared_ptr< rs2_options_list > list)
Definition: rs_options.hpp:119
option_value()=default
const char * get_option_description(rs2_option option) const
Definition: rs_options.hpp:229
void rs2_set_options_changed_callback_cpp(rs2_options *options, rs2_options_changed_callback *callback, rs2_error **error)
The value of an option, in a known option type.
Definition: rs_option.h:207
option_value(rs2_option option_id, invalid_t)
Definition: rs_options.hpp:50
bool operator==(const iterator &other) const
Definition: rs_options.hpp:161
options(const options &other)
Definition: rs_options.hpp:535
int rs2_is_composite_option_read_only(const rs2_options *options, rs2_composite_option_id option, rs2_error **error)
rs2_composite_options_list * rs2_get_composite_options_list(const rs2_options *options, rs2_error **error)
int rs2_get_raw_data_size(const rs2_raw_data_buffer *buffer, rs2_error **error)
float max
Definition: rs_types.hpp:197
float step
Definition: rs_types.hpp:199
option_value(rs2_option option_id, float as_float)
Definition: rs_options.hpp:58
void rs2_delete_option_value(rs2_option_value const *handle)
void release() override
Definition: rs_options.hpp:205
void rs2_delete_composite_options_list(rs2_composite_options_list *list)
float get_option(rs2_option option) const
Definition: rs_options.hpp:269
std::vector< rs2_option > get_supported_options()
Definition: rs_options.hpp:352
option_value(rs2_option option_id, char const *as_string)
Definition: rs_options.hpp:63
int rs2_get_option_range_from_list(const rs2_options_list *options, int i, rs2_option_range *out_range, rs2_error **error)
Definition: rs_option.h:197
std::vector< rs2_composite_option_id > get_supported_composite_options() const
Definition: rs_options.hpp:511
int rs2_supports_option(const rs2_options *options, rs2_option option, rs2_error **error)
const char * rs2_get_option_name(const rs2_options *options, rs2_option option, rs2_error **error)
Definition: rs_option.h:169
bool is_composite_option_read_only(rs2_composite_option_id id) const
Definition: rs_options.hpp:487
int rs2_get_composite_options_list_size(const rs2_composite_options_list *list, rs2_error **error)
iterator begin() const
Definition: rs_options.hpp:178
const char * rs2_get_option_value_description(const rs2_options *options, rs2_option option, float value, rs2_error **error)
Definition: rs_options.hpp:26
Definition: rs_types.hpp:194
Definition: rs_options.hpp:113
invalid_t
Definition: rs_options.hpp:49
options_list()
Definition: rs_options.hpp:127
std::vector< uint8_t > get_composite_option(rs2_composite_option_id id) const
Definition: rs_options.hpp:406
const rs2_raw_data_buffer * rs2_get_composite_option(const rs2_options *options, rs2_composite_option_id option, rs2_error **error)
Definition: rs_options.hpp:208
const char * get_option_value_description(rs2_option option, float val) const
Definition: rs_options.hpp:256
void rs2_get_option_range(const rs2_options *sensor, rs2_option option, float *min, float *max, float *step, float *def, rs2_error **error)
void on_value_changed(rs2_options_list *list) override
Definition: rs_options.hpp:198
rs2_options_list * rs2_get_options_list(const rs2_options *options, rs2_error **error)
rs2_composite_option_id rs2_get_composite_option_from_list(const rs2_composite_options_list *list, int i, rs2_error **error)
struct rs2_options rs2_options
Definition: rs_types.h:323
void set_composite_option(rs2_composite_option_id id, const void *data, size_t size) const
Definition: rs_options.hpp:387
Definition: rs_option.h:171
#define DPP_HEADER_CURRENT_VERSION
Definition: rs_dpp_header.h:23
Definition: rs_option.h:174
option_value operator*() const
Definition: rs_options.hpp:155
static void handle(rs2_error *e)
Definition: rs_types.hpp:162
options(rs2_options *o=nullptr)
Definition: rs_options.hpp:540
const char * rs2_get_composite_option_description(const rs2_options *options, rs2_composite_option_id option, rs2_error **error)
Definition: rs_options.hpp:188
T get_composite_option_as(rs2_composite_option_id id) const
Definition: rs_options.hpp:433
bool has_range() const
Definition: rs_options.hpp:83
void rs2_set_composite_option(const rs2_options *options, rs2_composite_option_id option, const void *data, unsigned int size, rs2_error **error)
iterator & operator++()
Definition: rs_options.hpp:166
Definition: rs_options.hpp:49
rs2_option_value const * operator->() const
Definition: rs_options.hpp:77
bool is_option_read_only(rs2_option option) const
Definition: rs_options.hpp:333
option_value(rs2_option_value const *handle, std::shared_ptr< rs2_options_list > list, int index)
Definition: rs_options.hpp:39
Definition: rs_option.h:170
bool operator!=(const iterator &other) const
Definition: rs_options.hpp:157
int rs2_supports_composite_option(const rs2_options *options, rs2_composite_option_id option, rs2_error **error)
option_range get_option_range(rs2_option option) const
Definition: rs_options.hpp:294
void set_option(rs2_option option, float value) const
Definition: rs_options.hpp:309
float def
Definition: rs_types.hpp:198
const rs2_raw_data_buffer * rs2_get_composite_option_range(const rs2_options *options, rs2_composite_option_id option, rs2_error **error)
option_value(rs2_option option_id, int64_t as_integer)
Definition: rs_options.hpp:53
const char * rs2_get_option_description(const rs2_options *options, rs2_option option, rs2_error **error)
options & operator=(const options &other)
Definition: rs_options.hpp:529
std::shared_ptr< rs2_options_list > get() const
Definition: rs_options.hpp:181
int rs2_is_option_read_only(const rs2_options *options, rs2_option option, rs2_error **error)
rs2_composite_option_id
Definition: rs_composite_option.h:23
option_range range() const
Definition: rs_options.hpp:92
option_value get_option_value(rs2_option option_id) const
Definition: rs_options.hpp:282
void rs2_set_option(const rs2_options *options, rs2_option option, float value, rs2_error **error)
struct rs2_error rs2_error
Definition: rs_types.h:296
option_value front() const
Definition: rs_options.hpp:143
void rs2_delete_options_list(rs2_options_list *list)
struct rs2_options_list rs2_options_list
Definition: rs_types.h:324
option_value(rs2_option option_id, bool as_boolean)
Definition: rs_options.hpp:68
option_value(rs2_option_value const *handle)
Definition: rs_options.hpp:35
rs2_option rs2_get_option_from_list(const rs2_options_list *options, int i, rs2_error **error)
void set_option_value(option_value const &value) const
Definition: rs_options.hpp:321
int rs2_get_options_list_size(const rs2_options_list *options, rs2_error **error)
iterator end() const
Definition: rs_options.hpp:179
const char * get_composite_option_description(rs2_composite_option_id id) const
Definition: rs_options.hpp:500
option_value & operator=(option_value const &)=default
options_changed_callback(const std::function< void(const options_list &) > &callback)
Definition: rs_options.hpp:193
option_value back() const
Definition: rs_options.hpp:144