From 49e0f8a43b531bd6ce3943afa21eb29a1a02d4ae Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 29 Sep 2025 19:14:03 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/mirrors-clang-format: v20.1.8 → v21.1.2](https://github.com/pre-commit/mirrors-clang-format/compare/v20.1.8...v21.1.2) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1f3551fb..5edc3c7a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,7 +2,7 @@ ci: autoupdate_branch: 'devel' repos: - repo: https://github.com/pre-commit/mirrors-clang-format - rev: v20.1.8 + rev: v21.1.2 hooks: - id: clang-format args: [--style=Google] From 80d0ffd8a2fefe5416fa1c3e21783ee194bde97b Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 29 Sep 2025 19:14:12 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- include/dynamic-graph/command-bind.h | 433 +++++++++--------- include/dynamic-graph/command-direct-getter.h | 12 +- include/dynamic-graph/command-direct-setter.h | 14 +- include/dynamic-graph/command-getter.h | 2 +- include/dynamic-graph/command-getter.t.cpp | 6 +- include/dynamic-graph/command-setter.h | 4 +- include/dynamic-graph/command-setter.t.cpp | 120 ++--- include/dynamic-graph/command.h | 14 +- include/dynamic-graph/debug.h | 40 +- include/dynamic-graph/eigen-io.h | 20 +- include/dynamic-graph/entity.h | 52 +-- include/dynamic-graph/exception-abstract.h | 28 +- include/dynamic-graph/exception-factory.h | 10 +- include/dynamic-graph/exception-signal.h | 10 +- include/dynamic-graph/exception-traces.h | 10 +- include/dynamic-graph/factory.h | 24 +- include/dynamic-graph/logger.h | 18 +- include/dynamic-graph/pool.h | 30 +- include/dynamic-graph/process-list.hh | 12 +- include/dynamic-graph/real-time-logger-def.h | 30 +- include/dynamic-graph/signal-array.h | 38 +- include/dynamic-graph/signal-base.h | 42 +- include/dynamic-graph/signal-caster.h | 28 +- include/dynamic-graph/signal-helper.h | 10 +- include/dynamic-graph/signal-ptr.h | 54 +-- include/dynamic-graph/signal-ptr.t.cpp | 24 +- include/dynamic-graph/signal-time-dependent.h | 38 +- include/dynamic-graph/signal.h | 56 +-- include/dynamic-graph/signal.t.cpp | 38 +- include/dynamic-graph/time-dependency.h | 22 +- include/dynamic-graph/time-dependency.t.cpp | 22 +- include/dynamic-graph/tracer-real-time.h | 28 +- include/dynamic-graph/tracer.h | 34 +- include/dynamic-graph/value.h | 42 +- src/command/command.cpp | 14 +- src/command/value.cpp | 96 ++-- src/debug/debug.cpp | 12 +- src/debug/logger.cpp | 8 +- src/debug/real-time-logger.cpp | 16 +- src/dgraph/entity.cpp | 42 +- src/dgraph/factory.cpp | 20 +- src/dgraph/pool.cpp | 44 +- src/exception/exception-abstract.cpp | 14 +- src/exception/exception-factory.cpp | 6 +- src/exception/exception-signal.cpp | 8 +- src/exception/exception-traces.cpp | 8 +- src/mt/process-list.cpp | 4 +- src/traces/tracer-real-time.cpp | 44 +- src/traces/tracer.cpp | 34 +- tests/command-test.cpp | 36 +- tests/custom-entity.cpp | 10 +- tests/debug-logger-winit.cpp | 8 +- tests/debug-logger.cpp | 8 +- tests/debug-real-time-tracer.cpp | 21 +- tests/debug-trace.cpp | 10 +- tests/debug-tracer.cpp | 28 +- tests/entity.cpp | 44 +- tests/exceptions.cpp | 2 +- tests/factory.cpp | 18 +- tests/pool.cpp | 28 +- tests/real-time-logger.cpp | 2 +- tests/signal-all.cpp | 14 +- tests/signal-cast-registerer.cpp | 40 +- tests/signal-ptr.cpp | 32 +- tests/signal-time-dependent.cpp | 18 +- tests/value.cpp | 20 +- 66 files changed, 1035 insertions(+), 1039 deletions(-) diff --git a/include/dynamic-graph/command-bind.h b/include/dynamic-graph/command-bind.h index 351dc1cb..ab495b79 100644 --- a/include/dynamic-graph/command-bind.h +++ b/include/dynamic-graph/command-bind.h @@ -32,8 +32,8 @@ namespace command { template struct CommandVoid0 : public Command { - CommandVoid0(E &entity, boost::function function, - const std::string &docString) + CommandVoid0(E& entity, boost::function function, + const std::string& docString) : Command(entity, EMPTY_ARG, docString), fptr(function) {} protected: @@ -48,26 +48,25 @@ struct CommandVoid0 : public Command { }; template -CommandVoid0 *makeCommandVoid0(E &entity, +CommandVoid0* makeCommandVoid0(E& entity, boost::function function, - const std::string &docString) { + const std::string& docString) { return new CommandVoid0(entity, function, docString); } template -CommandVoid0 *makeCommandVoid0(E &entity, - boost::function function, - const std::string &docString) { +CommandVoid0* makeCommandVoid0(E& entity, boost::function function, + const std::string& docString) { return new CommandVoid0(entity, boost::bind(function, &entity), docString); } template -CommandVoid0 *makeCommandVoid0(E &entity, void (E::*function)(void), - const std::string &docString) { +CommandVoid0* makeCommandVoid0(E& entity, void (E::*function)(void), + const std::string& docString) { return new CommandVoid0(entity, boost::bind(function, &entity), docString); } -inline std::string docCommandVoid0(const std::string &doc) { +inline std::string docCommandVoid0(const std::string& doc) { return std::string("\n") + doc + "\n\nNo input.\nVoid return.\n\n"; } @@ -80,9 +79,9 @@ namespace command { template struct CommandVoid1 : public Command { - typedef boost::function function_t; + typedef boost::function function_t; - CommandVoid1(E &entity, function_t function, const std::string &docString) + CommandVoid1(E& entity, function_t function, const std::string& docString) : Command(entity, boost::assign::list_of(ValueHelper::TypeID), docString), fptr(function) {} @@ -100,34 +99,34 @@ struct CommandVoid1 : public Command { }; template -CommandVoid1 *makeCommandVoid1( - E &entity, boost::function function, +CommandVoid1* makeCommandVoid1( + E& entity, boost::function function, // typename CommandVoid1::function_t function , - const std::string &docString) { + const std::string& docString) { return new CommandVoid1(entity, function, docString); } template -CommandVoid1 *makeCommandVoid1( - E &entity, +CommandVoid1* makeCommandVoid1( + E& entity, // The following syntaxt don't compile when not specializing // the template arg... why ??? - boost::function function, - const std::string &docString) { + boost::function function, + const std::string& docString) { return new CommandVoid1(entity, boost::bind(function, &entity, _1), docString); } template -CommandVoid1 *makeCommandVoid1(E &entity, void (E::*function)(const T &), - const std::string &docString) { +CommandVoid1* makeCommandVoid1(E& entity, void (E::*function)(const T&), + const std::string& docString) { return new CommandVoid1(entity, boost::bind(function, &entity, _1), docString); return NULL; } -inline std::string docCommandVoid1(const std::string &doc, - const std::string &type) { +inline std::string docCommandVoid1(const std::string& doc, + const std::string& type) { return std::string("\n") + doc + "\n\nInput:\n - A " + type + ".\nVoid return.\n\n"; } @@ -141,9 +140,9 @@ namespace command { template struct CommandVoid2 : public Command { - typedef boost::function function_t; + typedef boost::function function_t; - CommandVoid2(E &entity, function_t function, const std::string &docString) + CommandVoid2(E& entity, function_t function, const std::string& docString) : Command(entity, boost::assign::list_of(ValueHelper::TypeID)( ValueHelper::TypeID), @@ -164,36 +163,36 @@ struct CommandVoid2 : public Command { }; template -CommandVoid2 *makeCommandVoid2( - E &entity, boost::function function, - const std::string &docString) { +CommandVoid2* makeCommandVoid2( + E& entity, boost::function function, + const std::string& docString) { return new CommandVoid2(entity, function, docString); } template -CommandVoid2 *makeCommandVoid2( - E &entity, +CommandVoid2* makeCommandVoid2( + E& entity, // The following syntaxt don't compile when not specializing // the template arg... why ??? - boost::function function, - const std::string &docString) { + boost::function function, + const std::string& docString) { return new CommandVoid2( entity, boost::bind(function, &entity, _1, _2), docString); } template -CommandVoid2 *makeCommandVoid2(E &entity, - void (E::*function)(const T1 &, - const T2 &), - const std::string &docString) { +CommandVoid2* makeCommandVoid2(E& entity, + void (E::*function)(const T1&, + const T2&), + const std::string& docString) { return new CommandVoid2( entity, boost::bind(function, &entity, _1, _2), docString); return NULL; } -inline std::string docCommandVoid2(const std::string &doc, - const std::string &type1, - const std::string &type2) { +inline std::string docCommandVoid2(const std::string& doc, + const std::string& type1, + const std::string& type2) { return (std::string("\n") + doc + "\n\n" + "Input:\n - A " + type1 + ".\n" + "Input:\n - A " + type2 + ".\n" + "Void return.\n\n"); } @@ -207,9 +206,9 @@ namespace command { template struct CommandVoid3 : public Command { - typedef boost::function function_t; + typedef boost::function function_t; - CommandVoid3(E &entity, function_t function, const std::string &docString) + CommandVoid3(E& entity, function_t function, const std::string& docString) : Command(entity, boost::assign::list_of(ValueHelper::TypeID)( ValueHelper::TypeID)(ValueHelper::TypeID), @@ -231,36 +230,36 @@ struct CommandVoid3 : public Command { }; template -CommandVoid3 *makeCommandVoid3( - E &entity, typename CommandVoid3::function_t function, - const std::string &docString) { +CommandVoid3* makeCommandVoid3( + E& entity, typename CommandVoid3::function_t function, + const std::string& docString) { return new CommandVoid3(entity, function, docString); } template -CommandVoid3 *makeCommandVoid3( - E &entity, +CommandVoid3* makeCommandVoid3( + E& entity, // The following syntaxt don't compile when not specializing the template // arg... why ??? - boost::function function, - const std::string &docString) { + boost::function function, + const std::string& docString) { return new CommandVoid3( entity, boost::bind(function, &entity, _1, _2, _3), docString); } template -CommandVoid3 *makeCommandVoid3( - E &entity, void (E::*function)(const T1 &, const T2 &, const T3 &), - const std::string &docString) { +CommandVoid3* makeCommandVoid3( + E& entity, void (E::*function)(const T1&, const T2&, const T3&), + const std::string& docString) { return new CommandVoid3( entity, boost::bind(function, &entity, _1, _2, _3), docString); return NULL; } -inline std::string docCommandVoid3(const std::string &doc, - const std::string &type1, - const std::string &type2, - const std::string &type3) { +inline std::string docCommandVoid3(const std::string& doc, + const std::string& type1, + const std::string& type2, + const std::string& type3) { return (std::string("\n") + doc + "\n\n" + "Input:\n - A " + type1 + ".\n" + "Input:\n - A " + type2 + ".\n" + "Input:\n - A " + type3 + ".\n" + "Void return.\n\n"); @@ -275,12 +274,12 @@ namespace command { template struct CommandVoid4 : public Command { - typedef boost::function + typedef boost::function function_t; - typedef void (E::*memberFunction_ptr_t)(const T1 &, const T2 &, const T3 &, - const T4 &); + typedef void (E::*memberFunction_ptr_t)(const T1&, const T2&, const T3&, + const T4&); - CommandVoid4(E &entity, function_t function, const std::string &docString) + CommandVoid4(E& entity, function_t function, const std::string& docString) : Command(entity, boost::assign::list_of(ValueHelper::TypeID)( ValueHelper::TypeID)(ValueHelper::TypeID)( @@ -304,37 +303,36 @@ struct CommandVoid4 : public Command { }; template -CommandVoid4 *makeCommandVoid4( - E &entity, typename CommandVoid4::function_t function, - const std::string &docString) { +CommandVoid4* makeCommandVoid4( + E& entity, typename CommandVoid4::function_t function, + const std::string& docString) { return new CommandVoid4(entity, function, docString); } template -CommandVoid4 *makeCommandVoid4( - E &entity, - boost::function +CommandVoid4* makeCommandVoid4( + E& entity, + boost::function function, - const std::string &docString) { + const std::string& docString) { return new CommandVoid4( entity, boost::bind(function, &entity, _1, _2, _3, _4), docString); } template -CommandVoid4 *makeCommandVoid4( - E &entity, - void (E::*function)(const T1 &, const T2 &, const T3 &, const T4 &), - const std::string &docString) { +CommandVoid4* makeCommandVoid4( + E& entity, void (E::*function)(const T1&, const T2&, const T3&, const T4&), + const std::string& docString) { return new CommandVoid4( entity, boost::bind(function, &entity, _1, _2, _3, _4), docString); return NULL; } -inline std::string docCommandVoid4(const std::string &doc, - const std::string &type1, - const std::string &type2, - const std::string &type3, - const std::string &type4) { +inline std::string docCommandVoid4(const std::string& doc, + const std::string& type1, + const std::string& type2, + const std::string& type3, + const std::string& type4) { return (std::string("\n") + doc + "\n\n" + "Input:\n - A " + type1 + ".\n" + "Input:\n - A " + type2 + ".\n" + "Input:\n - A " + type3 + ".\n" + "Input:\n - A " + type4 + ".\n" + "Void return.\n\n"); @@ -350,13 +348,13 @@ namespace command { template struct CommandVoid5 : public Command { - typedef boost::function + typedef boost::function function_t; - typedef void (E::*memberFunction_ptr_t)(const T1 &, const T2 &, const T3 &, - const T4 &, const T5 &); + typedef void (E::*memberFunction_ptr_t)(const T1&, const T2&, const T3&, + const T4&, const T5&); - CommandVoid5(E &entity, function_t function, const std::string &docString) + CommandVoid5(E& entity, function_t function, const std::string& docString) : Command(entity, boost::assign::list_of(ValueHelper::TypeID)( ValueHelper::TypeID)(ValueHelper::TypeID)( @@ -382,43 +380,42 @@ struct CommandVoid5 : public Command { template -CommandVoid5 *makeCommandVoid5( - E &entity, +CommandVoid5* makeCommandVoid5( + E& entity, typename CommandVoid5::function_t function, - const std::string &docString) { + const std::string& docString) { return new CommandVoid5(entity, function, docString); } template -CommandVoid5 *makeCommandVoid5( - E &entity, - boost::function +CommandVoid5* makeCommandVoid5( + E& entity, + boost::function function, - const std::string &docString) { + const std::string& docString) { return new CommandVoid5( entity, boost::bind(function, &entity, _1, _2, _3, _4, _5), docString); } template -CommandVoid5 *makeCommandVoid5( - E &entity, - void (E::*function)(const T1 &, const T2 &, const T3 &, const T4 &, - const T5 &), - const std::string &docString) { +CommandVoid5* makeCommandVoid5( + E& entity, + void (E::*function)(const T1&, const T2&, const T3&, const T4&, const T5&), + const std::string& docString) { return new CommandVoid5( entity, boost::bind(function, &entity, _1, _2, _3, _4, _5), docString); return NULL; } -inline std::string docCommandVoid5(const std::string &doc, - const std::string &type1, - const std::string &type2, - const std::string &type3, - const std::string &type4, - const std::string &type5) { +inline std::string docCommandVoid5(const std::string& doc, + const std::string& type1, + const std::string& type2, + const std::string& type3, + const std::string& type4, + const std::string& type5) { return (std::string("\n") + doc + "\n\n" + "Input:\n - A " + type1 + ".\n" + "Input:\n - A " + type2 + ".\n" + "Input:\n - A " + type3 + ".\n" + "Input:\n - A " + type4 + ".\n" + "Input:\n - A " + type5 + ".\n" + @@ -435,13 +432,13 @@ namespace command { template struct CommandVoid6 : public Command { - typedef boost::function + typedef boost::function function_t; - typedef void (E::*memberFunction_ptr_t)(const T1 &, const T2 &, const T3 &, - const T4 &, const T5 &, const T6 &); + typedef void (E::*memberFunction_ptr_t)(const T1&, const T2&, const T3&, + const T4&, const T5&, const T6&); - CommandVoid6(E &entity, function_t function, const std::string &docString) + CommandVoid6(E& entity, function_t function, const std::string& docString) : Command(entity, boost::assign::list_of(ValueHelper::TypeID)( ValueHelper::TypeID)(ValueHelper::TypeID)( @@ -469,22 +466,22 @@ struct CommandVoid6 : public Command { template -CommandVoid6 *makeCommandVoid6( - E &entity, +CommandVoid6* makeCommandVoid6( + E& entity, typename CommandVoid6::function_t function, - const std::string &docString) { + const std::string& docString) { return new CommandVoid6(entity, function, docString); } template -CommandVoid6 *makeCommandVoid6( - E &entity, - boost::function +CommandVoid6* makeCommandVoid6( + E& entity, + boost::function function, - const std::string &docString) { + const std::string& docString) { return new CommandVoid6( entity, boost::bind(function, &entity, _1, _2, _3, _4, _5, _6), docString); @@ -492,11 +489,11 @@ CommandVoid6 *makeCommandVoid6( template -CommandVoid6 *makeCommandVoid6( - E &entity, - void (E::*function)(const T1 &, const T2 &, const T3 &, const T4 &, - const T5 &, const T6 &), - const std::string &docString) { +CommandVoid6* makeCommandVoid6( + E& entity, + void (E::*function)(const T1&, const T2&, const T3&, const T4&, const T5&, + const T6&), + const std::string& docString) { return new CommandVoid6( entity, boost::bind(function, &entity, _1, _2, _3, _4, _5, _6), docString); @@ -504,9 +501,9 @@ CommandVoid6 *makeCommandVoid6( } inline std::string docCommandVoid6( - const std::string &doc, const std::string &type1, const std::string &type2, - const std::string &type3, const std::string &type4, - const std::string &type5, const std::string &type6) { + const std::string& doc, const std::string& type1, const std::string& type2, + const std::string& type3, const std::string& type4, + const std::string& type5, const std::string& type6) { return (std::string("\n") + doc + "\n\n" + "Input:\n - A " + type1 + ".\n" + "Input:\n - A " + type2 + ".\n" + "Input:\n - A " + type3 + ".\n" + "Input:\n - A " + type4 + ".\n" + "Input:\n - A " + type5 + ".\n" + @@ -523,14 +520,14 @@ namespace command { template struct CommandVoid7 : public Command { - typedef boost::function + typedef boost::function function_t; - typedef void (E::*memberFunction_ptr_t)(const T1 &, const T2 &, const T3 &, - const T4 &, const T5 &, const T6 &, - const T7 &); + typedef void (E::*memberFunction_ptr_t)(const T1&, const T2&, const T3&, + const T4&, const T5&, const T6&, + const T7&); - CommandVoid7(E &entity, function_t function, const std::string &docString) + CommandVoid7(E& entity, function_t function, const std::string& docString) : Command(entity, boost::assign::list_of(ValueHelper::TypeID)( ValueHelper::TypeID)(ValueHelper::TypeID)( @@ -559,22 +556,22 @@ struct CommandVoid7 : public Command { template -CommandVoid7 *makeCommandVoid7( - E &entity, +CommandVoid7* makeCommandVoid7( + E& entity, typename CommandVoid7::function_t function, - const std::string &docString) { + const std::string& docString) { return new CommandVoid7(entity, function, docString); } template -CommandVoid7 *makeCommandVoid7( - E &entity, - boost::function +CommandVoid7* makeCommandVoid7( + E& entity, + boost::function function, - const std::string &docString) { + const std::string& docString) { return new CommandVoid7( entity, boost::bind(function, &entity, _1, _2, _3, _4, _5, _6, _7), docString); @@ -582,11 +579,11 @@ CommandVoid7 *makeCommandVoid7( template -CommandVoid7 *makeCommandVoid7( - E &entity, - void (E::*function)(const T1 &, const T2 &, const T3 &, const T4 &, - const T5 &, const T6 &, const T7 &), - const std::string &docString) { +CommandVoid7* makeCommandVoid7( + E& entity, + void (E::*function)(const T1&, const T2&, const T3&, const T4&, const T5&, + const T6&, const T7&), + const std::string& docString) { return new CommandVoid7( entity, boost::bind(function, &entity, _1, _2, _3, _4, _5, _6, _7), docString); @@ -594,10 +591,10 @@ CommandVoid7 *makeCommandVoid7( } inline std::string docCommandVoid7( - const std::string &doc, const std::string &type1, const std::string &type2, - const std::string &type3, const std::string &type4, - const std::string &type5, const std::string &type6, - const std::string &type7) { + const std::string& doc, const std::string& type1, const std::string& type2, + const std::string& type3, const std::string& type4, + const std::string& type5, const std::string& type6, + const std::string& type7) { return (std::string("\n") + doc + "\n\n" + "Input:\n - A " + type1 + ".\n" + "Input:\n - A " + type2 + ".\n" + "Input:\n - A " + type3 + ".\n" + "Input:\n - A " + type4 + ".\n" + "Input:\n - A " + type5 + ".\n" + @@ -615,14 +612,14 @@ namespace command { template struct CommandVoid8 : public Command { - typedef boost::function + typedef boost::function function_t; - typedef void (E::*memberFunction_ptr_t)(const T1 &, const T2 &, const T3 &, - const T4 &, const T5 &, const T6 &, - const T7 &, const T8 &); + typedef void (E::*memberFunction_ptr_t)(const T1&, const T2&, const T3&, + const T4&, const T5&, const T6&, + const T7&, const T8&); - CommandVoid8(E &entity, function_t function, const std::string &docString) + CommandVoid8(E& entity, function_t function, const std::string& docString) : Command(entity, boost::assign::list_of(ValueHelper::TypeID)( ValueHelper::TypeID)(ValueHelper::TypeID)( @@ -653,23 +650,23 @@ struct CommandVoid8 : public Command { template -CommandVoid8 *makeCommandVoid8( - E &entity, +CommandVoid8* makeCommandVoid8( + E& entity, typename CommandVoid8::function_t function, - const std::string &docString) { + const std::string& docString) { return new CommandVoid8(entity, function, docString); } template -CommandVoid8 *makeCommandVoid8( - E &entity, - boost::function +CommandVoid8* makeCommandVoid8( + E& entity, + boost::function function, - const std::string &docString) { + const std::string& docString) { return new CommandVoid8( entity, boost::bind(function, &entity, _1, _2, _3, _4, _5, _6, _7, _8), docString); @@ -677,11 +674,11 @@ CommandVoid8 *makeCommandVoid8( template -CommandVoid8 *makeCommandVoid8( - E &entity, - void (E::*function)(const T1 &, const T2 &, const T3 &, const T4 &, - const T5 &, const T6 &, const T7 &, const T8 &), - const std::string &docString) { +CommandVoid8* makeCommandVoid8( + E& entity, + void (E::*function)(const T1&, const T2&, const T3&, const T4&, const T5&, + const T6&, const T7&, const T8&), + const std::string& docString) { return new CommandVoid8( entity, boost::bind(function, &entity, _1, _2, _3, _4, _5, _6, _7, _8), docString); @@ -689,10 +686,10 @@ CommandVoid8 *makeCommandVoid8( } inline std::string docCommandVoid8( - const std::string &doc, const std::string &type1, const std::string &type2, - const std::string &type3, const std::string &type4, - const std::string &type5, const std::string &type6, - const std::string &type7, const std::string &type8) { + const std::string& doc, const std::string& type1, const std::string& type2, + const std::string& type3, const std::string& type4, + const std::string& type5, const std::string& type6, + const std::string& type7, const std::string& type8) { return (std::string("\n") + doc + "\n\n" + "Input:\n - A " + type1 + ".\n" + "Input:\n - A " + type2 + ".\n" + "Input:\n - A " + type3 + ".\n" + "Input:\n - A " + type4 + ".\n" + "Input:\n - A " + type5 + ".\n" + @@ -711,9 +708,9 @@ namespace dynamicgraph { namespace command { template struct CommandVerbose : public Command { - typedef boost::function function_t; + typedef boost::function function_t; - CommandVerbose(E &entity, function_t function, const std::string &docString) + CommandVerbose(E& entity, function_t function, const std::string& docString) : Command(entity, EMPTY_ARG, docString), fptr(function) {} protected: @@ -729,23 +726,23 @@ struct CommandVerbose : public Command { }; template -CommandVerbose *makeCommandVerbose( - E &entity, typename CommandVerbose::function_t function, - const std::string &docString) { +CommandVerbose* makeCommandVerbose( + E& entity, typename CommandVerbose::function_t function, + const std::string& docString) { return new CommandVerbose(entity, function, docString); return NULL; } template -CommandVerbose *makeCommandVerbose(E &entity, - void (E::*function)(std::ostream &), - const std::string &docString) { +CommandVerbose* makeCommandVerbose(E& entity, + void (E::*function)(std::ostream&), + const std::string& docString) { return new CommandVerbose(entity, boost::bind(function, &entity, _1), docString); return NULL; } -inline std::string docCommandVerbose(const std::string &doc) { +inline std::string docCommandVerbose(const std::string& doc) { return std::string("\n") + doc + "\n\nNo input.\n Return a string.\n\n"; } /*************************/ @@ -754,8 +751,8 @@ inline std::string docCommandVerbose(const std::string &doc) { template struct CommandReturnType0 : public Command { - CommandReturnType0(E &entity, boost::function function, - const std::string &docString) + CommandReturnType0(E& entity, boost::function function, + const std::string& docString) : Command(entity, EMPTY_ARG, docString), fptr(function) {} protected: @@ -770,30 +767,30 @@ struct CommandReturnType0 : public Command { }; template -CommandReturnType0 *makeCommandReturnType0( - E &entity, boost::function function, - const std::string &docString) { +CommandReturnType0* makeCommandReturnType0( + E& entity, boost::function function, + const std::string& docString) { return new CommandReturnType0(entity, function, docString); } template -CommandReturnType0 *makeCommandReturnType0( - E &entity, boost::function function, - const std::string &docString) { +CommandReturnType0* makeCommandReturnType0( + E& entity, boost::function function, + const std::string& docString) { return new CommandReturnType0( entity, boost::bind(function, &entity), docString); } template -CommandReturnType0 *makeCommandReturnType0( - E &entity, ReturnType (E::*function)(void), const std::string &docString) { +CommandReturnType0* makeCommandReturnType0( + E& entity, ReturnType (E::*function)(void), const std::string& docString) { return new CommandReturnType0( entity, boost::bind(function, &entity), docString); } template -inline std::string docCommandReturnType0( - const std::string &doc, const std::string & /* return_type */) { +inline std::string docCommandReturnType0(const std::string& doc, + const std::string& /* return_type */) { return std::string("\n") + doc + "\n\nNo input.\n" + typeid(ReturnType).name() + " return.\n\n"; } @@ -807,10 +804,10 @@ namespace command { template struct CommandReturnType1 : public Command { - typedef boost::function function_t; + typedef boost::function function_t; - CommandReturnType1(E &entity, function_t function, - const std::string &docString) + CommandReturnType1(E& entity, function_t function, + const std::string& docString) : Command(entity, boost::assign::list_of(ValueHelper::TypeID), docString), fptr(function) {} @@ -828,35 +825,35 @@ struct CommandReturnType1 : public Command { }; template -CommandReturnType1 *makeCommandReturnType1( - E &entity, boost::function function, - const std::string &docString) { +CommandReturnType1* makeCommandReturnType1( + E& entity, boost::function function, + const std::string& docString) { return new CommandReturnType1(entity, function, docString); } template -CommandReturnType1 *makeCommandReturnType1( - E &entity, +CommandReturnType1* makeCommandReturnType1( + E& entity, // The following syntaxt don't compile when not // specializing the template arg... why ??? - boost::function function, - const std::string &docString) { + boost::function function, + const std::string& docString) { return new CommandReturnType1( entity, boost::bind(function, &entity, _1), docString); } template -CommandReturnType1 *makeCommandReturnType1( - E &entity, ReturnType (E::*function)(const T &), - const std::string &docString) { +CommandReturnType1* makeCommandReturnType1( + E& entity, ReturnType (E::*function)(const T&), + const std::string& docString) { return new CommandReturnType1( entity, boost::bind(function, &entity, _1), docString); return NULL; } template -inline std::string docCommandReturnType1(const std::string &doc, - const std::string &type) { +inline std::string docCommandReturnType1(const std::string& doc, + const std::string& type) { return std::string("\n") + doc + "\n\nInput:\n - A " + type + ".\n" + typeid(ReturnType).name() + "return.\n\n"; } @@ -870,10 +867,10 @@ namespace command { template struct CommandReturnType2 : public Command { - typedef boost::function function_t; + typedef boost::function function_t; - CommandReturnType2(E &entity, function_t function, - const std::string &docString) + CommandReturnType2(E& entity, function_t function, + const std::string& docString) : Command(entity, boost::assign::list_of(ValueHelper::TypeID)( ValueHelper::TypeID), @@ -894,37 +891,37 @@ struct CommandReturnType2 : public Command { }; template -CommandReturnType2 *makeCommandReturnType2( - E &entity, boost::function function, - const std::string &docString) { +CommandReturnType2* makeCommandReturnType2( + E& entity, boost::function function, + const std::string& docString) { return new CommandReturnType2(entity, function, docString); } template -CommandReturnType2 *makeCommandReturnType2( - E &entity, +CommandReturnType2* makeCommandReturnType2( + E& entity, // The following syntaxt don't compile when not specializing the template // arg... why ??? - boost::function function, - const std::string &docString) { + boost::function function, + const std::string& docString) { return new CommandReturnType2( entity, boost::bind(function, &entity, _1, _2), docString); } template -CommandReturnType2 *makeCommandReturnType2( - E &entity, ReturnType (E::*function)(const T1 &, const T2 &), - const std::string &docString) { +CommandReturnType2* makeCommandReturnType2( + E& entity, ReturnType (E::*function)(const T1&, const T2&), + const std::string& docString) { return new CommandReturnType2( entity, boost::bind(function, &entity, _1, _2), docString); return NULL; } template -inline std::string docCommandReturnType2(const std::string &doc, - const std::string &type1, - const std::string &type2) { +inline std::string docCommandReturnType2(const std::string& doc, + const std::string& type1, + const std::string& type2) { return (std::string("\n") + doc + "\n\n" + "Input:\n - A " + type1 + ".\n" + "Input:\n - A " + type2 + ".\n" + "ReturnType:\n - Returns:" + typeid(ReturnType).name() + +".\n\n"); diff --git a/include/dynamic-graph/command-direct-getter.h b/include/dynamic-graph/command-direct-getter.h index e9e39b40..d84374df 100644 --- a/include/dynamic-graph/command-direct-getter.h +++ b/include/dynamic-graph/command-direct-getter.h @@ -30,24 +30,24 @@ class DirectGetter : public Command { typedef T (E::*GetterMethod)() const; /// Constructor - DirectGetter(E &entity, T *ptr, const std::string &docString) + DirectGetter(E& entity, T* ptr, const std::string& docString) : Command(entity, std::vector(), docString), T_ptr(ptr) {} protected: virtual Value doExecute() { return Value(*T_ptr); } private: - T *T_ptr; + T* T_ptr; }; template -DirectGetter *makeDirectGetter(E &entity, T *ptr, - const std::string &docString) { +DirectGetter* makeDirectGetter(E& entity, T* ptr, + const std::string& docString) { return new DirectGetter(entity, ptr, docString); } -inline std::string docDirectGetter(const std::string &name, - const std::string &type) { +inline std::string docDirectGetter(const std::string& name, + const std::string& type) { return std::string("\nGet the ") + name + ".\n\nNo input.\nReturn an " + type + ".\n\n"; } diff --git a/include/dynamic-graph/command-direct-setter.h b/include/dynamic-graph/command-direct-setter.h index a81d2eb8..dc706778 100644 --- a/include/dynamic-graph/command-direct-setter.h +++ b/include/dynamic-graph/command-direct-setter.h @@ -26,31 +26,31 @@ namespace command { template class DirectSetter : public Command { public: - DirectSetter(E &entity, T *ptr, const std::string &docString) + DirectSetter(E& entity, T* ptr, const std::string& docString) : Command(entity, boost::assign::list_of(ValueHelper::TypeID), docString), T_ptr(ptr) {} protected: virtual Value doExecute() { - const std::vector &values = getParameterValues(); + const std::vector& values = getParameterValues(); T val = values[0].value(); (*T_ptr) = val; return Value(); // void } private: - T *T_ptr; + T* T_ptr; }; template -DirectSetter *makeDirectSetter(E &entity, T *ptr, - const std::string &docString) { +DirectSetter* makeDirectSetter(E& entity, T* ptr, + const std::string& docString) { return new DirectSetter(entity, ptr, docString); } -inline std::string docDirectSetter(const std::string &name, - const std::string &type) { +inline std::string docDirectSetter(const std::string& name, + const std::string& type) { return std::string("\nSet the ") + name + ".\n\nInput:\n - a " + type + ".\nVoid return.\n\n"; } diff --git a/include/dynamic-graph/command-getter.h b/include/dynamic-graph/command-getter.h index 7414609d..d0b5cda3 100644 --- a/include/dynamic-graph/command-getter.h +++ b/include/dynamic-graph/command-getter.h @@ -47,7 +47,7 @@ class Getter : public Command { /// Pointer to method that sets parameter of type T typedef T (E::*GetterMethod)() const; /// Constructor - Getter(E &entity, GetterMethod getterMethod, const std::string &docString); + Getter(E& entity, GetterMethod getterMethod, const std::string& docString); protected: virtual Value doExecute(); diff --git a/include/dynamic-graph/command-getter.t.cpp b/include/dynamic-graph/command-getter.t.cpp index 6b4f2d93..cfa3d346 100644 --- a/include/dynamic-graph/command-getter.t.cpp +++ b/include/dynamic-graph/command-getter.t.cpp @@ -16,14 +16,14 @@ class Entity; namespace command { template -Getter::Getter(E &entity, GetterMethod getterMethod, - const std::string &docstring) +Getter::Getter(E& entity, GetterMethod getterMethod, + const std::string& docstring) : Command(entity, std::vector(), docstring), getterMethod_(getterMethod) {} template Value Getter::doExecute() { - E &entity = static_cast(owner()); + E& entity = static_cast(owner()); T value = (entity.*getterMethod_)(); return Value(value); } diff --git a/include/dynamic-graph/command-setter.h b/include/dynamic-graph/command-setter.h index 4fb1efda..f7177c73 100644 --- a/include/dynamic-graph/command-setter.h +++ b/include/dynamic-graph/command-setter.h @@ -45,9 +45,9 @@ template class Setter : public Command { public: /// Pointer to method that sets parameter of type T - typedef void (E::*SetterMethod)(const T &); + typedef void (E::*SetterMethod)(const T&); /// Constructor - Setter(E &entity, SetterMethod setterMethod, const std::string &docString); + Setter(E& entity, SetterMethod setterMethod, const std::string& docString); protected: virtual Value doExecute(); diff --git a/include/dynamic-graph/command-setter.t.cpp b/include/dynamic-graph/command-setter.t.cpp index 5d5d9991..107051fd 100644 --- a/include/dynamic-graph/command-setter.t.cpp +++ b/include/dynamic-graph/command-setter.t.cpp @@ -25,9 +25,9 @@ template class Setter : public Command { public: /// Pointer to method that sets parameter of type bool - typedef void (E::*SetterMethod)(const bool &); + typedef void (E::*SetterMethod)(const bool&); /// Constructor - Setter(E &entity, SetterMethod setterMethod, const std::string &docString); + Setter(E& entity, SetterMethod setterMethod, const std::string& docString); protected: virtual Value doExecute(); @@ -37,17 +37,17 @@ class Setter : public Command { }; // Class Setter template -Setter::Setter(E &entity, SetterMethod setterMethod, - const std::string &docString) +Setter::Setter(E& entity, SetterMethod setterMethod, + const std::string& docString) : Command(entity, boost::assign::list_of(Value::BOOL), docString), setterMethod_(setterMethod) {} template Value Setter::doExecute() { - const std::vector &values = getParameterValues(); + const std::vector& values = getParameterValues(); // Get parameter bool value = values[0].value(); - E &entity = static_cast(owner()); + E& entity = static_cast(owner()); (entity.*setterMethod_)(value); return Value(); } @@ -59,9 +59,9 @@ template class Setter : public Command { public: /// Pointer to method that sets parameter of type unsigned - typedef void (E::*SetterMethod)(const unsigned &); + typedef void (E::*SetterMethod)(const unsigned&); /// Constructor - Setter(E &entity, SetterMethod setterMethod, const std::string &docString); + Setter(E& entity, SetterMethod setterMethod, const std::string& docString); protected: virtual Value doExecute(); @@ -71,17 +71,17 @@ class Setter : public Command { }; // Class Setter template -Setter::Setter(E &entity, SetterMethod setterMethod, - const std::string &docString) +Setter::Setter(E& entity, SetterMethod setterMethod, + const std::string& docString) : Command(entity, boost::assign::list_of(Value::UNSIGNED), docString), setterMethod_(setterMethod) {} template Value Setter::doExecute() { - const std::vector &values = getParameterValues(); + const std::vector& values = getParameterValues(); // Get parameter unsigned value = values[0].value(); - E &entity = static_cast(owner()); + E& entity = static_cast(owner()); (entity.*setterMethod_)(value); return Value(); } @@ -93,9 +93,9 @@ template class Setter : public Command { public: /// Pointer to method that sets parameter of type unsigned long - typedef void (E::*SetterMethod)(const std::uint64_t &); + typedef void (E::*SetterMethod)(const std::uint64_t&); /// Constructor - Setter(E &entity, SetterMethod setterMethod, const std::string &docString); + Setter(E& entity, SetterMethod setterMethod, const std::string& docString); protected: virtual Value doExecute(); @@ -105,18 +105,18 @@ class Setter : public Command { }; // Class Setter template -Setter::Setter(E &entity, SetterMethod setterMethod, - const std::string &docString) +Setter::Setter(E& entity, SetterMethod setterMethod, + const std::string& docString) : Command(entity, boost::assign::list_of(Value::UNSIGNEDLONGINT), docString), setterMethod_(setterMethod) {} template Value Setter::doExecute() { - const std::vector &values = getParameterValues(); + const std::vector& values = getParameterValues(); // Get parameter std::uint64_t value = values[0].value(); - E &entity = static_cast(owner()); + E& entity = static_cast(owner()); (entity.*setterMethod_)(value); return Value(); } @@ -128,9 +128,9 @@ template class Setter : public Command { public: /// Pointer to method that sets parameter of type int - typedef void (E::*SetterMethod)(const int &); + typedef void (E::*SetterMethod)(const int&); /// Constructor - Setter(E &entity, SetterMethod setterMethod, const std::string &docString); + Setter(E& entity, SetterMethod setterMethod, const std::string& docString); protected: virtual Value doExecute(); @@ -140,17 +140,17 @@ class Setter : public Command { }; // Class Setter template -Setter::Setter(E &entity, SetterMethod setterMethod, - const std::string &docString) +Setter::Setter(E& entity, SetterMethod setterMethod, + const std::string& docString) : Command(entity, boost::assign::list_of(Value::INT), docString), setterMethod_(setterMethod) {} template Value Setter::doExecute() { - const std::vector &values = getParameterValues(); + const std::vector& values = getParameterValues(); // Get parameter int value = values[0].value(); - E &entity = static_cast(owner()); + E& entity = static_cast(owner()); (entity.*setterMethod_)(value); return Value(); } @@ -162,9 +162,9 @@ template class Setter : public Command { public: /// Pointer to method that sets parameter of type int64_t - typedef void (E::*SetterMethod)(const std::int64_t &); + typedef void (E::*SetterMethod)(const std::int64_t&); /// Constructor - Setter(E &entity, SetterMethod setterMethod, const std::string &docString); + Setter(E& entity, SetterMethod setterMethod, const std::string& docString); protected: virtual Value doExecute(); @@ -174,17 +174,17 @@ class Setter : public Command { }; // Class Setter template -Setter::Setter(E &entity, SetterMethod setterMethod, - const std::string &docString) +Setter::Setter(E& entity, SetterMethod setterMethod, + const std::string& docString) : Command(entity, boost::assign::list_of(Value::LONGINT), docString), setterMethod_(setterMethod) {} template Value Setter::doExecute() { - const std::vector &values = getParameterValues(); + const std::vector& values = getParameterValues(); // Get parameter std::int64_t value = values[0].value(); - E &entity = static_cast(owner()); + E& entity = static_cast(owner()); (entity.*setterMethod_)(value); return Value(); } @@ -196,9 +196,9 @@ template class Setter : public Command { public: /// Pointer to method that sets parameter of type float - typedef void (E::*SetterMethod)(const float &); + typedef void (E::*SetterMethod)(const float&); /// Constructor - Setter(E &entity, SetterMethod setterMethod, const std::string &docString); + Setter(E& entity, SetterMethod setterMethod, const std::string& docString); protected: virtual Value doExecute(); @@ -208,17 +208,17 @@ class Setter : public Command { }; // Class Setter template -Setter::Setter(E &entity, SetterMethod setterMethod, - const std::string &docString) +Setter::Setter(E& entity, SetterMethod setterMethod, + const std::string& docString) : Command(entity, boost::assign::list_of(Value::FLOAT), docString), setterMethod_(setterMethod) {} template Value Setter::doExecute() { - const std::vector &values = getParameterValues(); + const std::vector& values = getParameterValues(); // Get parameter float value = values[0].value(); - E &entity = static_cast(owner()); + E& entity = static_cast(owner()); (entity.*setterMethod_)(value); return Value(); } @@ -230,9 +230,9 @@ template class Setter : public Command { public: /// Pointer to method that sets parameter of type double - typedef void (E::*SetterMethod)(const double &); + typedef void (E::*SetterMethod)(const double&); /// Constructor - Setter(E &entity, SetterMethod setterMethod, const std::string &docString); + Setter(E& entity, SetterMethod setterMethod, const std::string& docString); protected: virtual Value doExecute(); @@ -242,17 +242,17 @@ class Setter : public Command { }; // Class Setter template -Setter::Setter(E &entity, SetterMethod setterMethod, - const std::string &docString) +Setter::Setter(E& entity, SetterMethod setterMethod, + const std::string& docString) : Command(entity, boost::assign::list_of(Value::DOUBLE), docString), setterMethod_(setterMethod) {} template Value Setter::doExecute() { - const std::vector &values = getParameterValues(); + const std::vector& values = getParameterValues(); // Get parameter double value = values[0].value(); - E &entity = static_cast(owner()); + E& entity = static_cast(owner()); (entity.*setterMethod_)(value); return Value(); } @@ -264,9 +264,9 @@ template class Setter : public Command { public: /// Pointer to method that sets parameter of type std::string - typedef void (E::*SetterMethod)(const std::string &); + typedef void (E::*SetterMethod)(const std::string&); /// Constructor - Setter(E &entity, SetterMethod setterMethod, const std::string &docString); + Setter(E& entity, SetterMethod setterMethod, const std::string& docString); protected: virtual Value doExecute(); @@ -276,17 +276,17 @@ class Setter : public Command { }; // Class Setter template -Setter::Setter(E &entity, SetterMethod setterMethod, - const std::string &docString) +Setter::Setter(E& entity, SetterMethod setterMethod, + const std::string& docString) : Command(entity, boost::assign::list_of(Value::STRING), docString), setterMethod_(setterMethod) {} template Value Setter::doExecute() { - const std::vector &values = getParameterValues(); + const std::vector& values = getParameterValues(); // Get parameter std::string value = values[0].value(); - E &entity = static_cast(owner()); + E& entity = static_cast(owner()); (entity.*setterMethod_)(value); return Value(); } @@ -298,9 +298,9 @@ template class Setter : public Command { public: /// Pointer to method that sets parameter of type Vector - typedef void (E::*SetterMethod)(const Vector &); + typedef void (E::*SetterMethod)(const Vector&); /// Constructor - Setter(E &entity, SetterMethod setterMethod, const std::string &docString); + Setter(E& entity, SetterMethod setterMethod, const std::string& docString); protected: virtual Value doExecute(); @@ -310,17 +310,17 @@ class Setter : public Command { }; // Class Setter template -Setter::Setter(E &entity, SetterMethod setterMethod, - const std::string &docString) +Setter::Setter(E& entity, SetterMethod setterMethod, + const std::string& docString) : Command(entity, boost::assign::list_of(Value::VECTOR), docString), setterMethod_(setterMethod) {} template Value Setter::doExecute() { - const std::vector &values = getParameterValues(); + const std::vector& values = getParameterValues(); // Get parameter Vector value = values[0].value(); - E &entity = static_cast(owner()); + E& entity = static_cast(owner()); (entity.*setterMethod_)(value); return Value(); } @@ -332,9 +332,9 @@ template class Setter : public Command { public: /// Pointer to method that sets parameter of type Matrix - typedef void (E::*SetterMethod)(const Matrix &); + typedef void (E::*SetterMethod)(const Matrix&); /// Constructor - Setter(E &entity, SetterMethod setterMethod, const std::string &docString); + Setter(E& entity, SetterMethod setterMethod, const std::string& docString); protected: virtual Value doExecute(); @@ -344,17 +344,17 @@ class Setter : public Command { }; // Class Setter template -Setter::Setter(E &entity, SetterMethod setterMethod, - const std::string &docString) +Setter::Setter(E& entity, SetterMethod setterMethod, + const std::string& docString) : Command(entity, boost::assign::list_of(Value::MATRIX), docString), setterMethod_(setterMethod) {} template Value Setter::doExecute() { - const std::vector &values = getParameterValues(); + const std::vector& values = getParameterValues(); // Get parameter Matrix value = values[0].value(); - E &entity = static_cast(owner()); + E& entity = static_cast(owner()); (entity.*setterMethod_)(value); return Value(); } diff --git a/include/dynamic-graph/command.h b/include/dynamic-graph/command.h index c304c6e1..1abc1bec 100644 --- a/include/dynamic-graph/command.h +++ b/include/dynamic-graph/command.h @@ -39,18 +39,18 @@ class DYNAMIC_GRAPH_DLLAPI Command { /// \param entity reference to Entity owning this command. /// \param valueTypes vector specifying the number and types of parameters /// \param docstring documentation of the command - Command(Entity &entity, const std::vector &valueTypes, - const std::string &docstring); + Command(Entity& entity, const std::vector& valueTypes, + const std::string& docstring); /// Return the value type of all parameters - const std::vector &valueTypes() const; + const std::vector& valueTypes() const; /// Set parameter values - void setParameterValues(const std::vector &values); + void setParameterValues(const std::vector& values); /// Get parameter values - const std::vector &getParameterValues() const; + const std::vector& getParameterValues() const; /// Execute the command after checking parameters Value execute(); /// Get a reference to the Entity owning this command - Entity &owner(); + Entity& owner(); /// Get documentation string std::string getDocstring() const; @@ -59,7 +59,7 @@ class DYNAMIC_GRAPH_DLLAPI Command { virtual Value doExecute() = 0; private: - Entity &owner_; + Entity& owner_; std::vector valueTypeVector_; std::vector valueVector_; std::string docstring_; diff --git a/include/dynamic-graph/debug.h b/include/dynamic-graph/debug.h index 27a2868e..2e09266c 100644 --- a/include/dynamic-graph/debug.h +++ b/include/dynamic-graph/debug.h @@ -42,19 +42,19 @@ class DYNAMIC_GRAPH_DLLAPI DebugTrace { static const int SIZE = 512; std::stringstream tmpbuffer; - std::ostream &outputbuffer; + std::ostream& outputbuffer; char charbuffer[SIZE + 1]; int traceLevel; int traceLevelTemplate; - DebugTrace(std::ostream &os) : outputbuffer(os) {} + DebugTrace(std::ostream& os) : outputbuffer(os) {} - inline void trace(const int level, const char *format, ...) { + inline void trace(const int level, const char* format, ...) { if (level <= traceLevel) DG_COMMON_TRACES; tmpbuffer.str(""); } - inline void trace(const char *format, ...) { + inline void trace(const char* format, ...) { DG_COMMON_TRACES; tmpbuffer.str(""); } @@ -66,26 +66,26 @@ class DYNAMIC_GRAPH_DLLAPI DebugTrace { } } - inline void traceTemplate(const int level, const char *format, ...) { + inline void traceTemplate(const int level, const char* format, ...) { if (level <= traceLevelTemplate) DG_COMMON_TRACES; tmpbuffer.str(""); } - inline void traceTemplate(const char *format, ...) { + inline void traceTemplate(const char* format, ...) { DG_COMMON_TRACES; tmpbuffer.str(""); } - inline DebugTrace &pre(const std::ostream &) { return *this; } + inline DebugTrace& pre(const std::ostream&) { return *this; } - inline DebugTrace &pre(const std::ostream &, int level) { + inline DebugTrace& pre(const std::ostream&, int level) { traceLevel = level; return *this; } - static const char *DEBUG_FILENAME_DEFAULT; - static void openFile(const char *filename = DEBUG_FILENAME_DEFAULT); - static void closeFile(const char *filename = DEBUG_FILENAME_DEFAULT); + static const char* DEBUG_FILENAME_DEFAULT; + static void openFile(const char* filename = DEBUG_FILENAME_DEFAULT); + static void closeFile(const char* filename = DEBUG_FILENAME_DEFAULT); }; DYNAMIC_GRAPH_DLLAPI extern DebugTrace dgDEBUGFLOW; @@ -143,9 +143,9 @@ DYNAMIC_GRAPH_DLLAPI extern DebugTrace dgERRORFLOW; .pre(dgDEBUGFLOW.tmpbuffer << dgPREDEBUG, VP_TEMPLATE_DEBUG_MODE) \ .trace -inline bool dgDEBUG_ENABLE(const int &level) { return level <= VP_DEBUG_MODE; } +inline bool dgDEBUG_ENABLE(const int& level) { return level <= VP_DEBUG_MODE; } -inline bool dgTDEBUG_ENABLE(const int &level) { +inline bool dgTDEBUG_ENABLE(const int& level) { return level <= VP_TEMPLATE_DEBUG_MODE; } @@ -166,16 +166,16 @@ inline bool dgTDEBUG_ENABLE(const int &level) { #define dgERROR dgERRORFLOW.outputbuffer << dgPREERROR -inline void dgDEBUGF(const int, const char *, ...) { return; } +inline void dgDEBUGF(const int, const char*, ...) { return; } -inline void dgDEBUGF(const char *, ...) { return; } +inline void dgDEBUGF(const char*, ...) { return; } -inline void dgERRORF(const int, const char *, ...) { return; } +inline void dgERRORF(const int, const char*, ...) { return; } -inline void dgERRORF(const char *, ...) { return; } +inline void dgERRORF(const char*, ...) { return; } namespace dynamicgraph { -inline std::ostream &__null_stream() { +inline std::ostream& __null_stream() { // This function should never be called. With -O3, // it should not appear in the generated binary. static std::ostream os(NULL); @@ -190,9 +190,9 @@ inline std::ostream &__null_stream() { else \ ::dynamicgraph::__null_stream() -inline void dgTDEBUGF(const int, const char *, ...) { return; } +inline void dgTDEBUGF(const int, const char*, ...) { return; } -inline void dgTDEBUGF(const char *, ...) { return; } +inline void dgTDEBUGF(const char*, ...) { return; } #define dgDEBUG_ENABLE(level) false #define dgTDEBUG_ENABLE(level) false diff --git a/include/dynamic-graph/eigen-io.h b/include/dynamic-graph/eigen-io.h index 493c2f6e..0c01026f 100644 --- a/include/dynamic-graph/eigen-io.h +++ b/include/dynamic-graph/eigen-io.h @@ -27,8 +27,8 @@ using dynamicgraph::ExceptionSignal; namespace Eigen { typedef EIGEN_DEFAULT_DENSE_INDEX_TYPE eigen_index; -inline std::istringstream &operator>>(std::istringstream &iss, - dynamicgraph::Vector &inst) { +inline std::istringstream& operator>>(std::istringstream& iss, + dynamicgraph::Vector& inst) { unsigned int _size; double _dbl_val; char _ch; @@ -70,8 +70,8 @@ inline std::istringstream &operator>>(std::istringstream &iss, */ template -inline std::istringstream &operator>>(std::istringstream &iss, - DenseBase &inst) { +inline std::istringstream& operator>>(std::istringstream& iss, + DenseBase& inst) { unsigned int _colsize; unsigned int _rowsize; double _dbl_val; @@ -120,8 +120,8 @@ inline std::istringstream &operator>>(std::istringstream &iss, return iss; } -inline std::istringstream &operator>>(std::istringstream &iss, - Transform &inst) { +inline std::istringstream& operator>>(std::istringstream& iss, + Transform& inst) { MatrixXd M; iss >> M; inst.matrix() = M; @@ -135,7 +135,7 @@ inline std::istringstream &operator>>(std::istringstream &iss, * e.g. [2,5]((1 23 32.2 12.12 32),(2 32 23 92.01 19.2)) */ -inline std::ostream &operator<<(std::ostream &os, +inline std::ostream& operator<<(std::ostream& os, Transform MH) { IOFormat boostFmt(StreamPrecision, DontAlignCols, ",", ",", "(", ")", "(", ")"); @@ -144,7 +144,7 @@ inline std::ostream &operator<<(std::ostream &os, return os; } -inline std::ostream &operator<<(std::ostream &os, AngleAxisd quat) { +inline std::ostream& operator<<(std::ostream& os, AngleAxisd quat) { VectorXd v(4); v(0) = quat.angle(); v.tail<3>() = quat.axis(); @@ -152,8 +152,8 @@ inline std::ostream &operator<<(std::ostream &os, AngleAxisd quat) { return os; } -inline std::istringstream &operator>>(std::istringstream &iss, - AngleAxisd &inst) { +inline std::istringstream& operator>>(std::istringstream& iss, + AngleAxisd& inst) { VectorXd v(4); iss >> v; inst.angle() = v(0); diff --git a/include/dynamic-graph/entity.h b/include/dynamic-graph/entity.h index 2f75bf9b..96141f5d 100644 --- a/include/dynamic-graph/entity.h +++ b/include/dynamic-graph/entity.h @@ -37,7 +37,7 @@ /// this macro are correctly initialized. #define DYNAMIC_GRAPH_ENTITY_DECL() \ public: \ - virtual const std::string &getClassName() const { return CLASS_NAME; } \ + virtual const std::string& getClassName() const { return CLASS_NAME; } \ static const std::string CLASS_NAME namespace dynamicgraph { @@ -51,14 +51,14 @@ namespace dynamicgraph { /// DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN macro in factory.h. class DYNAMIC_GRAPH_DLLAPI Entity : private boost::noncopyable { public: - typedef std::map *> SignalMap; - typedef std::map CommandMap_t; + typedef std::map*> SignalMap; + typedef std::map CommandMap_t; - explicit Entity(const std::string &name); + explicit Entity(const std::string& name); virtual ~Entity(); - const std::string &getName() const { return name; } - virtual const std::string &getClassName() const { + const std::string& getName() const { return name; } + virtual const std::string& getClassName() const { static std::string ret("Entity"); return ret; } @@ -70,49 +70,49 @@ class DYNAMIC_GRAPH_DLLAPI Entity : private boost::noncopyable { /** \brief Test if a signal of name signame is present. \return True if the signal is present, False otherwise */ - bool hasSignal(const std::string &signame) const; + bool hasSignal(const std::string& signame) const; /** \brief Provides a reference to the signal named signalName. \param signalName: Name of the signal \return A reference to the signal with a temporal dependency. */ - SignalBase &getSignal(const std::string &signalName); + SignalBase& getSignal(const std::string& signalName); /** \brief Provides a const reference to the signal named signalName. \param signalName: Name of the signal \return A const reference to the signal with a temporal dependency. */ - const SignalBase &getSignal(const std::string &signalName) const; + const SignalBase& getSignal(const std::string& signalName) const; /** \brief Display the list of signals of this entity in output stream os. \param os: the output stream where to display the list of signals. \returns The output stream given in parameter. */ - std::ostream &displaySignalList(std::ostream &os) const; + std::ostream& displaySignalList(std::ostream& os) const; /** \brief This method is used to write down in os the edges of the graph by calling the signals writeGraph method. \param os: The output stream where to write the informations. \return os: The output stream. */ - virtual std::ostream &writeGraph(std::ostream &os) const; + virtual std::ostream& writeGraph(std::ostream& os) const; /** \brief This method is used write in the output stream os the signals names and the commands of the entity. \param os: The output stream where to write the list of objects related to the entity. */ - virtual std::ostream &writeCompletionList(std::ostream &os) const; + virtual std::ostream& writeCompletionList(std::ostream& os) const; /** \brief Display information on the entity inside the output stream os. */ - virtual void display(std::ostream &os) const; + virtual void display(std::ostream& os) const; - virtual SignalBase *test() { return 0; } + virtual SignalBase* test() { return 0; } - virtual void test2(SignalBase *) { return; } + virtual void test2(SignalBase*) { return; } - const std::string &getCommandList() const; + const std::string& getCommandList() const; /** \brief Provides the std::map where all the commands are registered \returns A map of pointers towards Command objects @@ -121,7 +121,7 @@ class DYNAMIC_GRAPH_DLLAPI Entity : private boost::noncopyable { /** \brief Provides the pointer towards the Command object cmdName. \param cmdName: Name of the command */ - command::Command *getNewStyleCommand(const std::string &cmdName); + command::Command* getNewStyleCommand(const std::string& cmdName); /** \brief Provides a map of all the signals. \returns A copy of the map with all the pointers towards @@ -132,13 +132,13 @@ class DYNAMIC_GRAPH_DLLAPI Entity : private boost::noncopyable { /// \name Logger related methods /// \{ - Logger &logger() { return logger_; }; - Logger const &logger() const { return logger_; }; + Logger& logger() { return logger_; }; + Logger const& logger() const { return logger_; }; /// \brief Send messages \c msg with level \c t. /// Add string file and line to message. - void sendMsg(const std::string &msg, MsgType t = MSG_TYPE_INFO, - const std::string &lineId = ""); + void sendMsg(const std::string& msg, MsgType t = MSG_TYPE_INFO, + const std::string& lineId = ""); /// \brief Specify the verbosity level of the logger. void setLoggerVerbosityLevel(LoggerVerbosity lv) { logger_.setVerbosity(lv); } @@ -163,13 +163,13 @@ class DYNAMIC_GRAPH_DLLAPI Entity : private boost::noncopyable { /// \} protected: - void addCommand(const std::string &name, command::Command *command); + void addCommand(const std::string& name, command::Command* command); void entityRegistration(); void entityDeregistration(); - void signalRegistration(const SignalArray &signals); - void signalDeregistration(const std::string &name); + void signalRegistration(const SignalArray& signals); + void signalDeregistration(const std::string& name); std::string name; SignalMap signalMap; @@ -177,8 +177,8 @@ class DYNAMIC_GRAPH_DLLAPI Entity : private boost::noncopyable { Logger logger_; }; -DYNAMIC_GRAPH_DLLAPI std::ostream &operator<<(std::ostream &os, - const dynamicgraph::Entity &ent); +DYNAMIC_GRAPH_DLLAPI std::ostream& operator<<(std::ostream& os, + const dynamicgraph::Entity& ent); } // end of namespace dynamicgraph #endif //! DYNAMIC_GRAPH_ENTITY_H diff --git a/include/dynamic-graph/exception-abstract.h b/include/dynamic-graph/exception-abstract.h index cd5e9802..c871f501 100644 --- a/include/dynamic-graph/exception-abstract.h +++ b/include/dynamic-graph/exception-abstract.h @@ -14,7 +14,7 @@ // #define DYNAMIC-GRAPH_EXCEPTION_PASSING_PARAM #define DG_RETHROW \ - (const ::dynamicgraph::ExceptionAbstract &err) { throw err; } + (const ::dynamicgraph::ExceptionAbstract& err) { throw err; } #ifdef DYNAMICGRAPH_EXCEPTION_PASSING_PARAM #define DG_THROW \ @@ -37,7 +37,7 @@ class DYNAMIC_GRAPH_DLLAPI ExceptionAbstract : public std::exception { public: static const int BUFFER_SIZE = 80; - Param(const int &_line, const char *_function, const char *_file); + Param(const int& _line, const char* _function, const char* _file); Param() : functionPTR(), function(), @@ -46,12 +46,12 @@ class DYNAMIC_GRAPH_DLLAPI ExceptionAbstract : public std::exception { file(), pointersSet(false), set(false) {} - Param &initCopy(const Param &p); + Param& initCopy(const Param& p); - const char *functionPTR; + const char* functionPTR; char function[BUFFER_SIZE]; int line; - const char *filePTR; + const char* filePTR; char file[BUFFER_SIZE]; bool pointersSet; bool set; @@ -74,30 +74,30 @@ class DYNAMIC_GRAPH_DLLAPI ExceptionAbstract : public std::exception { static const std::string EXCEPTION_NAME; - explicit ExceptionAbstract(const int &code, const std::string &msg = ""); + explicit ExceptionAbstract(const int& code, const std::string& msg = ""); virtual ~ExceptionAbstract() throw() {} - virtual const std::string &getExceptionName() const { return EXCEPTION_NAME; } + virtual const std::string& getExceptionName() const { return EXCEPTION_NAME; } /// \brief Access to the error code. int getCode() const; /// \brief Reference access to the error message (can be empty). - const std::string &getStringMessage() const; + const std::string& getStringMessage() const; /// \brief Access to the pointer on the array of \e char related /// to the error string. /// /// Cannot be \e NULL. - const char *getMessage() const; + const char* getMessage() const; - virtual const char *what() const throw() { + virtual const char* what() const throw() { return getStringMessage().c_str(); } /// \brief Print the error structure. - DYNAMIC_GRAPH_DLLAPI friend std::ostream &operator<<( - std::ostream &os, const ExceptionAbstract &err); + DYNAMIC_GRAPH_DLLAPI friend std::ostream& operator<<( + std::ostream& os, const ExceptionAbstract& err); protected: /// \brief Error code. @@ -115,13 +115,13 @@ class DYNAMIC_GRAPH_DLLAPI ExceptionAbstract : public std::exception { mutable Param p; template - friend const Exc &operator+(const ExceptionAbstract::Param &p, const Exc &e) { + friend const Exc& operator+(const ExceptionAbstract::Param& p, const Exc& e) { e.p.initCopy(p); return e; } template - friend Exc &operator+(const ExceptionAbstract::Param &p, Exc &e) { + friend Exc& operator+(const ExceptionAbstract::Param& p, Exc& e) { e.p.initCopy(p); return e; } diff --git a/include/dynamic-graph/exception-factory.h b/include/dynamic-graph/exception-factory.h index ec2e9772..54b22679 100644 --- a/include/dynamic-graph/exception-factory.h +++ b/include/dynamic-graph/exception-factory.h @@ -32,15 +32,15 @@ class DYNAMIC_GRAPH_DLLAPI ExceptionFactory : public ExceptionAbstract { static const std::string EXCEPTION_NAME; - explicit ExceptionFactory(const ExceptionFactory::ErrorCodeEnum &errcode, - const std::string &msg = ""); + explicit ExceptionFactory(const ExceptionFactory::ErrorCodeEnum& errcode, + const std::string& msg = ""); - ExceptionFactory(const ExceptionFactory::ErrorCodeEnum &errcode, - const std::string &msg, const char *format, ...); + ExceptionFactory(const ExceptionFactory::ErrorCodeEnum& errcode, + const std::string& msg, const char* format, ...); virtual ~ExceptionFactory() throw() {} - virtual const std::string &getExceptionName() const { + virtual const std::string& getExceptionName() const { return ExceptionFactory::EXCEPTION_NAME; } }; diff --git a/include/dynamic-graph/exception-signal.h b/include/dynamic-graph/exception-signal.h index 876097db..85934538 100644 --- a/include/dynamic-graph/exception-signal.h +++ b/include/dynamic-graph/exception-signal.h @@ -30,13 +30,13 @@ class DYNAMIC_GRAPH_DLLAPI ExceptionSignal : public ExceptionAbstract { static const std::string EXCEPTION_NAME; - explicit ExceptionSignal(const ExceptionSignal::ErrorCodeEnum &errcode, - const std::string &msg = ""); - ExceptionSignal(const ExceptionSignal::ErrorCodeEnum &errcode, - const std::string &msg, const char *format, ...); + explicit ExceptionSignal(const ExceptionSignal::ErrorCodeEnum& errcode, + const std::string& msg = ""); + ExceptionSignal(const ExceptionSignal::ErrorCodeEnum& errcode, + const std::string& msg, const char* format, ...); virtual ~ExceptionSignal() throw() {} - virtual const std::string &getExceptionName() const { return EXCEPTION_NAME; } + virtual const std::string& getExceptionName() const { return EXCEPTION_NAME; } }; } // end of namespace dynamicgraph diff --git a/include/dynamic-graph/exception-traces.h b/include/dynamic-graph/exception-traces.h index 4f132000..e8a96044 100644 --- a/include/dynamic-graph/exception-traces.h +++ b/include/dynamic-graph/exception-traces.h @@ -21,13 +21,13 @@ class DYNAMIC_GRAPH_DLLAPI ExceptionTraces : public ExceptionAbstract { static const std::string EXCEPTION_NAME; - explicit ExceptionTraces(const ExceptionTraces::ErrorCodeEnum &errcode, - const std::string &msg = ""); - ExceptionTraces(const ExceptionTraces::ErrorCodeEnum &errcode, - const std::string &msg, const char *format, ...); + explicit ExceptionTraces(const ExceptionTraces::ErrorCodeEnum& errcode, + const std::string& msg = ""); + ExceptionTraces(const ExceptionTraces::ErrorCodeEnum& errcode, + const std::string& msg, const char* format, ...); virtual ~ExceptionTraces() throw() {} - virtual const std::string &getExceptionName() const { return EXCEPTION_NAME; } + virtual const std::string& getExceptionName() const { return EXCEPTION_NAME; } }; } // end of namespace dynamicgraph. diff --git a/include/dynamic-graph/factory.h b/include/dynamic-graph/factory.h index 88456856..34f18f46 100644 --- a/include/dynamic-graph/factory.h +++ b/include/dynamic-graph/factory.h @@ -26,8 +26,8 @@ #define DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN(CLASSTYPE, CLASSNAME) \ const std::string CLASSTYPE::CLASS_NAME = CLASSNAME; \ extern "C" { \ - ::dynamicgraph::Entity *EntityMaker_##CLASSTYPE( \ - const std::string &objname) { \ + ::dynamicgraph::Entity* EntityMaker_##CLASSTYPE( \ + const std::string& objname) { \ return new CLASSTYPE(objname); \ } \ ::dynamicgraph::EntityRegisterer reg_##CLASSTYPE(CLASSNAME, \ @@ -82,12 +82,12 @@ class DYNAMIC_GRAPH_DLLAPI FactoryStorage : private boost::noncopyable { public: /// \brief Function pointer providing an entity instance from its /// name. - typedef Entity *(*EntityConstructor_ptr)(const std::string &); + typedef Entity* (*EntityConstructor_ptr)(const std::string&); ~FactoryStorage(); /// \brief Get pointer to unique object of the class - static FactoryStorage *getInstance(); + static FactoryStorage* getInstance(); /// \brief Destroy the unique instance of the class static void destroy(); @@ -104,7 +104,7 @@ class DYNAMIC_GRAPH_DLLAPI FactoryStorage : private boost::noncopyable { /// \param entname the name used to subscribe the entity. /// \param ent pointer to a function allocating an entity from an /// instance name. - void registerEntity(const std::string &entname, EntityConstructor_ptr ent); + void registerEntity(const std::string& entname, EntityConstructor_ptr ent); /// \brief Delete an entity from the factory. /// @@ -113,7 +113,7 @@ class DYNAMIC_GRAPH_DLLAPI FactoryStorage : private boost::noncopyable { /// OBJECT_CONFLICT. /// /// \param entname the entity name (as passed to registerEntity before) - void deregisterEntity(const std::string &entname); + void deregisterEntity(const std::string& entname); /// \brief Instantiate (and allocate) an entity. /// @@ -133,22 +133,22 @@ class DYNAMIC_GRAPH_DLLAPI FactoryStorage : private boost::noncopyable { /// \param classname the name of the Entity type /// \param objname the instance name /// \return Dynamically allocated instance of classname. - Entity *newEntity(const std::string &classname, - const std::string &objname) const; + Entity* newEntity(const std::string& classname, + const std::string& objname) const; /// \brief Check if an Entity associated with a particular name /// has already been registered. /// /// \param name entity name /// \return Do the entity exist? - bool existEntity(const std::string &name) const; + bool existEntity(const std::string& name) const; /// \brief List the available entities. /// /// Available entities are appended to the method argument. /// /// \param list Available entities will be appended to list. - void listEntities(std::vector &list) const; + void listEntities(std::vector& list) const; private: /// \brief Constructor the factory. @@ -169,7 +169,7 @@ class DYNAMIC_GRAPH_DLLAPI FactoryStorage : private boost::noncopyable { EntityMap entityMap; /// \pointer to the unique object of the class - static FactoryStorage *instance_; + static FactoryStorage* instance_; }; /// \ingroup dgraph @@ -184,7 +184,7 @@ class DYNAMIC_GRAPH_DLLAPI FactoryStorage : private boost::noncopyable { class DYNAMIC_GRAPH_DLLAPI EntityRegisterer : private boost::noncopyable { public: /// \brief Register entity to the global factory. - explicit EntityRegisterer(const std::string &entityClassName, + explicit EntityRegisterer(const std::string& entityClassName, FactoryStorage::EntityConstructor_ptr maker); /// \brief Unregister entity to the global factory. diff --git a/include/dynamic-graph/logger.h b/include/dynamic-graph/logger.h index f39d7cd4..6e681b97 100644 --- a/include/dynamic-graph/logger.h +++ b/include/dynamic-graph/logger.h @@ -92,7 +92,7 @@ namespace dynamicgraph { _DYNAMIC_GRAPH_ENTITY_MSG(entity, MSG_TYPE_ERROR_STREAM) template -std::string toString(const T &v, const int precision = 3, +std::string toString(const T& v, const int precision = 3, const int width = -1) { std::stringstream ss; if (width > precision) @@ -103,7 +103,7 @@ std::string toString(const T &v, const int precision = 3, } template -std::string toString(const std::vector &v, const int precision = 3, +std::string toString(const std::vector& v, const int precision = 3, const int width = -1, const std::string separator = ", ") { std::stringstream ss; if (width > precision) { @@ -122,7 +122,7 @@ std::string toString(const std::vector &v, const int precision = 3, } template -std::string toString(const Eigen::MatrixBase &v, const int precision = 3, +std::string toString(const Eigen::MatrixBase& v, const int precision = 3, const int width = -1, const std::string separator = ", ") { std::stringstream ss; if (width > precision) { @@ -208,8 +208,8 @@ class Logger { * \param type specifies the verbosity level, for instance MSG_TYPE_DEBUG * \param lineId typically __FILE__ ":" BOOST_PP_STRINGIZE(__LINE__) */ - RTLoggerStream stream(MsgType type, const std::string &lineId = "") { - RealTimeLogger &rtlogger = ::dynamicgraph::RealTimeLogger::instance(); + RTLoggerStream stream(MsgType type, const std::string& lineId = "") { + RealTimeLogger& rtlogger = ::dynamicgraph::RealTimeLogger::instance(); if (acceptMsg(type, lineId)) return rtlogger.front(); return rtlogger.emptyStream(); } @@ -220,7 +220,7 @@ class Logger { * \endcode */ [[deprecated("use stream(type, lineId) << msg")]] void sendMsg( - std::string msg, MsgType type, const std::string &lineId = ""); + std::string msg, MsgType type, const std::string& lineId = ""); /** \deprecated instead, use * \code @@ -228,7 +228,7 @@ class Logger { * \endcode */ [[deprecated("use stream(type, lineId) << msg")]] void sendMsg( - std::string msg, MsgType type, const std::string &file, int line); + std::string msg, MsgType type, const std::string& file, int line); /** Set the sampling time at which the method countdown() * is going to be called. */ @@ -269,7 +269,7 @@ class Logger { * accepted. \note If \p m is a stream type, the internal counter associated * to \p lineId is updated. */ - bool acceptMsg(MsgType m, const std::string &lineId) { + bool acceptMsg(MsgType m, const std::string& lineId) { // If more verbose than the current verbosity level if ((m & MSG_TYPE_TYPE_BITS) > m_lv) return false; @@ -281,7 +281,7 @@ class Logger { /** Check whether a message from \c lineId should be accepted. * \note The internal counter associated to \c lineId is updated. */ - bool checkStreamPeriod(const std::string &lineId); + bool checkStreamPeriod(const std::string& lineId); }; } // namespace dynamicgraph diff --git a/include/dynamic-graph/pool.h b/include/dynamic-graph/pool.h index d7c647f0..3d03e50d 100644 --- a/include/dynamic-graph/pool.h +++ b/include/dynamic-graph/pool.h @@ -36,10 +36,10 @@ class DYNAMIC_GRAPH_DLLAPI PoolStorage { @{ */ /*! \brief Sorted set of entities with unique key (name). */ - typedef std::map Entities; + typedef std::map Entities; /// \brief Get unique instance of the class. - static PoolStorage *getInstance(); + static PoolStorage* getInstance(); /// \brief Destroy the unique instance of the class static void destroy(); @@ -56,47 +56,47 @@ class DYNAMIC_GRAPH_DLLAPI PoolStorage { \par[in] entname: The name of the entity, \par[in] ent: Pointer towards the entity. */ - void registerEntity(const std::string &entname, Entity *ent); + void registerEntity(const std::string& entname, Entity* ent); /*! \brief Unregister an entity. \par[in] entname: The name of the entity, */ - void deregisterEntity(const std::string &entname); + void deregisterEntity(const std::string& entname); /*! \brief Unregister an entity. \par[in] entity: iterator in the map, */ - void deregisterEntity(const Entities::iterator &entity); + void deregisterEntity(const Entities::iterator& entity); /*! \brief Get an entity. \par[in] entname: The name of the entity, \return Pointer towards the entity. */ - Entity &getEntity(const std::string &name); + Entity& getEntity(const std::string& name); /// Const access to entity map - const Entities &getEntityMap() const; + const Entities& getEntityMap() const; /*! \brief Test if the entity exists. */ - bool existEntity(const std::string &name); + bool existEntity(const std::string& name); /*! \brief Test if the entity exists. If it does, return a pointer on it. */ - bool existEntity(const std::string &name, Entity *&ptr); + bool existEntity(const std::string& name, Entity*& ptr); /*! \brief Disallocate an entity. \par[in] entname: The name of the entity, */ - void clearPlugin(const std::string &name); + void clearPlugin(const std::string& name); /*! @} */ /// /// \brief Get a signal by name /// /// \param sigpath stream containing a string of the form "entity.signal" - SignalBase &getSignal(std::istringstream &sigpath); + SignalBase& getSignal(std::istringstream& sigpath); /*! \brief This method write a graph description on the file named FileName. */ - void writeGraph(const std::string &aFileName); - void writeCompletionList(std::ostream &os); + void writeGraph(const std::string& aFileName); + void writeCompletionList(std::ostream& os); protected: /*! \name Fields of the class to manage the three entities. @@ -108,10 +108,10 @@ class DYNAMIC_GRAPH_DLLAPI PoolStorage { private: PoolStorage() {} - static PoolStorage *instance_; + static PoolStorage* instance_; }; -inline PoolStorage &g_pool() { return *PoolStorage::getInstance(); } +inline PoolStorage& g_pool() { return *PoolStorage::getInstance(); } } // end of namespace dynamicgraph. diff --git a/include/dynamic-graph/process-list.hh b/include/dynamic-graph/process-list.hh index 15ed2a19..8e3ed16f 100644 --- a/include/dynamic-graph/process-list.hh +++ b/include/dynamic-graph/process-list.hh @@ -29,8 +29,8 @@ class DYNAMIC_GRAPH_DLLAPI CPUData { CPUData(); int cpu_id_; - inline unsigned long long int computePeriod(unsigned long long int &a, - unsigned long long int &b) { + inline unsigned long long int computePeriod(unsigned long long int& a, + unsigned long long int& b) { return (a > b) ? a - b : 0; } @@ -99,12 +99,12 @@ class DYNAMIC_GRAPH_DLLAPI CPUData { /// @} double percent_; - void ProcessLine(std::istringstream &aCPULine); + void ProcessLine(std::istringstream& aCPULine); friend class boost::serialization::access; template - void serialize(Archive &ar, const unsigned int version) { + void serialize(Archive& ar, const unsigned int version) { ar & version; ar & total_time_; ar & user_mode_time_; @@ -144,7 +144,7 @@ class DYNAMIC_GRAPH_DLLAPI System { /// Number of CPU. unsigned int cpuNb_; - void ProcessCPULine(unsigned int cpunb, std::istringstream &aCPULine); + void ProcessCPULine(unsigned int cpunb, std::istringstream& aCPULine); /// \brief Vector of CPU informations. std::vector vCPUData_; @@ -153,7 +153,7 @@ class DYNAMIC_GRAPH_DLLAPI System { CPUData gCPUData_; template - void serialize(Archive &ar, const unsigned int version) { + void serialize(Archive& ar, const unsigned int version) { ar & version; ar & cpuNb_; ar & gCPUData_; diff --git a/include/dynamic-graph/real-time-logger-def.h b/include/dynamic-graph/real-time-logger-def.h index eaa4cd01..3e31ff23 100644 --- a/include/dynamic-graph/real-time-logger-def.h +++ b/include/dynamic-graph/real-time-logger-def.h @@ -20,7 +20,7 @@ namespace dynamicgraph { /// \sa LoggerIOStream class LoggerStream { public: - virtual void write(const char *c) = 0; + virtual void write(const char* c) = 0; }; /// Write to an ostream object. @@ -29,12 +29,12 @@ class LoggerStream { /// `ostr` can be `std::cout` or an std::ofstream... class LoggerIOStream : public LoggerStream { public: - LoggerIOStream(std::ostream &os) : os_(os) {} + LoggerIOStream(std::ostream& os) : os_(os) {} virtual ~LoggerIOStream() {} - virtual void write(const char *c) { os_ << c; } + virtual void write(const char* c) { os_ << c; } private: - std::ostream &os_; + std::ostream& os_; }; typedef boost::shared_ptr LoggerStreamPtr_t; @@ -47,14 +47,14 @@ class RealTimeLogger; /// This class is only used by RealTimeLogger. class RTLoggerStream { public: - inline RTLoggerStream(RealTimeLogger *logger, std::ostream &os) + inline RTLoggerStream(RealTimeLogger* logger, std::ostream& os) : ok_(logger != NULL), logger_(logger), os_(os) {} template - inline RTLoggerStream &operator<<(T t) { + inline RTLoggerStream& operator<<(T t) { if (ok_) os_ << t; return *this; } - inline RTLoggerStream &operator<<(std::ostream &(*pf)(std::ostream &)) { + inline RTLoggerStream& operator<<(std::ostream& (*pf)(std::ostream&)) { if (ok_) os_ << pf; return *this; } @@ -65,8 +65,8 @@ class RTLoggerStream { private: const bool ok_; - RealTimeLogger *logger_; - std::ostream &os_; + RealTimeLogger* logger_; + std::ostream& os_; }; /// \endcond DEVEL @@ -95,17 +95,17 @@ class RTLoggerStream { /// operation. If the resource is busy, the log entry is discarded. class DYNAMIC_GRAPH_DLLAPI RealTimeLogger { public: - static RealTimeLogger &instance(); + static RealTimeLogger& instance(); static void destroy(); /// \todo add an argument to preallocate the internal string /// to a given size. - RealTimeLogger(const std::size_t &bufferSize); + RealTimeLogger(const std::size_t& bufferSize); inline void clearOutputStreams() { outputs_.clear(); } - inline void addOutputStream(const LoggerStreamPtr_t &os) { + inline void addOutputStream(const LoggerStreamPtr_t& os) { outputs_.push_back(os); } @@ -149,7 +149,7 @@ class DYNAMIC_GRAPH_DLLAPI RealTimeLogger { }; std::vector outputs_; - std::vector buffer_; + std::vector buffer_; /// Index of the next value to be read. std::size_t frontIdx_; /// Index of the slot where to write next value @@ -163,8 +163,8 @@ class DYNAMIC_GRAPH_DLLAPI RealTimeLogger { struct thread; - static RealTimeLogger *instance_; - static thread *thread_; + static RealTimeLogger* instance_; + static thread* thread_; }; RTLoggerStream::~RTLoggerStream() { diff --git a/include/dynamic-graph/signal-array.h b/include/dynamic-graph/signal-array.h index 15db4b75..36c46482 100644 --- a/include/dynamic-graph/signal-array.h +++ b/include/dynamic-graph/signal-array.h @@ -22,26 +22,26 @@ class SignalArray_const { static const int DEFAULT_SIZE = 20; protected: - std::vector *> const_array; + std::vector*> const_array; unsigned int size, rank; public: - SignalArray_const