[Rock-dev] Property change function
Matthias Goldhoorn
matthias.goldhoorn at dfki.de
Mon Apr 15 14:48:03 CEST 2013
On 12.04.2013 11:14, Sylvain Joyeux wrote:
> 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.
>
Here are the Patches for orogen and ocoros.rb to review//merge
Greetings,
Matthias
--
Dipl.-Inf. Matthias Goldhoorn
Space and Underwater Robotic
Universität Bremen
FB 3 - Mathematik und Informatik
AG Robotik
Robert-Hooke-Straße 5
28359 Bremen, Germany
Tel.: +49 421 178 45-4193
Zentrale: +49 421 178 45-6550
Fax: +49 421 178 45-4150
E-Mail: matthias.goldhoorn at uni-bremen.de
Weitere Informationen: http://www.informatik.uni-bremen.de/robotik
-------------- nächster Teil --------------
Ein Dateianhang mit Bin?rdaten wurde abgetrennt...
Dateiname : 0001-Added-support-of-Dynamic-Propertys-to-Orogen.patch
Dateityp : text/x-patch
Dateigr??e : 0 bytes
Beschreibung: nicht verf?gbar
URL : http://www.dfki.de/pipermail/rock-dev/attachments/20130415/e77b321a/attachment.bin
More information about the Rock-dev
mailing list