41 lines
938 B
C++
Executable File
41 lines
938 B
C++
Executable File
/**
|
|
* DdsHandler for DDS
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
* Created by Christian Ehrlicher, SLSE, 2016-04-14
|
|
*/
|
|
|
|
#include "dds_handler.h"
|
|
|
|
#include <Core/pacemaker.h>
|
|
|
|
namespace ApHlaJson
|
|
{
|
|
|
|
DdsHandler::DdsHandler(int domainId, int exerciseId)
|
|
: m_ddsConnector(new DDSConnector::DdsConnector(domainId, IDL::PartitionType::Exercise, exerciseId))
|
|
, m_logger(getLogger("DdsHandler"))
|
|
{
|
|
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;
|
|
}
|
|
|
|
// default initialize Publisher and Subscriber
|
|
m_ddsConnector->initPublisherSubscriber();
|
|
|
|
// Pacemaker
|
|
m_pacemaker = std::make_shared<Core::Pacemaker>(m_ddsConnector);
|
|
|
|
return true;
|
|
}
|
|
|
|
} // namespace PatSimJson
|