(doc): improve IService doxygen about output management
Description
Generating outputs in a service can induce some issues (about object lifetime) if it is not properly managed. The documentation about setOuput
method is light and these issues are not mentioned.
Proposal
Improve setOutput
doxygen: add a warning about the management of the object life
If the service generates a new object, it must manage its life time (the AppConfig nor the OSR will keep a reference on this object). When the service is stopped, it must inform the AppConfig that the object is no longer maintained. It is done with a setOutput("<key>", nullptr)
in the stopping
method.
It can be useful to add a SLM_WARN
in IService::stopping to inform that outputs are still present in the service and will be deleted if it is not maintained by someone else.