[Rock-dev] Fix for orogen bug #272 (Dynamic Attribute generation)

Sylvain Joyeux sylvain.joyeux at dfki.de
Mon Sep 2 11:03:13 CEST 2013


Few comments ....

  - typos in the Ruby comments and generated comments (in particular,
first letter in words that are upper case)
    I don't get
         //Updates the classical value of this Attribute

  - don't use send() unless strictly necessary. Please refactor

    def create_dynamic_updater(name, f)
       if bla.send(f)
         if superclass.send(f)
         end
       end
    end

    # Later on ... used with
    create_dynamic_updater("bla", "has_?")

into

    def create_dynamic_updater(name, call_superclass)
      ...
      if call_superclass
      end
      ...
    end
 
    # Later on ... used with
    if has_?
       create_dynamic_updater("bla", superclass.has_?)
    end

  - don't use tabs in generated code. Especially since the standard is
8-spaces per tab, the generated code in your case will be misaligned (I
believe)
  - please replace (in case there is a superclass method)
    if (!blabla::update())
       return false;
    return true;

 by
    return blabla::update();

 It is closer to the style used in the rest of orogen

-- 
Sylvain Joyeux (Dr.Ing.)
Senior Researcher

Space & Security Robotics
Underwater Robotics

!!! Achtung, neue Telefonnummer!!!

Standort Bremen:
DFKI GmbH
Robotics Innovation Center
Robert-Hooke-Straße 5
28359 Bremen, Germany

Phone: +49 (0)421 178-454136
Fax:   +49 (0)421 218-454150
E-Mail: robotik at dfki.de

Weitere Informationen: http://www.dfki.de/robotik
-----------------------------------------------------------------------
Deutsches Forschungszentrum fuer Kuenstliche Intelligenz GmbH
Firmensitz: Trippstadter Straße 122, D-67663 Kaiserslautern
Geschaeftsfuehrung: Prof. Dr. Dr. h.c. mult. Wolfgang Wahlster
(Vorsitzender) Dr. Walter Olthoff
Vorsitzender des Aufsichtsrats: Prof. Dr. h.c. Hans A. Aukes
Amtsgericht Kaiserslautern, HRB 2313
Sitz der Gesellschaft: Kaiserslautern (HRB 2313)
USt-Id.Nr.:    DE 148646973
Steuernummer:  19/673/0060/3
----------------------------------------------------------------------- 



More information about the Rock-dev mailing list