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
+41
-52
@@ -3,85 +3,74 @@
|
||||
#pragma once
|
||||
|
||||
#include "generic_dts.h"
|
||||
|
||||
#include <DDS/Generic/generic_data_writer.h>
|
||||
#include <DDS/Generic/generic_logger.h>
|
||||
|
||||
namespace DTS
|
||||
{
|
||||
template<typename DWO_OBJECT>
|
||||
class GenericDtsImpl final : public GenericDts<typename DWO_OBJECT::TopicType>
|
||||
{
|
||||
template <typename DWO_OBJECT> class GenericDtsImpl final : public GenericDts<typename DWO_OBJECT::TopicType>
|
||||
{
|
||||
public:
|
||||
using DataWriterObject = DWO_OBJECT;
|
||||
using TopicType = typename DWO_OBJECT::TopicType;
|
||||
using DataWriter = typename dds::pub::DataWriter<TopicType>;
|
||||
using TopicType = typename DWO_OBJECT::TopicType;
|
||||
using DataWriter = typename dds::pub::DataWriter<TopicType>;
|
||||
|
||||
GenericDtsImpl(const dds::domain::DomainParticipant &domainParticipant,
|
||||
const dds::pub::Publisher &ddsPublisher,
|
||||
const std::string &topicName = DDS::Helper::getShortTopicName(DDS::topic_type_name<TopicType>::value()))
|
||||
: m_dataWriterObject(new DataWriterObject())
|
||||
, m_logger(DDS::getLogger(DDS::topic_type_name<TopicType>::value(), DDS::DataType::DATA_TOPIC_SERVER))
|
||||
GenericDtsImpl(
|
||||
const dds::domain::DomainParticipant& domainParticipant, const dds::pub::Publisher& ddsPublisher,
|
||||
const std::string& topicName = DDS::Helper::getShortTopicName(DDS::topic_type_name<TopicType>::value()))
|
||||
: m_dataWriterObject(new DataWriterObject()),
|
||||
m_logger(DDS::getLogger(DDS::topic_type_name<TopicType>::value(), DDS::DataType::DATA_TOPIC_SERVER))
|
||||
{
|
||||
Q_ASSERT(domainParticipant != nullptr);
|
||||
Q_ASSERT(ddsPublisher != nullptr);
|
||||
Q_ASSERT(domainParticipant != nullptr);
|
||||
Q_ASSERT(ddsPublisher != nullptr);
|
||||
|
||||
m_dataWriterObject->create(domainParticipant, ddsPublisher, topicName);
|
||||
m_dataWriterObject->create(domainParticipant, ddsPublisher, topicName);
|
||||
}
|
||||
|
||||
~GenericDtsImpl()
|
||||
{
|
||||
delete m_dataWriterObject;
|
||||
delete m_dataWriterObject;
|
||||
}
|
||||
|
||||
bool write(const TopicType &data,
|
||||
const dds::core::optional<dds::sub::SampleInfo> &si = dds::core::optional<dds::sub::SampleInfo>()) override final
|
||||
bool write(const TopicType& data, const dds::core::optional<dds::sub::SampleInfo>& si =
|
||||
dds::core::optional<dds::sub::SampleInfo>()) override final
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "IN write ("
|
||||
<< DDS::topic_type_name<TopicType>::value()
|
||||
<< ")";
|
||||
DEBUG_LOG(m_logger) << "IN write (" << DDS::topic_type_name<TopicType>::value() << ")";
|
||||
|
||||
if (!m_dataWriterObject)
|
||||
return false;
|
||||
if (!m_dataWriterObject)
|
||||
return false;
|
||||
|
||||
if (!m_dataWriterObject->write(data, si))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error writing for "
|
||||
<< DDS::topic_type_name<TopicType>::value();
|
||||
return false;
|
||||
}
|
||||
DEBUG_LOG(m_logger) << "TopicData ("
|
||||
<< DDS::topic_type_name<TopicType>::value()
|
||||
<< ") written";
|
||||
if (!m_dataWriterObject->write(data, si))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error writing for " << DDS::topic_type_name<TopicType>::value();
|
||||
return false;
|
||||
}
|
||||
DEBUG_LOG(m_logger) << "TopicData (" << DDS::topic_type_name<TopicType>::value() << ") written";
|
||||
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool remove(const TopicType &data, bool errorMsgIfNotExists = true) override final
|
||||
bool remove(const TopicType& data, bool errorMsgIfNotExists = true) override final
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "IN remove ("
|
||||
<< DDS::topic_type_name<TopicType>::value()
|
||||
<< ")";
|
||||
DEBUG_LOG(m_logger) << "IN remove (" << DDS::topic_type_name<TopicType>::value() << ")";
|
||||
|
||||
if (!m_dataWriterObject)
|
||||
return false;
|
||||
if (!m_dataWriterObject)
|
||||
return false;
|
||||
|
||||
if (!m_dataWriterObject->remove(data, errorMsgIfNotExists))
|
||||
{
|
||||
if (errorMsgIfNotExists)
|
||||
ERROR_LOG(m_logger) << "Error removing for "
|
||||
<< DDS::topic_type_name<TopicType>::value();
|
||||
return false;
|
||||
}
|
||||
DEBUG_LOG(m_logger) << "TopicData ("
|
||||
<< DDS::topic_type_name<TopicType>::value()
|
||||
<< ") removed";
|
||||
if (!m_dataWriterObject->remove(data, errorMsgIfNotExists))
|
||||
{
|
||||
if (errorMsgIfNotExists)
|
||||
ERROR_LOG(m_logger) << "Error removing for " << DDS::topic_type_name<TopicType>::value();
|
||||
return false;
|
||||
}
|
||||
DEBUG_LOG(m_logger) << "TopicData (" << DDS::topic_type_name<TopicType>::value() << ") removed";
|
||||
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
DataWriterObject *m_dataWriterObject;
|
||||
};
|
||||
DataWriterObject* m_dataWriterObject;
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace DTS
|
||||
Reference in new issue
Block a user