Skip to content

Resolve "(core): simplify getAutoConnections() implementation"

Description

A new constructor was added to KeyConnectionsMap allowing to shorten the implementation of IService::GetAutoConnections(). For instance :

    IService::KeyConnectionsMap SSample::getAutoConnections() const override
    {
        return {
           {"data1", data::Object::s_MODIFIED_SIG, s_UPDATE_SLOT},
           {"data2", data::Object::s_MODIFIED_SIG, s_UPDATE_SLOT}
        };
    }

instead of :

    IService::KeyConnectionsMap SSample::getAutoConnections() const override
    {
        KeyConnectionsMap connections;
        connections.push("data1", data::Object::s_MODIFIED_SIG, s_UPDATE_SLOT);
        connections.push("data2", data::Object::s_MODIFIED_SIG, s_UPDATE_SLOT);

        return connections;
    }

The previous declaration is still possible. Few implementations were changed as example.

Closes #840 (closed)

How to test it?

  • Pipeline results
  • Test apps with affected services.
Edited by Flavien BRIDAULT

Merge request reports