[Fawkes Git] branch/jrothe/plugin_generator: 4 revs updated. (0.5.0-3098-gd99cf4d)

Tim Niemueller niemueller at kbsg.rwth-aachen.de
Tue Sep 6 20:28:12 CEST 2016


Changes have been pushed for the project "Fawkes Robotics Software Framework".

Gitweb: http://git.fawkesrobotics.org/fawkes.git
Trac:   http://trac.fawkesrobotics.org

The branch, jrothe/plugin_generator has been updated
        to  d99cf4d0ce53d1e5e43cb6d51d89c3b51dff5943 (commit)
       via  cce9990493f14f2737702c92b8f954c6ccdda85b (commit)
       via  11bab182b4b1f827a5d81593fc294a1d3db88187 (commit)
       via  cccd37c6fe2e6551b5672569b15f4dd2bfb06d01 (commit)
      from  b5a08f86909c04a9e064ec401434c56a630f9ff6 (commit)

http://git.fawkesrobotics.org/fawkes.git/jrothe/plugin_generator

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- *Log* ---------------------------------------------------------------
commit cccd37c6fe2e6551b5672569b15f4dd2bfb06d01
Author:     Tim Niemueller <niemueller at kbsg.rwth-aachen.de>
AuthorDate: Tue Sep 6 18:35:08 2016 +0200
Commit:     Tim Niemueller <niemueller at kbsg.rwth-aachen.de>
CommitDate: Tue Sep 6 18:35:08 2016 +0200

    plugin_generator: add missing _ to deflector

http://git.fawkesrobotics.org/fawkes.git/commit/cccd37c
http://trac.fawkesrobotics.org/changeset/cccd37c

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
commit 11bab182b4b1f827a5d81593fc294a1d3db88187
Author:     Tim Niemueller <niemueller at kbsg.rwth-aachen.de>
AuthorDate: Tue Sep 6 18:35:24 2016 +0200
Commit:     Tim Niemueller <niemueller at kbsg.rwth-aachen.de>
CommitDate: Tue Sep 6 18:35:24 2016 +0200

    plugin_generator: add superfluous newline
    
    ctime() already includes a newline in the generated time string.

http://git.fawkesrobotics.org/fawkes.git/commit/11bab18
http://trac.fawkesrobotics.org/changeset/11bab18

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
commit cce9990493f14f2737702c92b8f954c6ccdda85b
Author:     Tim Niemueller <niemueller at kbsg.rwth-aachen.de>
AuthorDate: Tue Sep 6 20:27:37 2016 +0200
Commit:     Tim Niemueller <niemueller at kbsg.rwth-aachen.de>
CommitDate: Tue Sep 6 20:27:37 2016 +0200

    plugin_generator: fix documentation and indentation

http://git.fawkesrobotics.org/fawkes.git/commit/cce9990
http://trac.fawkesrobotics.org/changeset/cce9990

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
commit d99cf4d0ce53d1e5e43cb6d51d89c3b51dff5943
Author:     Tim Niemueller <niemueller at kbsg.rwth-aachen.de>
AuthorDate: Tue Sep 6 20:27:48 2016 +0200
Commit:     Tim Niemueller <niemueller at kbsg.rwth-aachen.de>
CommitDate: Tue Sep 6 20:27:48 2016 +0200

    plugin_generator: fix docs and indentation in generated code

http://git.fawkesrobotics.org/fawkes.git/commit/d99cf4d
http://trac.fawkesrobotics.org/changeset/d99cf4d

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -


- *Summary* -----------------------------------------------------------
 src/tools/plugin_generator/plugin_generator.cpp |   59 +++++++++++++----------
 src/tools/plugin_generator/plugin_generator.h   |    2 +-
 2 files changed, 35 insertions(+), 26 deletions(-)


- *Diffs* -------------------------------------------------------------

- *commit* cccd37c6fe2e6551b5672569b15f4dd2bfb06d01 - - - - - - - - - -
Author:  Tim Niemueller <niemueller at kbsg.rwth-aachen.de>
Date:    Tue Sep 6 18:35:08 2016 +0200
Subject: plugin_generator: add missing _ to deflector

 src/tools/plugin_generator/plugin_generator.cpp |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

_Diff for modified files_:
diff --git a/src/tools/plugin_generator/plugin_generator.cpp b/src/tools/plugin_generator/plugin_generator.cpp
index 2fb3b9d..9d068a0 100644
--- a/src/tools/plugin_generator/plugin_generator.cpp
+++ b/src/tools/plugin_generator/plugin_generator.cpp
@@ -74,7 +74,7 @@ PluginGenerator::PluginGenerator(std::string directory,
   _class_name_thread = format_class_name(_plugin_name_underscore, "Thread");
   _class_name_plugin = format_class_name(_plugin_name_underscore, "Plugin");
 
-  _deflector = "__PLUGINS_" + fawkes::StringConversions::to_upper(_plugin_name_underscore) + "THREAD_H_";
+  _deflector = "__PLUGINS_" + fawkes::StringConversions::to_upper(_plugin_name_underscore) + "_THREAD_H_";
 }
 
 

- *commit* 11bab182b4b1f827a5d81593fc294a1d3db88187 - - - - - - - - - -
Author:  Tim Niemueller <niemueller at kbsg.rwth-aachen.de>
Date:    Tue Sep 6 18:35:24 2016 +0200
Subject: plugin_generator: add superfluous newline

 src/tools/plugin_generator/plugin_generator.cpp |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

_Diff for modified files_:
diff --git a/src/tools/plugin_generator/plugin_generator.cpp b/src/tools/plugin_generator/plugin_generator.cpp
index 9d068a0..1aafa0e 100644
--- a/src/tools/plugin_generator/plugin_generator.cpp
+++ b/src/tools/plugin_generator/plugin_generator.cpp
@@ -94,9 +94,8 @@ PluginGenerator::write_header(FILE *f, std::string filename)
 	  "\n/***************************************************************************\n"
 	  " *  %s - %s\n"
 	  " *\n"
-	  "%s%s%s"
+	  "%s%s"
 	  " *  Copyright  %s  %s\n"
-	  " *\n"
 	  " ****************************************************************************/\n\n"
 	  "/*  This program is free software; you can redistribute it and/or modify\n"
 	  " *  it under the terms of the GNU General Public License as published by\n"
@@ -113,7 +112,6 @@ PluginGenerator::write_header(FILE *f, std::string filename)
 	  filename.c_str(), _plugin_name.c_str(),
 	  (_creation_date.length() > 0 ) ? " *  Created: " : "",
 	  (_creation_date.length() > 0 ) ? _creation_date.c_str() : "",
-	  (_creation_date.length() > 0 ) ? "\n" : "",
 	  _year.c_str(),  _author.c_str()
 	  );
 }

- *commit* cce9990493f14f2737702c92b8f954c6ccdda85b - - - - - - - - - -
Author:  Tim Niemueller <niemueller at kbsg.rwth-aachen.de>
Date:    Tue Sep 6 20:27:37 2016 +0200
Subject: plugin_generator: fix documentation and indentation

 src/tools/plugin_generator/plugin_generator.cpp |   41 ++++++++++++++---------
 src/tools/plugin_generator/plugin_generator.h   |    2 +-
 2 files changed, 26 insertions(+), 17 deletions(-)

_Diff for modified files_:
diff --git a/src/tools/plugin_generator/plugin_generator.cpp b/src/tools/plugin_generator/plugin_generator.cpp
index 1aafa0e..5e68f27 100644
--- a/src/tools/plugin_generator/plugin_generator.cpp
+++ b/src/tools/plugin_generator/plugin_generator.cpp
@@ -35,9 +35,8 @@
 using namespace std;
 
 
-/** @class CppInterfaceGenerator <interfaces/generator/cpp_generator.h>
- * Generator that transforms input from the InterfaceParser into valid
- * C++ classes.
+/** @class PluginGenerator "plugin_generator.h
+ * Generate basic plugins from minimal input.
  */
 
 /** Constructor.
@@ -49,10 +48,10 @@ using namespace std;
  * @param description Plugin description
  */
 PluginGenerator::PluginGenerator(std::string directory,
-					     std::string author,
-					     std::string year, std::string creation_date,
-					     std::string plugin_name, std::string description
-					     )
+                                 std::string author,
+                                 std::string year, std::string creation_date,
+                                 std::string plugin_name, std::string description
+                                 )
 {
   _dir    = directory;
   if ( _dir.find_last_of("/") != (_dir.length() - 1) ) {
@@ -116,8 +115,12 @@ PluginGenerator::write_header(FILE *f, std::string filename)
 	  );
 }
 
+/** Write makefile header.
+ * @param f file to write to
+ */
 void
-PluginGenerator::write_makefile_header(FILE *f, std::string filename){
+PluginGenerator::write_makefile_header(FILE *f)
+{
   fprintf(f,
           "#*****************************************************************************\n"
           "#         Makefile Build System for Fawkes: %s Plugin\n"
@@ -226,6 +229,9 @@ PluginGenerator::write_thread_h(FILE *f)
   fprintf(f, "\n};\n\n\n#endif");
 }
 
+/** Write plugin cpp file.
+ * @param f file to write to
+ */
 void
 PluginGenerator::write_plugin_cpp(FILE *f)
 {
@@ -263,10 +269,13 @@ PluginGenerator::write_plugin_cpp(FILE *f)
           _description.c_str(), _class_name_plugin.c_str());
 }
 
+/** Write Makefile.
+ * @param f file to write to
+ */
 void
 PluginGenerator::write_makefile (FILE* f)
 {
-  write_makefile_header(f, _filename_makefile);
+  write_makefile_header(f);
   std::string filename_plugin_o = _plugin_name + "_plugin.o";
   std::string filename_thread_o = _plugin_name + "_thread.o";
   fprintf(f,
@@ -285,10 +294,10 @@ PluginGenerator::write_makefile (FILE* f)
          _plugin_name.c_str(), _plugin_name.c_str());
 }
 
-/*
- * Replace dash with undescore
- *
+/** Replace dash with underscore.
  * Example: plugin-generator to plugin_generator
+ * @param source input string
+ * @return modified string
  */
 std::string
 PluginGenerator::replace_dash_w_undescore(std::string source)
@@ -301,11 +310,11 @@ PluginGenerator::replace_dash_w_undescore(std::string source)
   return source;
 }
 
-/*
- * Format a lowercase plugin name to CamelCase plugin name and append
- * a string to specify the name
- *
+/** Format a lowercase plugin name to CamelCase class.
  * Example: plugin_name to PluginNameThread
+ * @param plugin_name name of plugin
+ * @param appendix class name appendix, e.g., Thread or Plugin
+ * @return class name matching the plugin name
  */
 std::string
 PluginGenerator::format_class_name(std::string plugin_name, std::string appendix)
diff --git a/src/tools/plugin_generator/plugin_generator.h b/src/tools/plugin_generator/plugin_generator.h
index 5469a41..1b26da7 100644
--- a/src/tools/plugin_generator/plugin_generator.h
+++ b/src/tools/plugin_generator/plugin_generator.h
@@ -42,7 +42,7 @@ class PluginGenerator
   void write_thread_cpp(FILE *f);
   void write_plugin_cpp(FILE *f);
   void write_makefile(FILE *f);
-  void write_makefile_header(FILE *f, std::string filename);
+  void write_makefile_header(FILE *f);
   void write_header(FILE *f, std::string filename);
   void write_deflector(FILE *f);
   std::string format_class_name(std::string plugin_name, std::string append);

- *commit* d99cf4d0ce53d1e5e43cb6d51d89c3b51dff5943 - - - - - - - - - -
Author:  Tim Niemueller <niemueller at kbsg.rwth-aachen.de>
Date:    Tue Sep 6 20:27:48 2016 +0200
Subject: plugin_generator: fix docs and indentation in generated code

 src/tools/plugin_generator/plugin_generator.cpp |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

_Diff for modified files_:
diff --git a/src/tools/plugin_generator/plugin_generator.cpp b/src/tools/plugin_generator/plugin_generator.cpp
index 5e68f27..c9e3d83 100644
--- a/src/tools/plugin_generator/plugin_generator.cpp
+++ b/src/tools/plugin_generator/plugin_generator.cpp
@@ -171,9 +171,11 @@ PluginGenerator::write_thread_cpp(FILE *f)
 	  _author.c_str());
   //Constructor
   fprintf(f,
+          "/** Constructor. */\n"
           "%s::%s()\n"
           " : Thread(\"%s\", Thread::OPMODE_WAITFORWAKEUP),\n"
-          "             BlockedTimingAspect(BlockedTimingAspect::WAKEUP_HOOK_SKILL) \n{\n}\n\n", //TODO support the other OPMODES
+          "   BlockedTimingAspect(BlockedTimingAspect::WAKEUP_HOOK_ACT) \n{\n}\n\n",
+          //TODO support the other OPMODES
           _class_name_thread.c_str(), _class_name_thread.c_str(),
           _class_name_thread.c_str());
   //init
@@ -202,9 +204,9 @@ PluginGenerator::write_thread_h(FILE *f)
           "#include <aspect/logging.h>\n"
           "#include <aspect/blackboard.h>\n"
           "#include <aspect/configurable.h>\n\n"
-          "#include <string>\n\n"
 
-	  "namespace fawkes {\n"
+          "namespace fawkes {\n"
+          "  // add forward declarations here, e.g., interfaces\n"
           "}\n\n"
 	  "class %s \n"
           ": public fawkes::Thread,\n"
@@ -242,7 +244,7 @@ PluginGenerator::write_plugin_cpp(FILE *f)
           "using namespace fawkes;\n\n",
           _filename_thread_h.c_str());
   fprintf(f,
-          "/* @class %s \"%s\"\n"
+          "/** @class %s \"%s\"\n"
           " * %s\n"
           " * @author %s\n"
           " */\n",
@@ -252,7 +254,7 @@ PluginGenerator::write_plugin_cpp(FILE *f)
           "class %s : public fawkes::Plugin\n"
           "{\n"
           " public:\n"
-          "  /* Constructor\n"
+          "  /** Constructor.\n"
           "   * @param config Fakwes configuration\n"
           "   */\n"
           "  %s(Configuration *config)\n"




-- 
Fawkes Robotics Framework                 http://www.fawkesrobotics.org


More information about the fawkes-commits mailing list