2026-03-13 15:15:49 -04:00
|
|
|
#include "logos_transport_factory.h"
|
|
|
|
|
#include "logos_transport.h"
|
|
|
|
|
#include "logos_mode.h"
|
|
|
|
|
#include "implementations/qt_local/local_transport.h"
|
|
|
|
|
#include "implementations/qt_remote/remote_transport.h"
|
2026-03-17 15:17:45 -04:00
|
|
|
#include "implementations/mock/mock_transport.h"
|
2026-03-13 15:15:49 -04:00
|
|
|
|
|
|
|
|
namespace LogosTransportFactory {
|
|
|
|
|
|
|
|
|
|
std::unique_ptr<LogosTransportHost> createHost(const QString& registryUrl)
|
|
|
|
|
{
|
|
|
|
|
if (LogosModeConfig::isLocal()) {
|
|
|
|
|
return std::make_unique<LocalTransportHost>();
|
|
|
|
|
}
|
2026-03-17 15:17:45 -04:00
|
|
|
if (LogosModeConfig::isMock()) {
|
|
|
|
|
return std::make_unique<MockTransportHost>();
|
|
|
|
|
}
|
2026-03-13 15:15:49 -04:00
|
|
|
return std::make_unique<RemoteTransportHost>(registryUrl);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::unique_ptr<LogosTransportConnection> createConnection(const QString& registryUrl)
|
|
|
|
|
{
|
|
|
|
|
if (LogosModeConfig::isLocal()) {
|
|
|
|
|
return std::make_unique<LocalTransportConnection>();
|
|
|
|
|
}
|
2026-03-17 15:17:45 -04:00
|
|
|
if (LogosModeConfig::isMock()) {
|
|
|
|
|
return std::make_unique<MockTransportConnection>();
|
|
|
|
|
}
|
2026-03-13 15:15:49 -04:00
|
|
|
return std::make_unique<RemoteTransportConnection>(registryUrl);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|