From bd108ed0b9322cd2e0a311a6411418136526e94d Mon Sep 17 00:00:00 2001 From: Mansard <nmansard@laas.fr> Date: Thu, 20 Jan 2011 15:09:41 +0100 Subject: [PATCH] Added an alias for EMPTY_ARG for readibility. --- include/dynamic-graph/command-bind.h | 6 +----- include/dynamic-graph/command.h | 2 ++ src/command/command.cpp | 3 +++ 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/include/dynamic-graph/command-bind.h b/include/dynamic-graph/command-bind.h index ed8350e..751c217 100644 --- a/include/dynamic-graph/command-bind.h +++ b/include/dynamic-graph/command-bind.h @@ -38,15 +38,13 @@ namespace dynamicgraph { namespace command { -#define COMMAND_EMPTY_ARG std::vector<Value::Type>() - template <class E > struct CommandVoid0 : public Command { CommandVoid0(E& entity, boost::function<void(void)> function, const std::string& docString) - :Command(entity, COMMAND_EMPTY_ARG, docString) + :Command(entity, EMPTY_ARG, docString) ,fptr(function) {} @@ -97,8 +95,6 @@ namespace dynamicgraph { namespace dynamicgraph { namespace command { -#define COMMAND_EMPTY_ARG std::vector<Value::Type>() - template <class E,typename T > struct CommandVoid1 : public Command diff --git a/include/dynamic-graph/command.h b/include/dynamic-graph/command.h index cbfd7a9..ac60205 100644 --- a/include/dynamic-graph/command.h +++ b/include/dynamic-graph/command.h @@ -70,6 +70,8 @@ namespace dynamicgraph { std::vector<Value::Type> valueTypeVector_; std::vector<Value> valueVector_; std::string docstring_; + public: + static const std::vector<Value::Type> EMPTY_ARG; }; } // namespace command } // namespace dynamicgraph diff --git a/src/command/command.cpp b/src/command/command.cpp index 2c71ef0..95fe2bb 100644 --- a/src/command/command.cpp +++ b/src/command/command.cpp @@ -22,6 +22,9 @@ namespace dynamicgraph { namespace command { + const std::vector<Value::Type> Command::EMPTY_ARG = std::vector<Value::Type>(); + + Command::~Command() {} Command::Command(Entity& entity, const std::vector<Value::Type>& valueTypes, -- GitLab