Overriding configure does not work for the initial configuration

89 Views Asked by At

I need to override configure() on my waveform and I tried to do it as suggested in the manual, by overriding PropertySet_impl::configure in my .[h,cpp] but calling the PropertySet_impl::configure in my override. It works when I configure my component using a python script, but it does NOT appear to be called for the initial configure by DomainManager using .prf.xml in the domain profile.

Do you send in this initial configure some other way and is there a way I can override for these too?

2

There are 2 best solutions below

1
On BEST ANSWER

Try using the setPropertyConfigureImpl for properties that need custom configure logic instead of overriding configure. I believe this is invoked on the initial call to set properties.

0
On

Starting with REDHAWK 2.0, components support a new method initializeProperties() that is called once when the component is created, prior to the call to initialize(). Any properties of kind "property" are given their initial values via this call, using overridden values if provided. Legacy "configure" kind properties are still initialized via a configure() call following initialize().

If setting configure functions for your properties is sufficient, I'd encourage that approach. If you expect them to be called at initialization time, you'll want to set them in the C++ constructor, though, not the REDHAWK constructor() method.

Based on your question, property listeners are probably not suitable; property change notification is not triggered by initializeProperties(), only configure(). Note that the C++ interface is addPropertyListener(); registerPropertyListener() is a CORBA method that supports external notification of property changes.