Converts accessor calls to plain member access across the residual service set.
80 lines
2.3 KiB
C++
Executable File
80 lines
2.3 KiB
C++
Executable File
/**
|
|
* DdsHandler for DDS
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
* Created by gr, SLSE, 2015-09-02
|
|
*/
|
|
|
|
#include "dds_handler.h"
|
|
|
|
#include <DDS/DTS/generic_dts_impl.h>
|
|
#include <DDS/Core/pacemaker.h>
|
|
|
|
namespace SoundManagement
|
|
{
|
|
|
|
DdsHandler::DdsHandler(int domainId, int exerciseId)
|
|
: m_ddsConnector(std::make_shared<DDSConnector::DdsConnector>(domainId, IDL::PartitionType::Exercise, exerciseId))
|
|
, m_logger(getLogger("DdsHandler"))
|
|
{
|
|
DEBUG_LOG(m_logger) << "DdsHandler(" << m_ddsConnector->getDomainId() << ") 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;
|
|
}
|
|
|
|
// default initialize Publisher and Subscriber
|
|
m_ddsConnector->initPublisherSubscriber();
|
|
|
|
// has to be false, because Snapshot Data Topics can be very large and fragmentation is not supported for batched writers!
|
|
m_ddsConnector->enableBatchedWriter(false);
|
|
|
|
// Pacemaker
|
|
m_pacemaker = std::make_shared<Core::Pacemaker>(m_ddsConnector);
|
|
|
|
m_topicLockMaster = std::make_shared<Core::TopicLockMaster>(m_ddsConnector);
|
|
|
|
m_dtcCore = Core::Interface::Dtc::create(m_ddsConnector);
|
|
m_dtcCore->enablePartitionTime();
|
|
|
|
m_dtsSom = SoundManagement::Interface::Dts::create(m_ddsConnector);
|
|
bool bRet = m_dtsSom->enableAll();
|
|
INFO_LOG(m_logger) << "Dts initialised";
|
|
|
|
m_ftsSom = SoundManagement::Interface::Fts::create(m_ddsConnector);
|
|
bRet &= m_ftsSom->enableAll();
|
|
INFO_LOG(m_logger) << "Fts initialised";
|
|
|
|
m_dtcSom = SoundManagement::Interface::Dtc::create(m_ddsConnector);
|
|
if (!m_dtcSom->enableAll())
|
|
{
|
|
ERROR_LOG(m_logger) << "Could not initialize SOM data topics";
|
|
return false;
|
|
}
|
|
|
|
m_dtcIsm = InfrastructureManagement::Interface::Dtc::create((m_ddsConnector));
|
|
if (!m_dtcIsm->enableMainStructureElement() ||
|
|
!m_dtcIsm->enableMountingPointAsset() ||
|
|
!m_dtcIsm->enableInstrumentationAsset())
|
|
{
|
|
ERROR_LOG(m_logger) << "Could not initialize ISM data topics";
|
|
return false;
|
|
}
|
|
|
|
return bRet;
|
|
} // end of init
|
|
//-----------------------------------------------------------------------------
|
|
|
|
qint64 DdsHandler::currentPartitionTime() const
|
|
{
|
|
return m_dtcCore->partitionTime().timeStamp;
|
|
}
|
|
|
|
} // Namespace SoundManagement
|