[Rock-dev] Property change function

Sylvain Joyeux sylvain.joyeux at dfki.de
Fri Apr 12 11:14:00 CEST 2013


On 04/12/2013 11:00 AM, Matthias Goldhoorn wrote:
> I rember there was a discussion about dynamic and static properties.
>
> How's the current state of this?.
> I currently need a way to check if an property was changed.
> It's annoying to cache them in the task every time. Since this is need
> often is there an way to integrate this to orogen/rtt?
Personally did not have time. Now, it is a pretty simple change (well 
within your grasp ;-)

On the orogen side, the idea was to add a #dynamic flag to the property 
declaration. When that flag is set, we add a setter operation which (by 
default) simply writes the property. Since operations are virtual 
methods, it can be overriden by the user to be notified when the 
property changes. The setter operation name would be generated from the 
property name, e.g.

   property('timeout', 'double').
     dynamic

would create an operation called setTimeout(double). Additionally, the 
operation should return a boolean, so that the component can reject the 
property change.

On the runtime side, the Orocos::Property class would initially check if 
such a property exists. If it does, it uses it in #write. Otherwise, it 
uses the normal method. We would also need a new exception type (e.g. 
PropertyChangeRejected) that is raised when the setter returns false.

-- 
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