[idd] transport: add multi-instance lifecycle manager

This commit is contained in:
Geoffrey McRae
2026-08-12 16:19:22 +10:00
parent 6b8b361101
commit 1ebf80fbe8
9 changed files with 452 additions and 11 deletions

View File

@@ -20,11 +20,21 @@
#include "transport/TransportFactory.h"
#include "transport/CTransportManager.h"
#include "transport/lgmp/CLGMPTransport.h"
#include <new>
std::unique_ptr<ITransport> CreateTransport()
static std::unique_ptr<ITransport> CreateLGMP()
{
return std::unique_ptr<ITransport>(new (std::nothrow) CLGMPTransport());
}
std::unique_ptr<ITransport> CreateTransport()
{
std::unique_ptr<CTransportManager> manager(
new (std::nothrow) CTransportManager());
if (!manager || !manager->Add(1, "LGMP", true, true, CreateLGMP))
return std::unique_ptr<ITransport>();
return std::unique_ptr<ITransport>(manager.release());
}