Files
logos-cpp-sdk/cpp/logos_registry_factory.cpp
Iuri MatiasandLogos Workspace 4197ee1830 Finish Abstraction & Refactor (Ongoing) - part 1 (#25)
* refactor: abstract connection/transport; and clearly separate qt remote obj and qt local into separate implementations

* abstract qt remote registry

* add mock implementation; these serves to further test the abstraction but also useful for testing modules later

* use LogosObject instead of QObject

* abstract provider side

* updates to use new api

* re-add async api back

---------

Co-authored-by: Logos Workspace <logos@workspace.local>
2026-03-23 11:45:25 -04:00

36 lines
931 B
C++

#include "logos_registry_factory.h"
#include "logos_registry.h"
#include "logos_mode.h"
#include "implementations/qt_remote/qt_remote_registry.h"
#include "implementations/mock/mock_registry.h"
namespace {
/**
* @brief No-op registry used in Local (in-process) mode.
*
* In Local mode all modules live in the same process and discover each
* other through PluginRegistry, so no IPC rendezvous point is required.
*/
class NullRegistry : public LogosRegistry {
public:
bool isInitialized() const override { return true; }
};
} // anonymous namespace
namespace LogosRegistryFactory {
std::unique_ptr<LogosRegistry> create(const QString& url)
{
if (LogosModeConfig::isLocal()) {
return std::make_unique<NullRegistry>();
}
if (LogosModeConfig::isMock()) {
return std::make_unique<MockRegistry>();
}
return std::make_unique<QtRemoteRegistry>(url);
}
} // namespace LogosRegistryFactory