Jump to content

The moment the callback function of property is called


photo

Recommended Posts

when Callback type is the CALLBACK_PARAMETER_CHANGED, Is callbackbase2 only possible?

if callbackbase1 is possible, When is the callback function actually called? (property have multiple parameters and When I change multiple parameters)

 

ex) in some class update()

property->getParameterPtr("my_param1")->setValue(1);   //callback function is called?

property->getParameterPtr("my_param2")->setValue(2);

property->getParameterPtr("my_param3")->setValue(3);

...

Will the callback function run in another space after this code block is finished?

Link to comment

Hi dongju.jeong,

Is callbackbase2 only possible?
Yes, it is. The first argument is a PropertyPtr, the second is a "parameter id".

Will the callback function run in another space after this code block is finished?
Callback will run in the main thread right after setValue(1) line.

Best regards,
Alexander

  • Like 1
Link to comment

then.. what do I do when I try to call a one callback function by considering all the parameter changes that property has at once?

Link to comment

For example, you can call your own callback function in your code (don't use Property::addCallback() in this case):

property->getParameterPtr("my_param1")->setValue(1);
property->getParameterPtr("my_param2")->setValue(2);
property->getParameterPtr("my_param3")->setValue(3);
on_parameter_changed(property); // something like this

 

Link to comment
×
×
  • Create New...