Skip to content

Commit

Permalink
Fix parallel_progress.h for compatibility boost >= 1.83
Browse files Browse the repository at this point in the history
  • Loading branch information
eunos-1128 committed Feb 17, 2024
1 parent 350bb7f commit 6567988
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/lib/parallel_progress.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,23 @@
See the License for the specific language governing permissions and
limitations under the License.
Author: Dr. Oleg Trott <[email protected]>,
The Olson Lab,
Author: Dr. Oleg Trott <[email protected]>,
The Olson Lab,
The Scripps Research Institute
*/

#ifndef VINA_PARALLEL_PROGRESS_H
#define VINA_PARALLEL_PROGRESS_H

#include <boost/version.hpp>
#if BOOST_VERSION < 107200
#include <boost/progress.hpp>
typedef boost::progress_display boost_progress;
#else
#include <boost/timer/progress_display.hpp>
typedef boost::timer::progress_display boost_progress;
#endif
#include <boost/thread/mutex.hpp>

#include <functional>
Expand All @@ -34,7 +41,7 @@ struct parallel_progress : public incrementable {
parallel_progress(std::function<void(double)>* c = NULL) : p(NULL), callback(c) {}
void init(unsigned long n) {
count = n;
p = new boost::progress_display(count);
p = new boost_progress(count);
}
void operator++() {
if(p) {
Expand All @@ -47,10 +54,9 @@ struct parallel_progress : public incrementable {
virtual ~parallel_progress() { delete p; }
private:
boost::mutex self;
boost::progress_display* p;
boost_progress* p;
std::function<void(double)>* callback;
unsigned long count;
};

#endif

0 comments on commit 6567988

Please sign in to comment.