Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace deprecated usages of boost #72

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions include/reach/plugins/boost_progress_console_logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@

#include <reach/interfaces/logger.h>

#include <boost/shared_ptr.hpp>
#include <boost/progress.hpp>
#include <boost/timer/progress_display.hpp>
Comment on lines -22 to +21
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we could probably do something like this to continue supporting focal but fix the deprecation problem

#if __has_include(<boost/timer/progress_display.hpp>)
#include <boost/timer/progress_display.hpp>
#else
#include <boost/progress.hpp>
#endif

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The namespace also changed, so the fix is not as easy, unfortunately

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. I was hoping we could use an alias, but it appears that timer is a class in focal, so this won't be possible.

#include <mutex>

namespace reach
Expand All @@ -39,7 +38,7 @@ class BoostProgressConsoleLogger : public Logger

protected:
mutable std::mutex mutex_;
mutable boost::shared_ptr<boost::progress_display> display_;
mutable std::shared_ptr<boost::timer::progress_display> display_;
};

struct BoostProgressConsoleLoggerFactory : public LoggerFactory
Expand Down
2 changes: 0 additions & 2 deletions include/reach/plugins/no_op.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
#include <reach/interfaces/ik_solver.h>
#include <reach/interfaces/display.h>

#include <boost/shared_ptr.hpp>

namespace reach
{
struct NoOpEvaluator : public Evaluator
Expand Down
4 changes: 1 addition & 3 deletions include/reach/reach_visualizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
#include <reach/interfaces/ik_solver.h>
#include <reach/utils.h>

#include <boost/shared_ptr.hpp>

namespace reach
{
/**
Expand All @@ -32,7 +30,7 @@ namespace reach
class ReachVisualizer
{
public:
using Ptr = boost::shared_ptr<ReachVisualizer>;
using Ptr = std::shared_ptr<ReachVisualizer>;

ReachVisualizer(ReachResult result, IKSolver::ConstPtr solver, Evaluator::ConstPtr evaluator,
Display::ConstPtr display, const double neighbor_radius);
Expand Down
3 changes: 1 addition & 2 deletions src/plugins/boost_progress_console_logger.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include <reach/plugins/boost_progress_console_logger.h>
#include <reach/types.h>

#include <boost/make_shared.hpp>
#include <iostream>

namespace reach
Expand All @@ -13,7 +12,7 @@ BoostProgressConsoleLogger::BoostProgressConsoleLogger() : display_(nullptr)
void BoostProgressConsoleLogger::setMaxProgress(unsigned long max_progress)
{
std::lock_guard<std::mutex> lock{ mutex_ };
display_ = boost::make_shared<boost::progress_display>(max_progress);
display_ = std::make_shared<boost::timer::progress_display>(max_progress);
}

void BoostProgressConsoleLogger::printProgress(unsigned long progress) const
Expand Down
Loading