- Migrated all 104 CMakeLists.txt files in Lts/Services - Replaced Qt5::Core, Qt5::Gui, Qt5::Widgets, Qt5::Network, Qt5::Svg, Qt5::Concurrent, Qt5::WebSockets, Qt5::Sql, Qt5::Xml, Qt5::Test, Qt5::SerialPort with Qt6:: equivalents - 1244 files modified (CMakeLists.txt and source files) - Zero Qt5:: references remaining in Lts/Services - QTextCodec, QDesktopWidget: No blocking issues found - QRegExp: 7 occurrences remain (deprecated but functional) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
59 lines
1.6 KiB
C++
Executable File
59 lines
1.6 KiB
C++
Executable File
/**
|
|
* @RDE_HEADER@
|
|
* Routing Test - handle a session (connection to and from sv for a specific partition)
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
*/
|
|
|
|
|
|
#include "session.h"
|
|
|
|
namespace RoutingService
|
|
{
|
|
Session::Session(const QString &partitionNameSv, const QString &partitionNameWs)
|
|
: m_partitionNameSv(partitionNameSv.toStdString())
|
|
, m_partitionNameWs(partitionNameWs.toStdString())
|
|
, m_logger(getLogger("Session"))
|
|
{}
|
|
|
|
Session::~Session()
|
|
{
|
|
shutdown();
|
|
}
|
|
|
|
bool Session::init(const dds::domain::DomainParticipant &dpIn,
|
|
const dds::domain::DomainParticipant &dpOut,
|
|
const std::vector<TopicDispatcherInterface *> &topicsToRouteToWs,
|
|
const std::vector<TopicDispatcherInterface *> &topicsToRouteToSv)
|
|
{
|
|
DEBUG_LOG(m_logger) << "Creating new session for " << m_partitionNameSv << "-" << m_partitionNameWs;
|
|
|
|
m_connectionSvToWs.reset(new Connection(dpIn, m_partitionNameSv, topicsToRouteToWs, "route to WS"));
|
|
m_connectionWsToSv.reset(new Connection(dpOut, m_partitionNameWs, topicsToRouteToSv, "route from WS"));
|
|
|
|
m_connectionSvToWs->setOutput(m_connectionWsToSv.get());
|
|
m_connectionWsToSv->setOutput(m_connectionSvToWs.get());
|
|
|
|
return m_connectionSvToWs->initialize() && m_connectionWsToSv->initialize();
|
|
}
|
|
|
|
|
|
void Session::shutdown()
|
|
{
|
|
DEBUG_LOG(m_logger) << "Shutting down session for " << m_partitionNameSv << "-" << m_partitionNameWs;
|
|
if (m_connectionSvToWs)
|
|
{
|
|
m_connectionSvToWs->shutdown();
|
|
m_connectionSvToWs = nullptr;
|
|
}
|
|
if (m_connectionWsToSv)
|
|
{
|
|
m_connectionWsToSv->shutdown();
|
|
m_connectionWsToSv = nullptr;
|
|
}
|
|
}
|
|
|
|
|
|
} // namespace RoutingService
|