-
Notifications
You must be signed in to change notification settings - Fork 226
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix parallel_progress.h for compatibility boost >= 1.83
- Loading branch information
1 parent
350bb7f
commit 6567988
Showing
1 changed file
with
11 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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> | ||
|
@@ -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) { | ||
|
@@ -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 | ||
|