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?
答案 0 :(得分:1)
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.
答案 1 :(得分:1)
从REDHAWK 2.0开始,组件支持一个新方法initializeProperties(),在调用initialize()之前,在创建组件时调用一次。任何属性"属性"通过此调用给出其初始值,如果提供则使用重写值。遗产"配置"在initialize()之后,仍然通过configure()调用初始化kind属性。
如果为您的属性设置配置功能就足够了,我鼓励这种方法。如果您希望在初始化时调用它们,那么您将要在C ++构造函数中设置它们,而不是REDHAWK构造函数()方法。
根据您的问题,房产听众可能不合适;属性更改通知不是由initializeProperties()触发的,只是configure()。请注意,C ++接口是addPropertyListener(); registerPropertyListener()是一种CORBA方法,支持属性更改的外部通知。