Skip to content

Commit

Permalink
fixup! add dds serializable class for presets
Browse files Browse the repository at this point in the history
  • Loading branch information
maloel committed Jun 27, 2024
1 parent db47f2d commit 66de311
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
14 changes: 12 additions & 2 deletions src/dds/rs-dds-device-proxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
4 changes: 2 additions & 2 deletions src/dds/rs-dds-device-proxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};


Expand Down

0 comments on commit 66de311

Please sign in to comment.