Converts accessor calls to plain member access across the residual service set.
70 lines
2.0 KiB
C++
Executable File
70 lines
2.0 KiB
C++
Executable File
/**
|
|
* DdsHandler for DDS
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
* Created by Hanna E. Rathje, SLSE, 2015-09-02
|
|
*/
|
|
|
|
#include "dds_handler.h"
|
|
|
|
#include <DDS/Core/pacemaker.h>
|
|
|
|
namespace NotificationManagement
|
|
{
|
|
|
|
DdsHandler::DdsHandler(int domainId)
|
|
: m_ddsConnector(std::make_shared<DDSConnector::DdsConnector>(domainId, IDL::PartitionType::AllExercises))
|
|
, m_logger(getLogger("DdsHandler"))
|
|
{
|
|
DEBUG_LOG(m_logger) << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition();
|
|
} // end of ctor()DdsHandler
|
|
//-----------------------------------------------------------------------------
|
|
|
|
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();
|
|
|
|
// Pacemaker
|
|
m_pacemaker = std::make_shared<Core::Pacemaker>(m_ddsConnector);
|
|
|
|
// DTC Core (to get partitionTime)
|
|
m_dtcCore = Core::Interface::Dtc::create(m_ddsConnector);
|
|
m_dtcCore->enablePartitionTime();
|
|
|
|
// DTS
|
|
m_ddsDts = NotificationManagement::Interface::Dts::create(m_ddsConnector);
|
|
bool bRet = m_ddsDts->enableAll();
|
|
INFO_LOG(m_logger) << "Dts initialised";
|
|
|
|
// FTS
|
|
m_ddsFts = NotificationManagement::Interface::Fts::create(m_ddsConnector);
|
|
bRet &= m_ddsFts->enableAll();
|
|
INFO_LOG(m_logger) << "Fts initialised";
|
|
|
|
// DtcExm
|
|
m_dtcExm = ExerciseManagement::Interface::Dtc::create(m_ddsConnector);
|
|
bRet &= m_dtcExm->enableExercise();
|
|
INFO_LOG(m_logger) << "DtcExm initialised";
|
|
|
|
// DtcOpm
|
|
m_dtcOpm = OperatorManagement::Interface::Dtc::create(m_ddsConnector);
|
|
bRet &= m_dtcOpm->enableUser();
|
|
INFO_LOG(m_logger) << "DtcOpm initialised";
|
|
|
|
return bRet;
|
|
} // end of init()
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
qint64 DdsHandler::currentPartitionTime() const { return m_dtcCore->partitionTime().timeStamp; }
|
|
|
|
} // Namespace NotificationManagement
|