Adds succesfull lts/proxies migration & testsuite
This commit is contained in:
59 files changed
+754
-273
No files matched your search
@@ -1,6 +1,11 @@
|
||||
|
||||
|
||||
#pragma once
|
||||
|
||||
// Include Qt headers FIRST to prevent namespace pollution when RTI DDS headers include Qt
|
||||
#include <QtCore/QString>
|
||||
#include <QtCore/QUrl>
|
||||
#include <QtCore/QFlag>
|
||||
#include <LtsUtils/LtsUtilsCore/data_modification_enum.h>
|
||||
#include <dds/sub/LoanedSamples.hpp>
|
||||
|
||||
@@ -36,6 +41,18 @@ template <typename DRO_OBJECT>
|
||||
class GenericDtc
|
||||
: public GenericDtcSC<DRO_OBJECT, std::function<void(const typename DRO_OBJECT::TopicType&, DataModification)>>
|
||||
{
|
||||
public:
|
||||
using BaseClass = GenericDtcSC<DRO_OBJECT, std::function<void(const typename DRO_OBJECT::TopicType&, DataModification)>>;
|
||||
using TopicType = typename BaseClass::TopicType;
|
||||
|
||||
// Explicitly expose base class methods for accessibility through smart pointers
|
||||
void setSubscriberCallback(std::function<void(const TopicType&, DataModification)> callback) { BaseClass::setSubscriberCallback(callback); }
|
||||
bool readAlive(TopicType& data) { return BaseClass::readAlive(data); }
|
||||
bool takeAlive(TopicType& data) { return BaseClass::takeAlive(data); }
|
||||
bool takeDisposed(TopicType& data) { return BaseClass::takeDisposed(data); }
|
||||
bool hasSamples() const { return BaseClass::hasSamples(); }
|
||||
std::shared_ptr<DRO_OBJECT> dataReader() { return BaseClass::dataReader(); }
|
||||
bool waitForHistoricalData(int timeoutMSec) { return BaseClass::waitForHistoricalData(timeoutMSec); }
|
||||
};
|
||||
|
||||
template <typename DRO_OBJECT>
|
||||
@@ -43,6 +60,18 @@ class GenericDtcSampleInfo
|
||||
: public GenericDtcSC<DRO_OBJECT,
|
||||
std::function<void(const typename DRO_OBJECT::TopicType&, const dds::sub::SampleInfo&)>>
|
||||
{
|
||||
public:
|
||||
using BaseClass = GenericDtcSC<DRO_OBJECT, std::function<void(const typename DRO_OBJECT::TopicType&, const dds::sub::SampleInfo&)>>;
|
||||
using TopicType = typename BaseClass::TopicType;
|
||||
|
||||
// Explicitly expose base class methods for accessibility through smart pointers
|
||||
void setSubscriberCallback(std::function<void(const TopicType&, const dds::sub::SampleInfo&)> callback) { BaseClass::setSubscriberCallback(callback); }
|
||||
bool readAlive(TopicType& data) { return BaseClass::readAlive(data); }
|
||||
bool takeAlive(TopicType& data) { return BaseClass::takeAlive(data); }
|
||||
bool takeDisposed(TopicType& data) { return BaseClass::takeDisposed(data); }
|
||||
bool hasSamples() const { return BaseClass::hasSamples(); }
|
||||
std::shared_ptr<DRO_OBJECT> dataReader() { return BaseClass::dataReader(); }
|
||||
bool waitForHistoricalData(int timeoutMSec) { return BaseClass::waitForHistoricalData(timeoutMSec); }
|
||||
};
|
||||
|
||||
template <typename DRO_OBJECT>
|
||||
@@ -50,6 +79,18 @@ class Ddtc
|
||||
: public GenericDtcSC<
|
||||
DRO_OBJECT, std::function<void(const typename DRO_OBJECT::TopicType&, const std::string&, DataModification)>>
|
||||
{
|
||||
public:
|
||||
using BaseClass = GenericDtcSC<DRO_OBJECT, std::function<void(const typename DRO_OBJECT::TopicType&, const std::string&, DataModification)>>;
|
||||
using TopicType = typename BaseClass::TopicType;
|
||||
|
||||
// Explicitly expose base class methods for accessibility through smart pointers
|
||||
void setSubscriberCallback(std::function<void(const TopicType&, const std::string&, DataModification)> callback) { BaseClass::setSubscriberCallback(callback); }
|
||||
bool readAlive(TopicType& data) { return BaseClass::readAlive(data); }
|
||||
bool takeAlive(TopicType& data) { return BaseClass::takeAlive(data); }
|
||||
bool takeDisposed(TopicType& data) { return BaseClass::takeDisposed(data); }
|
||||
bool hasSamples() const { return BaseClass::hasSamples(); }
|
||||
std::shared_ptr<DRO_OBJECT> dataReader() { return BaseClass::dataReader(); }
|
||||
bool waitForHistoricalData(int timeoutMSec) { return BaseClass::waitForHistoricalData(timeoutMSec); }
|
||||
};
|
||||
|
||||
template <typename DRO_OBJECT>
|
||||
@@ -57,5 +98,17 @@ class DdtcSampleInfo
|
||||
: public GenericDtcSC<DRO_OBJECT, std::function<void(const typename DRO_OBJECT::TopicType&, const std::string&,
|
||||
const dds::sub::SampleInfo&)>>
|
||||
{
|
||||
public:
|
||||
using BaseClass = GenericDtcSC<DRO_OBJECT, std::function<void(const typename DRO_OBJECT::TopicType&, const std::string&, const dds::sub::SampleInfo&)>>;
|
||||
using TopicType = typename BaseClass::TopicType;
|
||||
|
||||
// Explicitly expose base class methods for accessibility through smart pointers
|
||||
void setSubscriberCallback(std::function<void(const TopicType&, const std::string&, const dds::sub::SampleInfo&)> callback) { BaseClass::setSubscriberCallback(callback); }
|
||||
bool readAlive(TopicType& data) { return BaseClass::readAlive(data); }
|
||||
bool takeAlive(TopicType& data) { return BaseClass::takeAlive(data); }
|
||||
bool takeDisposed(TopicType& data) { return BaseClass::takeDisposed(data); }
|
||||
bool hasSamples() const { return BaseClass::hasSamples(); }
|
||||
std::shared_ptr<DRO_OBJECT> dataReader() { return BaseClass::dataReader(); }
|
||||
bool waitForHistoricalData(int timeoutMSec) { return BaseClass::waitForHistoricalData(timeoutMSec); }
|
||||
};
|
||||
} // namespace DTC
|
||||
@@ -2,19 +2,22 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
// Include Qt headers FIRST to prevent namespace pollution when RTI DDS headers include Qt
|
||||
#include <QtCore/QString>
|
||||
#include <QtCore/QUrl>
|
||||
#include <QtCore/QFlag>
|
||||
#include <QtCore/QTimer>
|
||||
#include "generic_dtc.h"
|
||||
|
||||
#include <DDS/Generic/generic_data_reader.h>
|
||||
#include <DDS/Generic/generic_logger.h>
|
||||
#include <DDS/Generic/subscriber_listener.h>
|
||||
#include <QtCore/QTimer>
|
||||
#include <dds/core/cond/StatusCondition.hpp>
|
||||
#include <dds/core/cond/WaitSet.hpp>
|
||||
|
||||
namespace DDSGeneric
|
||||
{
|
||||
class DynamicDataReader;
|
||||
}
|
||||
} // namespace DDSGeneric
|
||||
|
||||
namespace DTC
|
||||
{
|
||||
@@ -154,7 +157,7 @@ class GenericDtcImplSubscriberTemplate : public DDSGeneric::SubscriberListenerCa
|
||||
if (dr.subscription_matched_status().current_count() == 0)
|
||||
{
|
||||
dds::core::cond::WaitSet ws;
|
||||
dds::core::cond::StatusCondition cond(dr);
|
||||
auto cond = dds::core::cond::StatusCondition(dr);
|
||||
cond.enabled_statuses(dds::core::status::StatusMask::subscription_matched());
|
||||
ws.attach_condition(cond);
|
||||
const dds::core::Duration waitTimeout(bWaitForever ? dds::core::Duration::infinite()
|
||||
|
||||
@@ -4,7 +4,15 @@
|
||||
|
||||
#if BUILD_RTI
|
||||
|
||||
// Include Qt headers FIRST, before any other includes, to prevent Qt symbols
|
||||
// from being resolved in connext namespace when RTI DDS headers include Qt
|
||||
#include <QtCore/QString>
|
||||
#include <QtCore/QUrl>
|
||||
#include <QtCore/QFlag>
|
||||
#include <QtCore/QByteArray>
|
||||
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
#include "TrainingAreaBase/logger.h"
|
||||
#include <dds/core/cond/GuardCondition.hpp>
|
||||
#include <dds/core/cond/StatusCondition.hpp>
|
||||
#include <dds/core/cond/WaitSet.hpp>
|
||||
@@ -282,7 +290,7 @@ template <typename REQUEST, typename REPLY> class Requester final : public Reply
|
||||
, m_dataReader(nullptr)
|
||||
, m_contentFilteredTopic(nullptr)
|
||||
, m_curInstanceHandle(dds::core::InstanceHandle::nil())
|
||||
, m_logger(NGL::getNGLLogger("connext.requester"))
|
||||
|
||||
{
|
||||
}
|
||||
|
||||
@@ -312,7 +320,7 @@ template <typename REQUEST, typename REPLY> class Requester final : public Reply
|
||||
|
||||
m_contentFilteredTopic->filter(dds::topic::Filter(filterContent.data()));
|
||||
}
|
||||
DEBUG_LOG(m_logger) << "content filter for topic " << ReplyRequestBase<REQUEST, REPLY>::m_requestTopic.name()
|
||||
DEBUG_LOG(::TrainingAreaBase::getLogger("connext")) << "content filter for topic " << ReplyRequestBase<REQUEST, REPLY>::m_requestTopic.name()
|
||||
<< " - related_sample_identity should be: " << writerGuid;
|
||||
}
|
||||
|
||||
@@ -345,7 +353,7 @@ template <typename REQUEST, typename REPLY> class Requester final : public Reply
|
||||
m_dataWriter->write(request.data(), request.info());
|
||||
|
||||
const rti::core::SampleIdentity currentSampleIdentity = request.info().identity();
|
||||
DEBUG_LOG(m_logger) << "send_request for topic " << ReplyRequestBase<REQUEST, REPLY>::m_requestTopic.name()
|
||||
DEBUG_LOG(::TrainingAreaBase::getLogger("connext")) << "send_request for topic " << ReplyRequestBase<REQUEST, REPLY>::m_requestTopic.name()
|
||||
<< ", m_currentSampleIdentity: " << DebugInfo::toReadable(currentSampleIdentity);
|
||||
}
|
||||
|
||||
@@ -362,13 +370,13 @@ template <typename REQUEST, typename REPLY> class Requester final : public Reply
|
||||
|
||||
if (m_dataReader->take(reply.data(), reply.info()) && reply.info().valid())
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "receive_reply for topic "
|
||||
DEBUG_LOG(::TrainingAreaBase::getLogger("connext")) << "receive_reply for topic "
|
||||
<< ReplyRequestBase<REQUEST, REPLY>::m_requestTopic.name()
|
||||
<< ", SampleIdentity - original publication virtual: "
|
||||
<< DebugInfo::toReadable(
|
||||
reply.info()->original_publication_virtual_sample_identity());
|
||||
|
||||
DEBUG_LOG(m_logger) << "receive_reply for topic "
|
||||
DEBUG_LOG(::TrainingAreaBase::getLogger("connext")) << "receive_reply for topic "
|
||||
<< ReplyRequestBase<REQUEST, REPLY>::m_requestTopic.name()
|
||||
<< ", SampleIdentity - related original: "
|
||||
<< DebugInfo::toReadable(
|
||||
@@ -381,7 +389,7 @@ template <typename REQUEST, typename REPLY> class Requester final : public Reply
|
||||
dds::core::cond::WaitSet::ConditionSeq activeConditionsSeq = waitset.wait(duration);
|
||||
if (activeConditionsSeq.empty())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Bailing out!";
|
||||
ERROR_LOG(::TrainingAreaBase::getLogger("connext")) << "Bailing out!";
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -392,7 +400,7 @@ template <typename REQUEST, typename REPLY> class Requester final : public Reply
|
||||
if (!m_curInstanceHandle.is_nil())
|
||||
{
|
||||
|
||||
DEBUG_LOG(m_logger) << "Keyed topic - disposing instance: "
|
||||
DEBUG_LOG(::TrainingAreaBase::getLogger("connext")) << "Keyed topic - disposing instance: "
|
||||
<< ReplyRequestBase<REQUEST, REPLY>::m_requestTopic.name();
|
||||
m_dataWriter.dispose_instance(m_curInstanceHandle);
|
||||
}
|
||||
@@ -431,7 +439,7 @@ template <typename REQUEST, typename REPLY> class Replier final : public ReplyRe
|
||||
, m_dataReader(dds::sub::DataReader<REQUEST>(replierParams.subscriber(),
|
||||
ReplyRequestBase<REQUEST, REPLY>::m_requestTopic,
|
||||
replierParams.datareader_qos()))
|
||||
, m_logger(NGL::getNGLLogger("connext.replier"))
|
||||
|
||||
{
|
||||
}
|
||||
|
||||
@@ -447,7 +455,7 @@ template <typename REQUEST, typename REPLY> class Replier final : public ReplyRe
|
||||
void send_reply(connext::WriteSampleRef<REPLY>& reply, const rti::core::SampleIdentity& identity,
|
||||
bool bLastSample = true)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "send_reply for topic " << ReplyRequestBase<REQUEST, REPLY>::m_requestTopic.name()
|
||||
DEBUG_LOG(::TrainingAreaBase::getLogger("connext")) << "send_reply for topic " << ReplyRequestBase<REQUEST, REPLY>::m_requestTopic.name()
|
||||
<< ", sampleIdentity: " << DebugInfo::toReadable(identity);
|
||||
|
||||
rti::core::SampleFlag sf = reply.info().flag();
|
||||
@@ -457,7 +465,7 @@ template <typename REQUEST, typename REPLY> class Replier final : public ReplyRe
|
||||
sf |= rti::core::SampleFlag::intermediate_reply_sequence();
|
||||
reply.info().flag(sf);
|
||||
reply.info().related_sample_identity(identity);
|
||||
DEBUG_LOG(m_logger) << "send_reply for topic " << ReplyRequestBase<REQUEST, REPLY>::m_requestTopic.name()
|
||||
DEBUG_LOG(::TrainingAreaBase::getLogger("connext")) << "send_reply for topic " << ReplyRequestBase<REQUEST, REPLY>::m_requestTopic.name()
|
||||
<< ", related sampleIdentity: "
|
||||
<< DebugInfo::toReadable(reply.info().related_sample_identity());
|
||||
|
||||
@@ -471,7 +479,7 @@ template <typename REQUEST, typename REPLY> class Replier final : public ReplyRe
|
||||
|
||||
if (request.info().valid())
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "receive_request for topic " << ReplyRequestBase<REQUEST, REPLY>::m_requestTopic.name()
|
||||
DEBUG_LOG(::TrainingAreaBase::getLogger("connext")) << "receive_request for topic " << ReplyRequestBase<REQUEST, REPLY>::m_requestTopic.name()
|
||||
<< ", sampleIdentity publication_virtual_sample_identity: "
|
||||
<< DebugInfo::toReadable(request.info()->publication_virtual_sample_identity())
|
||||
<< ", original_publication_virtual_sample_identity: "
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
#include <DDS/Core/core.hpp>
|
||||
|
||||
#include <DDS/FTS/generic_fts.h>
|
||||
#include "generic_fts_internal.h"
|
||||
#include "connext.h"
|
||||
#include <DDS/Generic/wait_set_handler.h>
|
||||
@@ -63,8 +64,8 @@ private:
|
||||
connext::WriteSample<ReplyTopic> reply;
|
||||
reply.data().replyState(replyState);
|
||||
|
||||
bool bLastTelegram = ((replyState != Core::FtReplyState_def::InProgress) &&
|
||||
(replyState != Core::FtReplyState_def::NotStarted));
|
||||
bool bLastTelegram = ((replyState != Core::FtReplyState::InProgress) &&
|
||||
(replyState != Core::FtReplyState::NotStarted));
|
||||
m_replier->send_reply(reply, requestSampleIdentity, bLastTelegram);
|
||||
}
|
||||
|
||||
@@ -233,8 +234,8 @@ protected:
|
||||
<< "[s], -> age: " << age
|
||||
<< "[s], data: " << s;
|
||||
ReplyTopic rt;
|
||||
rt.errorString(tr_lts("dds", "Topic %1 was outdated and therefore ignored. Does the client time match the server time?"));
|
||||
rt.errorParams({TopicNameHelper::requestTopicName()});
|
||||
rt.errorString = tr_lts("dds", "Topic %1 was outdated and therefore ignored. Does the client time match the server time?");
|
||||
rt.errorParams = {TopicNameHelper::requestTopicName()};
|
||||
sendReply(request.identity(), rt);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2,8 +2,13 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <DDS/Generic/generic_base.h>
|
||||
// Include ALL headers BEFORE opening DDSGeneric namespace to prevent Qt symbols
|
||||
// from being resolved in DDSGeneric namespace when RTI DDS headers include Qt
|
||||
#include <QtCore/QString>
|
||||
#include <QtCore/QUrl>
|
||||
#include <QtCore/QFlag>
|
||||
#include <DDS/Generic/generic_logger.h>
|
||||
#include <DDS/Generic/generic_base.h>
|
||||
#include <LtsUtils/LtsUtilsCore/data_modification_enum.h>
|
||||
#include <dds/core/xtypes/StructType.hpp>
|
||||
#include <dds/sub/DataReader.hpp>
|
||||
|
||||
@@ -2,6 +2,10 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
// Include Qt headers FIRST to prevent namespace pollution when RTI DDS headers include Qt
|
||||
#include <QtCore/QString>
|
||||
#include <QtCore/QUrl>
|
||||
#include <QtCore/QFlag>
|
||||
#include <DDS/Generic/generic_base.h>
|
||||
#include <DDS/Generic/generic_logger.h>
|
||||
#include <LtsUtils/LtsUtilsCore/data_modification_enum.h>
|
||||
|
||||
@@ -2,6 +2,10 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
// Include Qt headers FIRST to prevent namespace pollution when RTI DDS headers include Qt
|
||||
#include <QtCore/QString>
|
||||
#include <QtCore/QUrl>
|
||||
#include <QtCore/QFlag>
|
||||
#include <DDS/Generic/generic_base.h>
|
||||
#include <DDS/Generic/generic_logger.h>
|
||||
#include <dds/pub/DataWriter.hpp>
|
||||
|
||||
@@ -2,19 +2,16 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QMetaMethod>
|
||||
// Include Qt headers FIRST to prevent namespace pollution when RTI DDS headers include Qt
|
||||
#include <QtCore/QObject>
|
||||
#include <QtCore/QMetaMethod>
|
||||
#include <QtCore/QReadWriteLock>
|
||||
#include <NGLLogger/INGLLogger.h>
|
||||
#include <dds/sub/AnyDataReader.hpp>
|
||||
#include <dds/sub/SubscriberListener.hpp>
|
||||
#include <dds/topic/Topic.hpp>
|
||||
#include <ddsgen_export.h>
|
||||
|
||||
namespace NGL
|
||||
{
|
||||
class INGLLogger;
|
||||
}
|
||||
|
||||
namespace DDSGeneric
|
||||
{
|
||||
class DDSGEN_EXPORT SubscriberListenerCallback : public QObject
|
||||
|
||||
@@ -2,6 +2,10 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
// Include Qt headers FIRST to prevent namespace pollution when RTI DDS headers include Qt
|
||||
#include <QtCore/QString>
|
||||
#include <QtCore/QUrl>
|
||||
#include <QtCore/QFlag>
|
||||
#include <dds/core/xtypes/StructType.hpp>
|
||||
|
||||
namespace DDSGeneric
|
||||
|
||||
@@ -2,6 +2,10 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
// Include Qt headers FIRST to prevent namespace pollution when RTI DDS headers include Qt
|
||||
#include <QtCore/QString>
|
||||
#include <QtCore/QUrl>
|
||||
#include <QtCore/QFlag>
|
||||
#include <dds/core/cond/Condition.hpp>
|
||||
#include <dds/core/cond/GuardCondition.hpp>
|
||||
#include <dds/core/cond/WaitSet.hpp>
|
||||
|
||||
Reference in new issue
Block a user