Skip to content

Resolve "refactor(core): separate public/private API of IService"

Description

We reduced the size of the public API of the IService interface, which is undoubtedly the most used in Sight.

First, the data management responsibility has been moved to the IHasData interface and now holds the getters and setters for inputs, in/outs and outputs. Secondly, a significant part of the implementation of IService methods has been moved to a pimpl in service::detail::Service and service::detail::ServiceConnection.

The AppConfigManager was moved in the detail namespace as well, so now the public API only exposes IAppConfigManager.

This refactor also finishes the migration of data::ptr. Now the objects of services are only held in data::ptr, the former input, inout and output maps of IService were removed, which simplifies a lot the code. This also implies that services can no longer specify any data in the XML configuration that is not declared as data::ptr. In this repository, only two services relied on the old behaviour SConfigController and SConfigLauncher. The migration consisted in using a single declared group of objects (data::ptr_vector<data::Object>) instead of multiple undeclared objects. Changes were brought in all XML configurations.

Last, the ObjectService registry refactor was also finished. Its role has been reduced because we no longer rely on it to store the relationship between services and objects. This responsibility is filled by the services themselves. So now, this registry only holds a global list of registered services. It has been renamed accordingly. Doing so, the sight::service::registry namespace was removed, and the only other class that was there, sight::service::registry::Proxy was moved to sight::core::com::Proxy. Indeed, it has actually no dependency at all on services and is generic enough to be in the core::com namespace.

Closes #995 (closed)

How to test it?

  • CI tests should be sufficient

Some results

(Some interesting results, screenshots, perfs, ...)

Edited by Flavien BRIDAULT

Merge request reports