From 66de311139173f89d43b00e645bcfa01b90cb1cd Mon Sep 17 00:00:00 2001 From: Eran Date: Thu, 27 Jun 2024 10:23:17 +0300 Subject: [PATCH] fixup! add dds serializable class for presets --- src/dds/rs-dds-device-proxy.cpp | 14 ++++++++++++-- src/dds/rs-dds-device-proxy.h | 4 ++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/dds/rs-dds-device-proxy.cpp b/src/dds/rs-dds-device-proxy.cpp index 539e6f8f17e..7138a217e77 100644 --- a/src/dds/rs-dds-device-proxy.cpp +++ b/src/dds/rs-dds-device-proxy.cpp @@ -685,12 +685,22 @@ void dds_device_proxy::update( const void * /*image*/, int /*image_size*/, rs2_u } -std::vector< sensor_interface * > dds_device_proxy::get_serializable_sensors() const +std::vector< sensor_interface * > dds_device_proxy::get_serializable_sensors() { std::vector< sensor_interface * > sensors; auto const n_sensors = get_sensors_count(); for( auto i = 0; i < n_sensors; ++i ) - sensors.push_back( const_cast< sensor_interface * >( &get_sensor( i ) ) ); + sensors.push_back( &get_sensor( i ) ); + return sensors; +} + + +std::vector< sensor_interface const * > dds_device_proxy::get_serializable_sensors() const +{ + std::vector< sensor_interface const * > sensors; + auto const n_sensors = get_sensors_count(); + for( auto i = 0; i < n_sensors; ++i ) + sensors.push_back( &get_sensor( i ) ); return sensors; } diff --git a/src/dds/rs-dds-device-proxy.h b/src/dds/rs-dds-device-proxy.h index 3681542babd..bc6a2b0b68b 100644 --- a/src/dds/rs-dds-device-proxy.h +++ b/src/dds/rs-dds-device-proxy.h @@ -95,8 +95,8 @@ class dds_device_proxy // dds_serializable private: device_interface const & get_serializable_device() const override { return *this; } - std::vector< sensor_interface * > get_serializable_sensors() const override; - + std::vector< sensor_interface * > get_serializable_sensors() override; + std::vector< sensor_interface const * > get_serializable_sensors() const override; };