Skip to content

Commit

Permalink
dynamic pointer cast added
Browse files Browse the repository at this point in the history
  • Loading branch information
Tamir91 committed Dec 4, 2023
1 parent ed3f507 commit 88c0fbd
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/ds/d400/d400-device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ namespace librealsense
"Generate trigger from the camera to external device once per frame"));

depth_sensor.register_option(RS2_OPTION_ASIC_TEMPERATURE,
std::make_shared<asic_and_projector_temperature_options>(std::make_shared<uvc_sensor>(raw_depth_sensor),
std::make_shared<asic_and_projector_temperature_options>(std::dynamic_pointer_cast<uvc_sensor>(raw_depth_sensor.shared_from_this()),
RS2_OPTION_ASIC_TEMPERATURE));

// D457 dev - get_xu fails for D457 - error polling id not defined
Expand Down Expand Up @@ -1300,7 +1300,7 @@ namespace librealsense
std::vector<float>{0.f, 2.f}, 1.f));

depth_ep.register_option(RS2_OPTION_PROJECTOR_TEMPERATURE,
std::make_shared<asic_and_projector_temperature_options>(std::make_shared<uvc_sensor>(depth_ep),
std::make_shared<asic_and_projector_temperature_options>(std::dynamic_pointer_cast<uvc_sensor>(depth_ep.shared_from_this()),
RS2_OPTION_PROJECTOR_TEMPERATURE));
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/ds/ds-active-common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ namespace librealsense
else
{
_depth_ep.register_option(RS2_OPTION_PROJECTOR_TEMPERATURE,
std::make_shared<asic_and_projector_temperature_options>(std::make_shared<uvc_sensor>(_raw_depth_ep),
std::make_shared<asic_and_projector_temperature_options>(std::dynamic_pointer_cast<uvc_sensor>(_raw_depth_ep.shared_from_this()),
RS2_OPTION_PROJECTOR_TEMPERATURE));
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/ds/ds-options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ namespace librealsense
}
}

asic_and_projector_temperature_options::asic_and_projector_temperature_options(std::shared_ptr<uvc_sensor> ep, rs2_option opt)
: _option(opt), _ep(ep)
asic_and_projector_temperature_options::asic_and_projector_temperature_options(std::shared_ptr<uvc_sensor> && ep, rs2_option opt)
: _option(opt), _ep(std::move(ep))
{}

float motion_module_temperature_option::query() const
Expand Down
2 changes: 1 addition & 1 deletion src/ds/ds-options.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace librealsense

const char* get_description() const override;

explicit asic_and_projector_temperature_options(std::shared_ptr<uvc_sensor> ep, rs2_option opt);
explicit asic_and_projector_temperature_options(std::shared_ptr <uvc_sensor> && ep, rs2_option opt);

private:
std::weak_ptr<uvc_sensor> _ep;
Expand Down

0 comments on commit 88c0fbd

Please sign in to comment.