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:
torstenandCopilot committed 2026-08-19 14:46:29 +02:00
1 parent 1881d68aef
commit d6b6ffce7c
848 files changed
+89305 -100020

No files matched your search

+101 -112
View File
@@ -1,142 +1,131 @@
#pragma once
#include <DDS/Generic/generic_base.h>
#include <DDS/Generic/generic_logger.h>
#include <dds/pub/DataWriter.hpp>
#include <dds/sub/SampleInfo.hpp>
#include <dds/topic/find.hpp>
#include <dds/topic/Topic.hpp>
#include <DDS/Generic/generic_logger.h>
#include <DDS/Generic/generic_base.h>
#include <dds/topic/find.hpp>
namespace DDSGeneric
{
template <typename TOPICTYPE>
class GenericDataWriter final
template <typename TOPICTYPE> class GenericDataWriter final
{
public:
using TopicType = TOPICTYPE;
using DataWriter = dds::pub::DataWriter<TopicType>;
using DataTopic = dds::topic::Topic<TopicType>;
public:
using TopicType = TOPICTYPE;
using DataWriter = dds::pub::DataWriter<TopicType>;
using DataTopic = dds::topic::Topic<TopicType>;
GenericDataWriter()
: m_dataWriter(nullptr)
, m_ddsTopic(nullptr)
, m_logger(DDS::getLogger(DDS::topic_type_name<TopicType>::value(), DDS::DataType::DATA_WRITER))
{}
bool create(const dds::domain::DomainParticipant &participant,
const dds::pub::Publisher &ddsPublisher,
const std::string &topicName = DDS::Helper::getShortTopicName(DDS::topic_type_name<TopicType>::value()))
{
DEBUG_LOG(m_logger) << "IN GenericDataWriter::create ("
<< DDS::topic_type_name<TopicType>::value()
<< ")";
if (participant == nullptr)
GenericDataWriter()
: m_dataWriter(nullptr), m_ddsTopic(nullptr),
m_logger(DDS::getLogger(DDS::topic_type_name<TopicType>::value(), DDS::DataType::DATA_WRITER))
{
ERROR_LOG(m_logger) << "Participant not available, aborting. ";
return false;
}
if (m_ddsTopic != nullptr)
bool create(const dds::domain::DomainParticipant& participant, const dds::pub::Publisher& ddsPublisher,
const std::string& topicName = DDS::Helper::getShortTopicName(DDS::topic_type_name<TopicType>::value()))
{
ERROR_LOG(m_logger) << "Type '"
<< DDS::topic_type_name<TopicType>::value()
<< "' already created";
return false;
DEBUG_LOG(m_logger) << "IN GenericDataWriter::create (" << DDS::topic_type_name<TopicType>::value() << ")";
if (participant == nullptr)
{
ERROR_LOG(m_logger) << "Participant not available, aborting. ";
return false;
}
if (m_ddsTopic != nullptr)
{
ERROR_LOG(m_logger) << "Type '" << DDS::topic_type_name<TopicType>::value() << "' already created";
return false;
}
try
{
DEBUG_LOG(m_logger) << "Creating write topic " << topicName
<< " with type: " << DDS::topic_type_name<TopicType>::value();
m_ddsTopic = dds::topic::find<DataTopic>(participant, topicName);
if (m_ddsTopic == nullptr)
m_ddsTopic = DataTopic(participant, topicName);
m_dataWriter = DataWriter(ddsPublisher, m_ddsTopic, ddsPublisher.default_datawriter_qos());
if (m_dataWriter == nullptr)
{
ERROR_LOG(m_logger) << "Initialisation of " << DDS::topic_type_name<TopicType>::value() << " failed ";
return false;
}
}
catch (const dds::core::Exception& ex)
{
ERROR_LOG(m_logger) << ex.what();
return false;
}
DEBUG_LOG(m_logger) << "dataWriter created (" << DDS::topic_type_name<TopicType>::value() << ")";
return true;
}
try {
DEBUG_LOG(m_logger) << "Creating write topic " << topicName << " with type: "
<< DDS::topic_type_name<TopicType>::value();
m_ddsTopic = dds::topic::find<DataTopic>(participant, topicName);
if (m_ddsTopic == nullptr)
m_ddsTopic = DataTopic(participant, topicName);
m_dataWriter = DataWriter(ddsPublisher,
m_ddsTopic,
ddsPublisher.default_datawriter_qos());
if (m_dataWriter == nullptr)
{
ERROR_LOG(m_logger) << "Initialisation of "
<< DDS::topic_type_name<TopicType>::value()
<< " failed ";
return false;
}
}
catch ( const dds::core::Exception &ex )
bool write(const TopicType& data,
const dds::core::optional<dds::sub::SampleInfo>& si = dds::core::optional<dds::sub::SampleInfo>())
{
ERROR_LOG(m_logger) << ex.what();
return false;
DEBUG_LOG(m_logger) << "IN write (" << DDS::topic_type_name<TopicType>::value() << ") ";
if (m_dataWriter == nullptr)
{
ERROR_LOG(m_logger) << "No dataWriter initialised ";
return false;
}
if (si.is_set())
{
rti::pub::WriteParams writeParams;
rti::core::SampleIdentity sampleIdentity(si.get()->source_guid(), si.get()->publication_sequence_number());
writeParams.related_sample_identity(sampleIdentity);
m_dataWriter->write(data, writeParams);
}
else
{
m_dataWriter.write(data);
}
return true;
}
DEBUG_LOG(m_logger) << "dataWriter created ("
<< DDS::topic_type_name<TopicType>::value()
<< ")";
return true;
}
bool write(const TopicType &data,
const dds::core::optional<dds::sub::SampleInfo> &si = dds::core::optional<dds::sub::SampleInfo>())
{
DEBUG_LOG(m_logger) << "IN write ("
<< DDS::topic_type_name<TopicType>::value()
<< ") ";
if (m_dataWriter == nullptr) {
ERROR_LOG(m_logger) << "No dataWriter initialised ";
return false;
}
if (si.is_set())
bool remove(const TopicType& data, bool errorMsgIfNotExists = true)
{
rti::pub::WriteParams writeParams;
rti::core::SampleIdentity sampleIdentity(si.get()->source_guid(), si.get()->publication_sequence_number());
writeParams.related_sample_identity(sampleIdentity);
DEBUG_LOG(m_logger) << "IN remove (" << DDS::topic_type_name<TopicType>::value() << ") ";
m_dataWriter->write(data, writeParams);
} else {
m_dataWriter.write(data);
if (m_dataWriter == nullptr)
{
ERROR_LOG(m_logger) << "No dataWriter initialised ";
return false;
}
const dds::core::InstanceHandle ih = m_dataWriter.lookup_instance(data);
if (ih.is_nil())
{
if (errorMsgIfNotExists)
ERROR_LOG(m_logger) << "Could not find instance for topic " << DDS::topic_type_name<TopicType>::value()
<< " for unregistering!";
return false;
}
m_dataWriter.dispose_instance(ih);
return true;
}
return true;
}
bool remove(const TopicType &data, bool errorMsgIfNotExists = true)
{
DEBUG_LOG(m_logger) << "IN remove ("
<< DDS::topic_type_name<TopicType>::value()
<< ") ";
if (m_dataWriter == nullptr) {
ERROR_LOG(m_logger) << "No dataWriter initialised ";
return false;
DataWriter dataWriter() const
{
return m_dataWriter;
}
const dds::core::InstanceHandle ih = m_dataWriter.lookup_instance(data);
if (ih.is_nil()) {
if (errorMsgIfNotExists)
ERROR_LOG(m_logger) << "Could not find instance for topic "
<< DDS::topic_type_name<TopicType>::value()
<< " for unregistering!";
return false;
}
m_dataWriter.dispose_instance(ih);
return true;
}
DataWriter dataWriter() const { return m_dataWriter; }
private:
DataWriter m_dataWriter;
DataTopic m_ddsTopic;
private:
DataWriter m_dataWriter;
DataTopic m_ddsTopic;
};
}
} // namespace DDSGeneric