(AppManager): fix auto-start services
What does this MR do?
Fixes AppManager
to start automatically services when all associated objects are available.
How to test it?
In this example, myService
is never started
::fwData::Image::sptr myData = ::fwData::Image::New();
appmMng->addObject(myData, s_IMAGE_ID);
// this method :
// - starts all the services with autoStart=true and with all the required objects
// - allows to start a service when adding an object later
appmMng->startServices();
// add a service in autoStart mode with a required fwData::Image in input:
const bool autoStart = true, autoUpdate = true;
auto myService = appmMng->addService("::myBundle::SService", "srvName", autoStart, autoUpdate);
myService ->registerInput(cameraTimeshift, "camera");
[UPDATE]
You can test this feature with the unit-test managerWithObjectTest
in fwServiceTest
:
> bin/fwservicestest fwServices::ut::AppManagerTest::managerWithObjectTest
Data
No data required
Associated issue
Closes #302 (closed)