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

fix boost >= 1.73 bind warnings

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