Apply clang-format to Lts/Common and DTC/enum headers
- Formatted all CodeGen module files (9 files) - Formatted LtsAppDescriptor module files - Formatted LtsAppManager/AppChooser files - Applied clang-format to all DTC and enum headers across modules - Removed coordTransTests from CommonUnitTestsPlaceholder (moved to tests/) Cosmetic changes only, no functional modifications. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
848 files changed
+89305
-100020
No files matched your search
Executable → Regular
+146
-157
@@ -2,33 +2,36 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <DDS/Generic/generic_base.h>
|
||||
#include <Lts/Common/ProjectConfig/project_defines.h>
|
||||
#include <QUrl>
|
||||
#include <QtCore/QStringList>
|
||||
#include <dds/pub/CoherentSet.hpp>
|
||||
#include <dds/pub/Publisher.hpp>
|
||||
#include <dds/sub/Subscriber.hpp>
|
||||
|
||||
#include <QtCore/QStringList>
|
||||
#include <Lts/Common/ProjectConfig/project_defines.h>
|
||||
#include <ddsconnector_export.h>
|
||||
#include <DDS/Generic/generic_base.h>
|
||||
#include <QUrl>
|
||||
|
||||
class QObject;
|
||||
|
||||
namespace DDS
|
||||
{
|
||||
namespace QosProfile
|
||||
{
|
||||
enum class ConnectionType;
|
||||
}
|
||||
}
|
||||
} // namespace DDS
|
||||
|
||||
namespace NGL
|
||||
{
|
||||
class INGLLogger;
|
||||
}
|
||||
|
||||
namespace DDSGeneric
|
||||
{
|
||||
class WaitSetHandler;
|
||||
class SubscriberListener;
|
||||
}
|
||||
} // namespace DDSGeneric
|
||||
|
||||
namespace DDSConnector
|
||||
{
|
||||
class Publisher;
|
||||
@@ -36,181 +39,167 @@ class Subscriber;
|
||||
|
||||
class DDSCONNECTOR_EXPORT DdsConnector
|
||||
{
|
||||
DdsConnector(int domainId,
|
||||
const dds::domain::DomainParticipant &domainParticipant,
|
||||
IDL::PartitionType defaultPartitionType,
|
||||
int partitionId,
|
||||
int exerciseId,
|
||||
DDS::QosProfile::ConnectionType connectionType,
|
||||
const QUrl &tcpConnectionUrl);
|
||||
public:
|
||||
DdsConnector(const DdsConnector &) = delete;
|
||||
DdsConnector &operator=(const DdsConnector &) = delete;
|
||||
DdsConnector(int domainId, const dds::domain::DomainParticipant& domainParticipant,
|
||||
IDL::PartitionType defaultPartitionType, int partitionId, int exerciseId,
|
||||
DDS::QosProfile::ConnectionType connectionType, const QUrl& tcpConnectionUrl);
|
||||
|
||||
|
||||
public:
|
||||
DdsConnector(const DdsConnector&) = delete;
|
||||
DdsConnector& operator=(const DdsConnector&) = delete;
|
||||
|
||||
DdsConnector(int domainId,
|
||||
IDL::PartitionType defaultPartitionType,
|
||||
int partitionId = 0,
|
||||
int exerciseId = 0,
|
||||
const QUrl &tcpConnectionUrl = QUrl());
|
||||
|
||||
DdsConnector(int domainId, IDL::PartitionType defaultPartitionType, int partitionId = 0, int exerciseId = 0,
|
||||
const QUrl& tcpConnectionUrl = QUrl());
|
||||
|
||||
DdsConnector(const dds::domain::DomainParticipant &domainParticipant,
|
||||
IDL::PartitionType defaultPartitionType,
|
||||
int partitionId = 0,
|
||||
int exerciseId = 0,
|
||||
const QUrl &tcpConnectionUrl = QUrl());
|
||||
DdsConnector(const dds::domain::DomainParticipant& domainParticipant, IDL::PartitionType defaultPartitionType,
|
||||
int partitionId = 0, int exerciseId = 0, const QUrl& tcpConnectionUrl = QUrl());
|
||||
|
||||
DdsConnector(const dds::domain::DomainParticipant &domainParticipant,
|
||||
IDL::PartitionType defaultPartitionType,
|
||||
DDS::QosProfile::ConnectionType connectionType,
|
||||
int partitionId = 0,
|
||||
int exerciseId = 0);
|
||||
DdsConnector(const dds::domain::DomainParticipant& domainParticipant, IDL::PartitionType defaultPartitionType,
|
||||
DDS::QosProfile::ConnectionType connectionType, int partitionId = 0, int exerciseId = 0);
|
||||
|
||||
DdsConnector(int domainId,
|
||||
IDL::PartitionType defaultPartitionType,
|
||||
int partitionId,
|
||||
int exerciseId,
|
||||
DDS::QosProfile::ConnectionType connectionType);
|
||||
DdsConnector(int domainId, IDL::PartitionType defaultPartitionType, int partitionId, int exerciseId,
|
||||
DDS::QosProfile::ConnectionType connectionType);
|
||||
|
||||
virtual ~DdsConnector();
|
||||
virtual ~DdsConnector();
|
||||
|
||||
|
||||
virtual bool init(const QStringList& qosFileList = QStringList());
|
||||
|
||||
virtual bool init(const QStringList &qosFileList = QStringList());
|
||||
dds::domain::DomainParticipant getDomainParticipant() const
|
||||
{
|
||||
return m_domainParticipant;
|
||||
}
|
||||
|
||||
dds::domain::DomainParticipant getDomainParticipant() const { return m_domainParticipant; }
|
||||
void setDomainParticipant(const dds::domain::DomainParticipant &participant);
|
||||
void setDomainParticipant(const dds::domain::DomainParticipant& participant);
|
||||
|
||||
Publisher *getPublisher() { return m_publisher; }
|
||||
dds::pub::Publisher getDdsPublisher() const;
|
||||
void setPublisher(Publisher *publisher);
|
||||
void enableBatchedWriter(bool bEnable);
|
||||
Publisher* getPublisher()
|
||||
{
|
||||
return m_publisher;
|
||||
}
|
||||
|
||||
Subscriber *getSubscriber() { return m_subscriber; }
|
||||
dds::sub::Subscriber getDdsSubscriber() const;
|
||||
void setSubscriber(Subscriber *subscriber);
|
||||
DDSGeneric::SubscriberListener *getSubscriberListener();
|
||||
dds::pub::Publisher getDdsPublisher() const;
|
||||
void setPublisher(Publisher* publisher);
|
||||
void enableBatchedWriter(bool bEnable);
|
||||
|
||||
const DDSGeneric::WaitSetHandler *getWaitSetHandler() const { return m_wsHandler; }
|
||||
Subscriber* getSubscriber()
|
||||
{
|
||||
return m_subscriber;
|
||||
}
|
||||
|
||||
int getDomainId() const { return m_domainId; }
|
||||
IDL::PartitionType getPartitionType() const { return m_defaultPartitionType; }
|
||||
int getPartitionId() const { return m_partitionId; }
|
||||
int getExerciseId() const { return m_exerciseId; }
|
||||
std::string getDefaultPartition() const;
|
||||
QUrl getTcpConnectionUrl() const;
|
||||
static std::string getPartitionString(IDL::PartitionType pt, int partitionId = -1);
|
||||
dds::sub::Subscriber getDdsSubscriber() const;
|
||||
void setSubscriber(Subscriber* subscriber);
|
||||
DDSGeneric::SubscriberListener* getSubscriberListener();
|
||||
|
||||
|
||||
const DDSGeneric::WaitSetHandler* getWaitSetHandler() const
|
||||
{
|
||||
return m_wsHandler;
|
||||
}
|
||||
|
||||
void initPublisherSubscriber();
|
||||
void initPublisher();
|
||||
void initSubscriber();
|
||||
void initDomainParticipant();
|
||||
int getDomainId() const
|
||||
{
|
||||
return m_domainId;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
T *createDTS(const std::string &topicName = DDS::Helper::getShortTopicName(DDS::topic_type_name<typename T::TopicType>::value()))
|
||||
{
|
||||
if (getDomainParticipant() == nullptr ||
|
||||
getDdsPublisher() == nullptr)
|
||||
return nullptr;
|
||||
T *dts = new T(getDomainParticipant(),
|
||||
getDdsPublisher(),
|
||||
topicName);
|
||||
return dts;
|
||||
}
|
||||
IDL::PartitionType getPartitionType() const
|
||||
{
|
||||
return m_defaultPartitionType;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
T *createDTC(const std::string &topicName = DDS::Helper::getShortTopicName(DDS::topic_type_name<typename T::TopicType>::value()))
|
||||
{
|
||||
if (getDomainParticipant() == nullptr ||
|
||||
getDdsSubscriber() == nullptr)
|
||||
return nullptr;
|
||||
T *dtc = new T(getDomainParticipant(),
|
||||
getDdsSubscriber(),
|
||||
getSubscriberListener(),
|
||||
topicName);
|
||||
return dtc;
|
||||
}
|
||||
int getPartitionId() const
|
||||
{
|
||||
return m_partitionId;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
T *createDTC(const dds::topic::Filter &filter,
|
||||
const std::string &topicName = DDS::Helper::getShortTopicName(DDS::topic_type_name<typename T::TopicType>::value()))
|
||||
{
|
||||
if (getDomainParticipant() == nullptr ||
|
||||
getDdsSubscriber() == nullptr)
|
||||
return nullptr;
|
||||
T *dtc = new T(getDomainParticipant(),
|
||||
getDdsSubscriber(),
|
||||
getSubscriberListener(),
|
||||
filter,
|
||||
topicName);
|
||||
return dtc;
|
||||
}
|
||||
int getExerciseId() const
|
||||
{
|
||||
return m_exerciseId;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
T *createFTS()
|
||||
{
|
||||
if (getDomainParticipant() == nullptr ||
|
||||
getDdsPublisher() == nullptr ||
|
||||
getDdsSubscriber() == nullptr)
|
||||
return nullptr;
|
||||
createWaitSetHandler();
|
||||
T *fts = new T(getDomainParticipant(),
|
||||
getDdsPublisher(),
|
||||
getDdsSubscriber(),
|
||||
m_wsHandler);
|
||||
return fts;
|
||||
}
|
||||
std::string getDefaultPartition() const;
|
||||
QUrl getTcpConnectionUrl() const;
|
||||
static std::string getPartitionString(IDL::PartitionType pt, int partitionId = -1);
|
||||
|
||||
template<typename T>
|
||||
T *createFTC(QObject *objToInform)
|
||||
{
|
||||
if (getDomainParticipant() == nullptr ||
|
||||
getDdsPublisher() == nullptr ||
|
||||
getDdsSubscriber() == nullptr)
|
||||
return nullptr;
|
||||
T *ftc = new T(getDomainParticipant(),
|
||||
getDdsPublisher(),
|
||||
getDdsSubscriber(),
|
||||
objToInform,
|
||||
IDL::toStdString(m_defaultPartitionType),
|
||||
m_partitionId);
|
||||
return ftc;
|
||||
}
|
||||
void initPublisherSubscriber();
|
||||
void initPublisher();
|
||||
void initSubscriber();
|
||||
void initDomainParticipant();
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void initInternal();
|
||||
void createWaitSetHandler();
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
int m_domainId;
|
||||
IDL::PartitionType m_defaultPartitionType;
|
||||
int m_partitionId;
|
||||
int m_exerciseId;
|
||||
template <typename T>
|
||||
T* createDTS(const std::string& topicName =
|
||||
DDS::Helper::getShortTopicName(DDS::topic_type_name<typename T::TopicType>::value()))
|
||||
{
|
||||
if (getDomainParticipant() == nullptr || getDdsPublisher() == nullptr)
|
||||
return nullptr;
|
||||
T* dts = new T(getDomainParticipant(), getDdsPublisher(), topicName);
|
||||
return dts;
|
||||
}
|
||||
|
||||
QUrl m_tcpConnectionUrl;
|
||||
DDS::QosProfile::ConnectionType m_connectionType;
|
||||
dds::domain::DomainParticipant m_domainParticipant;
|
||||
DDSConnector::Publisher *m_publisher;
|
||||
DDSConnector::Subscriber *m_subscriber;
|
||||
DDSGeneric::WaitSetHandler *m_wsHandler;
|
||||
template <typename T>
|
||||
T* createDTC(const std::string& topicName =
|
||||
DDS::Helper::getShortTopicName(DDS::topic_type_name<typename T::TopicType>::value()))
|
||||
{
|
||||
if (getDomainParticipant() == nullptr || getDdsSubscriber() == nullptr)
|
||||
return nullptr;
|
||||
T* dtc = new T(getDomainParticipant(), getDdsSubscriber(), getSubscriberListener(), topicName);
|
||||
return dtc;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T* createDTC(const dds::topic::Filter& filter, const std::string& topicName = DDS::Helper::getShortTopicName(
|
||||
DDS::topic_type_name<typename T::TopicType>::value()))
|
||||
{
|
||||
if (getDomainParticipant() == nullptr || getDdsSubscriber() == nullptr)
|
||||
return nullptr;
|
||||
T* dtc = new T(getDomainParticipant(), getDdsSubscriber(), getSubscriberListener(), filter, topicName);
|
||||
return dtc;
|
||||
}
|
||||
|
||||
template <typename T> T* createFTS()
|
||||
{
|
||||
if (getDomainParticipant() == nullptr || getDdsPublisher() == nullptr || getDdsSubscriber() == nullptr)
|
||||
return nullptr;
|
||||
createWaitSetHandler();
|
||||
T* fts = new T(getDomainParticipant(), getDdsPublisher(), getDdsSubscriber(), m_wsHandler);
|
||||
return fts;
|
||||
}
|
||||
|
||||
template <typename T> T* createFTC(QObject* objToInform)
|
||||
{
|
||||
if (getDomainParticipant() == nullptr || getDdsPublisher() == nullptr || getDdsSubscriber() == nullptr)
|
||||
return nullptr;
|
||||
T* ftc = new T(getDomainParticipant(), getDdsPublisher(), getDdsSubscriber(), objToInform,
|
||||
IDL::toStdString(m_defaultPartitionType), m_partitionId);
|
||||
return ftc;
|
||||
}
|
||||
|
||||
private:
|
||||
NGL::INGLLogger& m_logger;
|
||||
void initInternal();
|
||||
void createWaitSetHandler();
|
||||
|
||||
private:
|
||||
NGL::INGLLogger& m_logger;
|
||||
int m_domainId;
|
||||
IDL::PartitionType m_defaultPartitionType;
|
||||
int m_partitionId;
|
||||
int m_exerciseId;
|
||||
|
||||
QUrl m_tcpConnectionUrl;
|
||||
DDS::QosProfile::ConnectionType m_connectionType;
|
||||
dds::domain::DomainParticipant m_domainParticipant;
|
||||
DDSConnector::Publisher* m_publisher;
|
||||
DDSConnector::Subscriber* m_subscriber;
|
||||
DDSGeneric::WaitSetHandler* m_wsHandler;
|
||||
};
|
||||
|
||||
|
||||
|
||||
class CoherentSet
|
||||
{
|
||||
public:
|
||||
explicit CoherentSet(const std::shared_ptr<DdsConnector> &connector)
|
||||
: m_coherentSet(connector->getDdsPublisher())
|
||||
{}
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
dds::pub::CoherentSet m_coherentSet;
|
||||
public:
|
||||
explicit CoherentSet(const std::shared_ptr<DdsConnector>& connector) : m_coherentSet(connector->getDdsPublisher())
|
||||
{
|
||||
}
|
||||
|
||||
private:
|
||||
NGL::INGLLogger& m_logger;
|
||||
dds::pub::CoherentSet m_coherentSet;
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace DDSConnector
|
||||
Reference in new issue
Block a user