Commit 9ed232cb authored by Guilhem Saurel's avatar Guilhem Saurel
Browse files

Revert "fix boost >= 1.73 bind warnings"

This reverts commit 62765608.
as this is breaking on boost < 1.73
parent 7e2ec971
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#include "dynamic-graph/command.h" #include "dynamic-graph/command.h"
#include <boost/assign/list_of.hpp> #include <boost/assign/list_of.hpp>
#include <boost/bind/bind.hpp> #include <boost/bind.hpp>
#include <boost/function.hpp> #include <boost/function.hpp>
/* --- FUNCTION 0 ARGS ----------------------------------------------------- */ /* --- FUNCTION 0 ARGS ----------------------------------------------------- */
...@@ -111,17 +111,15 @@ makeCommandVoid1(E &entity, ...@@ -111,17 +111,15 @@ makeCommandVoid1(E &entity,
// the template arg... why ??? // the template arg... why ???
boost::function<void(E *, const T &)> function, boost::function<void(E *, const T &)> function,
const std::string &docString) { const std::string &docString) {
return new CommandVoid1<E, T>( return new CommandVoid1<E, T>(entity, boost::bind(function, &entity, _1),
entity, boost::bind(function, &entity, boost::placeholders::_1), docString);
docString);
} }
template <class E, typename T> template <class E, typename T>
CommandVoid1<E, T> *makeCommandVoid1(E &entity, void (E::*function)(const T &), CommandVoid1<E, T> *makeCommandVoid1(E &entity, void (E::*function)(const T &),
const std::string &docString) { const std::string &docString) {
return new CommandVoid1<E, T>( return new CommandVoid1<E, T>(entity, boost::bind(function, &entity, _1),
entity, boost::bind(function, &entity, boost::placeholders::_1), docString);
docString);
return NULL; return NULL;
} }
...@@ -177,22 +175,16 @@ makeCommandVoid2(E &entity, ...@@ -177,22 +175,16 @@ makeCommandVoid2(E &entity,
// the template arg... why ??? // the template arg... why ???
boost::function<void(E *, const T1 &, const T2 &)> function, boost::function<void(E *, const T1 &, const T2 &)> function,
const std::string &docString) { const std::string &docString) {
return new CommandVoid2<E, T1, T2>(entity, return new CommandVoid2<E, T1, T2>(
boost::bind(function, &entity, entity, boost::bind(function, &entity, _1, _2), docString);
boost::placeholders::_1,
boost::placeholders::_2),
docString);
} }
template <class E, typename T1, typename T2> template <class E, typename T1, typename T2>
CommandVoid2<E, T1, T2> * CommandVoid2<E, T1, T2> *
makeCommandVoid2(E &entity, void (E::*function)(const T1 &, const T2 &), makeCommandVoid2(E &entity, void (E::*function)(const T1 &, const T2 &),
const std::string &docString) { const std::string &docString) {
return new CommandVoid2<E, T1, T2>(entity, return new CommandVoid2<E, T1, T2>(
boost::bind(function, &entity, entity, boost::bind(function, &entity, _1, _2), docString);
boost::placeholders::_1,
boost::placeholders::_2),
docString);
return NULL; return NULL;
} }
...@@ -251,10 +243,7 @@ CommandVoid3<E, T1, T2, T3> *makeCommandVoid3( ...@@ -251,10 +243,7 @@ CommandVoid3<E, T1, T2, T3> *makeCommandVoid3(
boost::function<void(E *, const T1 &, const T2 &, const T3 &)> function, boost::function<void(E *, const T1 &, const T2 &, const T3 &)> function,
const std::string &docString) { const std::string &docString) {
return new CommandVoid3<E, T1, T2, T3>( return new CommandVoid3<E, T1, T2, T3>(
entity, entity, boost::bind(function, &entity, _1, _2, _3), docString);
boost::bind(function, &entity, boost::placeholders::_1,
boost::placeholders::_2, boost::placeholders::_3),
docString);
} }
template <class E, typename T1, typename T2, typename T3> template <class E, typename T1, typename T2, typename T3>
...@@ -263,10 +252,7 @@ makeCommandVoid3(E &entity, ...@@ -263,10 +252,7 @@ makeCommandVoid3(E &entity,
void (E::*function)(const T1 &, const T2 &, const T3 &), void (E::*function)(const T1 &, const T2 &, const T3 &),
const std::string &docString) { const std::string &docString) {
return new CommandVoid3<E, T1, T2, T3>( return new CommandVoid3<E, T1, T2, T3>(
entity, entity, boost::bind(function, &entity, _1, _2, _3), docString);
boost::bind(function, &entity, boost::placeholders::_1,
boost::placeholders::_2, boost::placeholders::_3),
docString);
return NULL; return NULL;
} }
...@@ -331,11 +317,7 @@ CommandVoid4<E, T1, T2, T3, T4> *makeCommandVoid4( ...@@ -331,11 +317,7 @@ CommandVoid4<E, T1, T2, T3, T4> *makeCommandVoid4(
function, function,
const std::string &docString) { const std::string &docString) {
return new CommandVoid4<E, T1, T2, T3, T4>( return new CommandVoid4<E, T1, T2, T3, T4>(
entity, entity, boost::bind(function, &entity, _1, _2, _3, _4), docString);
boost::bind(function, &entity, boost::placeholders::_1,
boost::placeholders::_2, boost::placeholders::_3,
boost::placeholders::_4),
docString);
} }
template <class E, typename T1, typename T2, typename T3, typename T4> template <class E, typename T1, typename T2, typename T3, typename T4>
...@@ -344,11 +326,7 @@ CommandVoid4<E, T1, T2, T3, T4> *makeCommandVoid4( ...@@ -344,11 +326,7 @@ CommandVoid4<E, T1, T2, T3, T4> *makeCommandVoid4(
void (E::*function)(const T1 &, const T2 &, const T3 &, const T4 &), void (E::*function)(const T1 &, const T2 &, const T3 &, const T4 &),
const std::string &docString) { const std::string &docString) {
return new CommandVoid4<E, T1, T2, T3, T4>( return new CommandVoid4<E, T1, T2, T3, T4>(
entity, entity, boost::bind(function, &entity, _1, _2, _3, _4), docString);
boost::bind(function, &entity, boost::placeholders::_1,
boost::placeholders::_2, boost::placeholders::_3,
boost::placeholders::_4),
docString);
return NULL; return NULL;
} }
...@@ -401,9 +379,8 @@ template <class E> ...@@ -401,9 +379,8 @@ template <class E>
CommandVerbose<E> *makeCommandVerbose(E &entity, CommandVerbose<E> *makeCommandVerbose(E &entity,
void (E::*function)(std::ostream &), void (E::*function)(std::ostream &),
const std::string &docString) { const std::string &docString) {
return new CommandVerbose<E>( return new CommandVerbose<E>(entity, boost::bind(function, &entity, _1),
entity, boost::bind(function, &entity, boost::placeholders::_1), docString);
docString);
return NULL; return NULL;
} }
...@@ -507,8 +484,7 @@ makeCommandReturnType1(E &entity, ...@@ -507,8 +484,7 @@ makeCommandReturnType1(E &entity,
boost::function<ReturnType(E *, const T &)> function, boost::function<ReturnType(E *, const T &)> function,
const std::string &docString) { const std::string &docString) {
return new CommandReturnType1<E, ReturnType, T>( return new CommandReturnType1<E, ReturnType, T>(
entity, boost::bind(function, &entity, boost::placeholders::_1), entity, boost::bind(function, &entity, _1), docString);
docString);
} }
template <class E, typename ReturnType, typename T> template <class E, typename ReturnType, typename T>
...@@ -516,8 +492,7 @@ CommandReturnType1<E, ReturnType, T> * ...@@ -516,8 +492,7 @@ CommandReturnType1<E, ReturnType, T> *
makeCommandReturnType1(E &entity, ReturnType (E::*function)(const T &), makeCommandReturnType1(E &entity, ReturnType (E::*function)(const T &),
const std::string &docString) { const std::string &docString) {
return new CommandReturnType1<E, ReturnType, T>( return new CommandReturnType1<E, ReturnType, T>(
entity, boost::bind(function, &entity, boost::placeholders::_1), entity, boost::bind(function, &entity, _1), docString);
docString);
return NULL; return NULL;
} }
...@@ -576,10 +551,7 @@ CommandReturnType2<E, ReturnType, T1, T2> *makeCommandReturnType2( ...@@ -576,10 +551,7 @@ CommandReturnType2<E, ReturnType, T1, T2> *makeCommandReturnType2(
boost::function<ReturnType(E *, const T1 &, const T2 &)> function, boost::function<ReturnType(E *, const T1 &, const T2 &)> function,
const std::string &docString) { const std::string &docString) {
return new CommandReturnType2<E, ReturnType, T1, T2>( return new CommandReturnType2<E, ReturnType, T1, T2>(
entity, entity, boost::bind(function, &entity, _1, _2), docString);
boost::bind(function, &entity, boost::placeholders::_1,
boost::placeholders::_2),
docString);
} }
template <class E, typename ReturnType, typename T1, typename T2> template <class E, typename ReturnType, typename T1, typename T2>
...@@ -588,10 +560,7 @@ makeCommandReturnType2(E &entity, ...@@ -588,10 +560,7 @@ makeCommandReturnType2(E &entity,
ReturnType (E::*function)(const T1 &, const T2 &), ReturnType (E::*function)(const T1 &, const T2 &),
const std::string &docString) { const std::string &docString) {
return new CommandReturnType2<E, ReturnType, T1, T2>( return new CommandReturnType2<E, ReturnType, T1, T2>(
entity, entity, boost::bind(function, &entity, _1, _2), docString);
boost::bind(function, &entity, boost::placeholders::_1,
boost::placeholders::_2),
docString);
return NULL; return NULL;
} }
......
...@@ -26,10 +26,9 @@ ...@@ -26,10 +26,9 @@
#type + ")::" + #name) #type + ")::" + #name)
#define BIND_SIGNAL_TO_FUNCTION(name, IO, type) \ #define BIND_SIGNAL_TO_FUNCTION(name, IO, type) \
m_##name##S##IO.setFunction(boost::bind( \ m_##name##S##IO.setFunction(boost::bind( \
&EntityClassName::SIGNAL_OUT_FUNCTION_NAME(name), this, &EntityClassName::SIGNAL_OUT_FUNCTION_NAME(name), this, _1, _2));
boost::placeholders::_1, boost::placeholders::_2));
/**/ /**/
#define DECLARE_SIGNAL_IN(name, type) \ #define DECLARE_SIGNAL_IN(name, type) \
::dynamicgraph::SignalPtr<type, int> m_##name##SIN ::dynamicgraph::SignalPtr<type, int> m_##name##SIN
...@@ -37,7 +36,7 @@ ...@@ -37,7 +36,7 @@
m_##name##SIN(NULL, getClassName() + "(" + getName() + ")::input(" + #type + \ m_##name##SIN(NULL, getClassName() + "(" + getName() + ")::input(" + #type + \
")::" + #name) ")::" + #name)
/**/ /**/
#define DECLARE_SIGNAL_OUT_FUNCTION(name, type) \ #define DECLARE_SIGNAL_OUT_FUNCTION(name, type) \
type &SIGNAL_OUT_FUNCTION_NAME(name)(type &, int) type &SIGNAL_OUT_FUNCTION_NAME(name)(type &, int)
...@@ -56,12 +55,10 @@ protected: \ ...@@ -56,12 +55,10 @@ protected: \
#define CONSTRUCT_SIGNAL_OUT(name, type, dep) \ #define CONSTRUCT_SIGNAL_OUT(name, type, dep) \
m_##name##SOUT( \ m_##name##SOUT( \
boost::bind(&EntityClassName::name##SOUT_function, this, \ boost::bind(&EntityClassName::name##SOUT_function, this, _1, _2), dep, \
boost::placeholders::_1, boost::placeholders::_2), \
dep, \
getClassName() + "(" + getName() + ")::output(" + #type + ")::" + #name) getClassName() + "(" + getName() + ")::output(" + #type + ")::" + #name)
/**************** INNER SIGNALS *******************/ /**************** INNER SIGNALS *******************/
#define SIGNAL_INNER_FUNCTION_NAME(name) name##SINNER_function #define SIGNAL_INNER_FUNCTION_NAME(name) name##SINNER_function
#define DECLARE_SIGNAL_INNER_FUNCTION(name, type) \ #define DECLARE_SIGNAL_INNER_FUNCTION(name, type) \
...@@ -79,9 +76,7 @@ protected: \ ...@@ -79,9 +76,7 @@ protected: \
#define CONSTRUCT_SIGNAL_INNER(name, type, dep) \ #define CONSTRUCT_SIGNAL_INNER(name, type, dep) \
m_##name##SINNER( \ m_##name##SINNER( \
boost::bind(&EntityClassName::name##SINNER_function, this, \ boost::bind(&EntityClassName::name##SINNER_function, this, _1, _2), dep, \
boost::placeholders::_1, boost::placeholders::_2), \
dep, \
getClassName() + "(" + getName() + ")::inner(" + #type + ")::" + #name) getClassName() + "(" + getName() + ")::inner(" + #type + ")::" + #name)
#endif // __dynamic_graph_signal_helper_H__ #endif // __dynamic_graph_signal_helper_H__
...@@ -38,8 +38,7 @@ namespace dynamicgraph { ...@@ -38,8 +38,7 @@ namespace dynamicgraph {
: Entity (name) : Entity (name)
, signal ( , signal (
// Set the function that computes the signal value // Set the function that computes the signal value
boost::bind (&Entity::computeSignal, this, boost::placeholders::_1, boost::bind (&Entity::computeSignal, this, _1, _2),
boost::placeholders::_2),
// Declare the dependencies // Declare the dependencies
dep1 << dep2, dep1 << dep2,
"signalname") "signalname")
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#ifndef __SIGNAL_HH #ifndef __SIGNAL_HH
#define __SIGNAL_HH #define __SIGNAL_HH
#include <boost/bind/bind.hpp> #include <boost/bind.hpp>
#include <boost/function.hpp> #include <boost/function.hpp>
#include <string> #include <string>
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
/* --------------------------------------------------------------------- */ /* --------------------------------------------------------------------- */
/* DG */ /* DG */
#include <boost/bind/bind.hpp> #include <boost/bind.hpp>
#include <iomanip> #include <iomanip>
#include <dynamic-graph/all-commands.h> #include <dynamic-graph/all-commands.h>
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
/* --------------------------------------------------------------------- */ /* --------------------------------------------------------------------- */
/* DG */ /* DG */
#include <boost/bind/bind.hpp> #include <boost/bind.hpp>
#include <dynamic-graph/all-commands.h> #include <dynamic-graph/all-commands.h>
#include <dynamic-graph/debug.h> #include <dynamic-graph/debug.h>
#include <dynamic-graph/factory.h> #include <dynamic-graph/factory.h>
...@@ -34,9 +34,8 @@ Tracer::Tracer(const std::string n) ...@@ -34,9 +34,8 @@ Tracer::Tracer(const std::string n)
: Entity(n), toTraceSignals(), traceStyle(TRACE_STYLE_DEFAULT), : Entity(n), toTraceSignals(), traceStyle(TRACE_STYLE_DEFAULT),
frequency(1), basename(), suffix(".dat"), rootdir(), namesSet(false), frequency(1), basename(), suffix(".dat"), rootdir(), namesSet(false),
files(), names(), play(false), timeStart(0), files(), names(), play(false), timeStart(0),
triger(boost::bind(&Tracer::recordTrigger, this, boost::placeholders::_1, triger(boost::bind(&Tracer::recordTrigger, this, _1, _2), sotNOSIGNAL,
boost::placeholders::_2), "Tracer(" + n + ")::triger") {
sotNOSIGNAL, "Tracer(" + n + ")::triger") {
signalRegistration(triger); signalRegistration(triger);
/* --- Commands --- */ /* --- Commands --- */
......
...@@ -35,14 +35,12 @@ struct MyEntity : public dynamicgraph::Entity { ...@@ -35,14 +35,12 @@ struct MyEntity : public dynamicgraph::Entity {
explicit MyEntity(const std::string &name) explicit MyEntity(const std::string &name)
: Entity(name), : Entity(name),
m_sigdSIN("MyEntity(" + name + ")::input(double)::in_double"), m_sigdSIN("MyEntity(" + name + ")::input(double)::in_double"),
m_sigdTimeDepSOUT( m_sigdTimeDepSOUT(boost::bind(&MyEntity::update, this, _1, _2),
boost::bind(&MyEntity::update, this, boost::placeholders::_1, m_sigdSIN,
boost::placeholders::_2), "MyEntity(" + name + ")::input(double)::out_double"),
m_sigdSIN, "MyEntity(" + name + ")::input(double)::out_double"),
m_sigdTwoTimeDepSOUT( m_sigdTwoTimeDepSOUT(
boost::bind(&MyEntity::update, this, boost::placeholders::_1, boost::bind(&MyEntity::update, this, _1, _2), m_sigdSIN,
boost::placeholders::_2), "MyEntity(" + name + ")::input(double)::out2double")
m_sigdSIN, "MyEntity(" + name + ")::input(double)::out2double")
{ {
signalRegistration(m_sigdSIN << m_sigdTimeDepSOUT << m_sigdTwoTimeDepSOUT); signalRegistration(m_sigdSIN << m_sigdTimeDepSOUT << m_sigdTwoTimeDepSOUT);
......
...@@ -35,18 +35,15 @@ struct MyEntity : public dynamicgraph::Entity { ...@@ -35,18 +35,15 @@ struct MyEntity : public dynamicgraph::Entity {
explicit MyEntity(const std::string &name) explicit MyEntity(const std::string &name)
: Entity(name), : Entity(name),
m_sigdSIN("MyEntity(" + name + ")::input(double)::in_double"), m_sigdSIN("MyEntity(" + name + ")::input(double)::in_double"),
m_sigdTimeDepSOUT( m_sigdTimeDepSOUT(boost::bind(&MyEntity::update, this, _1, _2),
boost::bind(&MyEntity::update, this, boost::placeholders::_1, m_sigdSIN,
boost::placeholders::_2), "MyEntity(" + name + ")::input(double)::out_double"),
m_sigdSIN, "MyEntity(" + name + ")::input(double)::out_double"), m_sigVTimeDepSOUT(boost::bind(&MyEntity::updateVector, this, _1, _2),
m_sigVTimeDepSOUT( m_sigdSIN,
boost::bind(&MyEntity::updateVector, this, boost::placeholders::_1, "MyEntity(" + name + ")::input(vector)::out_vector"),
boost::placeholders::_2),
m_sigdSIN, "MyEntity(" + name + ")::input(vector)::out_vector"),
m_sigdTwoTimeDepSOUT( m_sigdTwoTimeDepSOUT(
boost::bind(&MyEntity::update, this, boost::placeholders::_1, boost::bind(&MyEntity::update, this, _1, _2), m_sigdSIN,
boost::placeholders::_2), "MyEntity(" + name + ")::input(double)::out2double")
m_sigdSIN, "MyEntity(" + name + ")::input(double)::out2double")
{ {
signalRegistration(m_sigdSIN << m_sigdTimeDepSOUT << m_sigVTimeDepSOUT signalRegistration(m_sigdSIN << m_sigdTimeDepSOUT << m_sigVTimeDepSOUT
......
...@@ -41,9 +41,8 @@ public: ...@@ -41,9 +41,8 @@ public:
m_sigdSIN2(NULL, m_sigdSIN2(NULL,
"CustomEntity(" + name + ")::input(double)::in_double"), "CustomEntity(" + name + ")::input(double)::in_double"),
m_sigdTimeDepSOUT( m_sigdTimeDepSOUT(
boost::bind(&CustomEntity::update, this, boost::placeholders::_1, boost::bind(&CustomEntity::update, this, _1, _2), m_sigdSIN,
boost::placeholders::_2), "CustomEntity(" + name + ")::input(double)::out_double"),
m_sigdSIN, "CustomEntity(" + name + ")::input(double)::out_double"),
m_value(0.0) {} m_value(0.0) {}
~CustomEntity() { entityDeregistration(); } ~CustomEntity() { entityDeregistration(); }
......
...@@ -30,10 +30,9 @@ struct MyEntity : public dynamicgraph::Entity { ...@@ -30,10 +30,9 @@ struct MyEntity : public dynamicgraph::Entity {
explicit MyEntity(const std::string &name) explicit MyEntity(const std::string &name)
: Entity(name), : Entity(name),
m_sigdSIN(NULL, "MyEntity(" + name + ")::input(double)::in_double"), m_sigdSIN(NULL, "MyEntity(" + name + ")::input(double)::in_double"),
m_sigdTimeDepSOUT( m_sigdTimeDepSOUT(boost::bind(&MyEntity::update, this, _1, _2),
boost::bind(&MyEntity::update, this, boost::placeholders::_1, m_sigdSIN,
boost::placeholders::_2), "MyEntity(" + name + ")::input(double)::out_double") {
m_sigdSIN, "MyEntity(" + name + ")::input(double)::out_double") {
signalRegistration(m_sigdSIN << m_sigdTimeDepSOUT); signalRegistration(m_sigdSIN << m_sigdTimeDepSOUT);
} }
......
...@@ -158,9 +158,7 @@ BOOST_AUTO_TEST_CASE(normal_test) { ...@@ -158,9 +158,7 @@ BOOST_AUTO_TEST_CASE(normal_test) {
} }
BOOST_CHECK(true); BOOST_CHECK(true);
sigPtrA.setFunction(boost::bind(&DummyClass<double>::fun, &pro3, sigPtrA.setFunction(boost::bind(&DummyClass<double>::fun, &pro3, _1, _2));
boost::placeholders::_1,
boost::placeholders::_2));
sigPtrA.recompute(3); sigPtrA.recompute(3);
/// Plugging signal. /// Plugging signal.
......
...@@ -75,27 +75,15 @@ BOOST_AUTO_TEST_CASE(signaltimedependent) { ...@@ -75,27 +75,15 @@ BOOST_AUTO_TEST_CASE(signaltimedependent) {
sigString_t sig4(sig5, "Sig4"); sigString_t sig4(sig5, "Sig4");
sigString_t sig2(sig4 << sig4 << sig4 << sig6, "Sig2"); sigString_t sig2(sig4 << sig4 << sig4 << sig6, "Sig2");
sigDouble_t sig3(sig2 << sig5 << sig6, "Sig3"); sigDouble_t sig3(sig2 << sig5 << sig6, "Sig3");
sigDouble_t sig1(boost::bind(&DummyClass<double>::fun, &pro1, sigDouble_t sig1(boost::bind(&DummyClass<double>::fun, &pro1, _1, _2),
boost::placeholders::_1,
boost::placeholders::_2),
sig2 << sig3, "Sig1"); sig2 << sig3, "Sig1");
sigDouble_t sig7("Sig7"); sigDouble_t sig7("Sig7");
sig2.setFunction(boost::bind(&DummyClass<std::string>::fun, &pro2, sig2.setFunction(boost::bind(&DummyClass<std::string>::fun, &pro2, _1, _2));
boost::placeholders::_1, sig3.setFunction(boost::bind(&DummyClass<double>::fun, &pro3, _1, _2));
boost::placeholders::_2)); sig4.setFunction(boost::bind(&DummyClass<std::string>::fun, &pro4, _1, _2));
sig3.setFunction(boost::bind(&DummyClass<double>::fun, &pro3, sig5.setFunction(boost::bind(&DummyClass<double>::fun, &pro5, _1, _2));
boost::placeholders::_1, sig6.setFunction(boost::bind(&DummyClass<std::string>::fun, &pro6, _1, _2));
boost::placeholders::_2));
sig4.setFunction(boost::bind(&DummyClass<std::string>::fun, &pro4,
boost::placeholders::_1,
boost::placeholders::_2));
sig5.setFunction(boost::bind(&DummyClass<double>::fun, &pro5,
boost::placeholders::_1,
boost::placeholders::_2));
sig6.setFunction(boost::bind(&DummyClass<std::string>::fun, &pro6,
boost::placeholders::_1,
boost::placeholders::_2));
pro1.add(sig2); pro1.add(sig2);
pro1.add(sig3); pro1.add(sig3);
......
Markdown is supported
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