- ism_dtc_impl_custom.h/cpp: Wrap all DDS-dependent method declarations and implementations with BUILD_RTI guards - dds_handler.cpp (InfrastructureManagement): Guard RTI DDS initialization code - dds_handler.h/cpp (AudioVideoManagement): Guard DomainParticipant types and methods - Enables building without RTI Connext DDS dependencies (BUILD_RTI=OFF) - Stub types used when guards are disabled Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
69 lines
1.7 KiB
C++
Executable File
69 lines
1.7 KiB
C++
Executable File
/**
|
|
* @RDE_HEADER@
|
|
* DDS Handler for ISM
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
* Created by Iuliana Ojog, SLSE, 2016-11-26
|
|
*/
|
|
|
|
#include "dds_handler.h"
|
|
|
|
#if BUILD_RTI
|
|
#include <DDS/Core/pacemaker.h>
|
|
#endif
|
|
|
|
namespace InfrastructureManagement
|
|
{
|
|
|
|
DdsHandler::DdsHandler(int domainId)
|
|
: m_ddsConnector(std::make_shared<DDSConnector::DdsConnector>(domainId, IDL::PartitionType::Any))
|
|
{
|
|
DEBUG_LOG(m_logger) << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition();
|
|
}
|
|
|
|
bool DdsHandler::init(const QStringList &qosFileList)
|
|
{
|
|
if (!m_ddsConnector->init(qosFileList))
|
|
{
|
|
ERROR_LOG(m_logger) << "Error initializing dds connections - aborting";
|
|
return false;
|
|
}
|
|
|
|
#if BUILD_RTI
|
|
// default initialize Publisher and Subscriber
|
|
m_ddsConnector->initPublisherSubscriber();
|
|
|
|
// Pacemaker
|
|
m_pacemaker = std::make_shared<Core::Pacemaker>(m_ddsConnector);
|
|
m_topicLockMaster = std::make_shared<Core::TopicLockMaster>(m_ddsConnector);
|
|
|
|
m_ddsDts = InfrastructureManagement::Interface::Dts::create(m_ddsConnector);
|
|
m_ddsFts = InfrastructureManagement::Interface::Fts::create(m_ddsConnector);
|
|
|
|
|
|
bool bRet = true;
|
|
try
|
|
{
|
|
bRet = m_ddsFts->enableAll();
|
|
INFO_LOG(m_logger) << "Fts initialised";
|
|
// erst FTS funktioniert komischer Weise nicht (seit MainStructureElementModifyRequest
|
|
// von MainStructureElement abgeleitet ist ... rti/dds - Bug?
|
|
bRet &= m_ddsDts->enableAll();
|
|
INFO_LOG(m_logger) << "Dts initialised";
|
|
}
|
|
catch (const dds::core::Exception &e)
|
|
{
|
|
ERROR_LOG(m_logger) << "Exception: " << e.what();
|
|
m_pacemaker->setNewState(Core::RunningState::StoppedError);
|
|
return false;
|
|
}
|
|
|
|
return bRet;
|
|
#else
|
|
return true;
|
|
#endif
|
|
}
|
|
|
|
} // Namespace PDM
|