Commit fa8ddc17 authored by Guilhem Saurel's avatar Guilhem Saurel
Browse files

Use Boost.signals2 only

parent aa7b2684
Pipeline #6721 passed with stage
in 4 minutes and 43 seconds
......@@ -25,7 +25,7 @@ PROJECT(${PROJECT_NAME} C CXX)
ADD_REQUIRED_DEPENDENCY(eigen3)
SEARCH_FOR_EIGEN()
SET(BOOST_COMPONENTS program_options signals)
SET(BOOST_COMPONENTS program_options)
SEARCH_FOR_BOOST()
INCLUDE_DIRECTORIES(SYSTEM ${Boost_INCLUDE_DIRS})
......
......@@ -9,18 +9,8 @@
#include "soth/api.hpp"
#include <boost/noncopyable.hpp>
#include <boost/version.hpp>
#ifndef WITHOUT_NOTIFIOR
#if BOOST_VERSION > 105300
#include <boost/signals2.hpp>
#define NOTIFIOR_SIGNAL2
#else
#include <boost/signals.hpp>
#endif
#endif
#include <boost/version.hpp>
namespace soth {
class BaseY;
......@@ -76,20 +66,11 @@ class SOTH_EXPORT BasicStage : boost::noncopyable {
VectorBound getBounds() const;
VectorBound& getBoundsInternal();
public: /* Notification, could be removed conditionnaly to the lack of
boost::signal. */
#ifndef WITHOUT_NOTIFIOR
public:
typedef boost::function<void(std::string, ConstraintRef, std::string)>
listener_function_t;
#ifdef NOTIFIOR_SIGNAL2
boost::signals2::signal<void(std::string, ConstraintRef, std::string)>
notifior;
#else
boost::signal<void(std::string, ConstraintRef, std::string)> notifior;
#endif
#else
inline void notifior(int, int, std::string) {}
#endif
};
} // namespace soth
......
......@@ -116,14 +116,12 @@ void HCOD::setNameByOrder(const std::string root) {
}
void HCOD::notifiorRegistration(const Stage::listener_function_t& f,
int stageRank) {
#ifndef WITHOUT_NOTIFIOR
if (stageRank == -1)
for (size_t i = 0; i < stages.size(); ++i) {
stages[i]->notifior.connect(f);
}
else
stages[stageRank]->notifior.connect(f);
#endif
}
void HCOD::setDamping(const double& d) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment