Adds further migration results and moves generated tests in
This commit is contained in:
442 files changed
+17126
-246
No files matched your search
@@ -6,8 +6,7 @@
|
||||
# Created by Mike Wille, SLSE, 2016-09-19
|
||||
#
|
||||
|
||||
IF(BUILD_RTI)
|
||||
ADD_SUBDIRECTORY(LtsUtilsGuiDds)
|
||||
ENDIF()
|
||||
# LtsUtilsGuiDds is needed by LtsMultiMonitor regardless of BUILD_RTI
|
||||
ADD_SUBDIRECTORY(LtsUtilsGuiDds)
|
||||
ADD_SUBDIRECTORY(ConnectDialog)
|
||||
ADD_SUBDIRECTORY(StyleManager)
|
||||
+4
-6
@@ -13,25 +13,23 @@ SET(SRCS
|
||||
request_helper.h
|
||||
)
|
||||
|
||||
NGL_ADD_LIBRARY2(WS LtsUtilsGuiDds SHARED ${SRCS})
|
||||
NGL_ADD_LIBRARY2(WS SV AAR HLA LtsUtilsGuiDds SHARED ${SRCS})
|
||||
NGL_TARGET_INCLUDE_DIRECTORIES(LtsUtilsGuiDds
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../
|
||||
${CMAKE_CURRENT_BINARY_DIR}/../
|
||||
)
|
||||
IF(BUILD_RTI)
|
||||
NGL_TARGET_LINK_LIBRARIES(LtsUtilsGuiDds
|
||||
PRIVATE
|
||||
PUBLIC
|
||||
LtsUtilsCoreHeaderOnly
|
||||
LtsWidgets
|
||||
Qt6::Gui
|
||||
Qt6::Widgets
|
||||
Qt6::Svg
|
||||
PUBLIC
|
||||
Qt6::Core
|
||||
ddscore
|
||||
)
|
||||
IF(BUILD_RTI)
|
||||
TARGET_LINK_LIBRARIES(LtsUtilsGuiDds PUBLIC ddscore)
|
||||
ENDIF(BUILD_RTI)
|
||||
NGL_TARGET_COMPILE_DEFINITIONS(LtsUtilsGuiDds
|
||||
PUBLIC
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "ltsutilsguidds_export.h"
|
||||
#include <LtsUtilsCore/ltsutilscore_export.h>
|
||||
|
||||
#include <QSize>
|
||||
#include <QString>
|
||||
|
||||
+2
@@ -6,5 +6,7 @@
|
||||
|
||||
#define LTSUTILSDDS_EXPORT
|
||||
#define LTSUTILSDDS_NO_EXPORT
|
||||
#define LTSUTILSGUIDDS_EXPORT
|
||||
#define LTSUTILSGUIDDS_NO_EXPORT
|
||||
|
||||
#endif // LTSUTILSDDS_EXPORT_H
|
||||
+17
-4
@@ -46,14 +46,21 @@ RequestHelper::RequestHelper(QObject* parent, bool quiet,
|
||||
}
|
||||
|
||||
void RequestHelper::addRequest(const std::function<int64_t()>& requestFunction,
|
||||
const std::function<void(const Core::FunctionReply& baseReply)>& baseReplyHandler)
|
||||
const std::function<void(const FunctionReplyType& baseReply)>& baseReplyHandler)
|
||||
{
|
||||
m_requestFunctions.append(RequestFunctionContainer(requestFunction, baseReplyHandler));
|
||||
}
|
||||
|
||||
bool RequestHelper::requestReply(const Core::FunctionReply& baseReply)
|
||||
bool RequestHelper::requestReply(const FunctionReplyType& baseReply)
|
||||
{
|
||||
#ifdef BUILD_RTI
|
||||
// Bei BUILD_RTI=ON: baseReply ist Core::FunctionReply, cast von dds::core::Reference
|
||||
// Die Implementation erwartet Core::FunctionReplyObject
|
||||
const Core::FunctionReplyObject fro(baseReply.id(), baseReply.errorString(), baseReply.errorParams());
|
||||
#else
|
||||
// Stub-Version: nur id und error string
|
||||
const Core::FunctionReplyObject fro(baseReply.id(), baseReply.str().c_str());
|
||||
#endif
|
||||
return _requestReply(fro, &baseReply);
|
||||
}
|
||||
|
||||
@@ -62,7 +69,7 @@ bool RequestHelper::requestReply(const Core::FunctionReplyObject& replyObject)
|
||||
return _requestReply(replyObject, nullptr);
|
||||
}
|
||||
|
||||
bool RequestHelper::_requestReply(const Core::FunctionReplyObject& fro, const Core::FunctionReply* baseReply)
|
||||
bool RequestHelper::_requestReply(const Core::FunctionReplyObject& fro, const FunctionReplyType* baseReply)
|
||||
{
|
||||
m_errorString = fro.translated();
|
||||
|
||||
@@ -93,8 +100,14 @@ bool RequestHelper::_requestReply(const Core::FunctionReplyObject& fro, const Co
|
||||
if (baseReply)
|
||||
m_singleRequestCustomFunctionReply(*baseReply);
|
||||
else
|
||||
#ifdef BUILD_RTI
|
||||
m_singleRequestCustomFunctionReply(
|
||||
Core::FunctionReply(fro.id(), fro.str(), fro.args(), fro.additionalInfo()));
|
||||
#else
|
||||
// Stub-Version: FunctionReply mit passendem Konstruktor
|
||||
m_singleRequestCustomFunctionReply(
|
||||
Core::FunctionReply(fro.id(), fro.str(), fro.args(), fro.additionalInfo()));
|
||||
#endif
|
||||
}
|
||||
|
||||
if (fro.error())
|
||||
@@ -182,7 +195,7 @@ void RequestHelper::slotNextRequest()
|
||||
|
||||
void RequestHelper::startSingleBackgroundRequest(
|
||||
const std::function<int64_t()>& requestFunction,
|
||||
const std::function<void(const Core::FunctionReply&)>& baseReplyHandler)
|
||||
const std::function<void(const FunctionReplyType&)>& baseReplyHandler)
|
||||
{
|
||||
m_blockingCall = false;
|
||||
startSingleRequest(requestFunction, baseReplyHandler);
|
||||
|
||||
+13
-18
@@ -11,25 +11,20 @@
|
||||
#endif
|
||||
|
||||
#include <Core/core_types.h>
|
||||
#include <DDS/Core/core.hpp>
|
||||
#include <QObject>
|
||||
#include <QPair>
|
||||
#include <QVector>
|
||||
#include <functional>
|
||||
#include <optional>
|
||||
|
||||
// BUILD_RTI wird immer definiert sein (ON oder OFF)
|
||||
// Type alias für FunctionReply - immer Core::FunctionReply verwenden
|
||||
// Bei BUILD_RTI=ON wird in der .cpp auf dds::core::Reference gecastet
|
||||
using FunctionReplyType = Core::FunctionReply;
|
||||
|
||||
namespace LtsUtils
|
||||
{
|
||||
|
||||
template <typename T> dds::core::optional<T> toOptional(T inVal)
|
||||
{
|
||||
return inVal != T() ? dds::core::optional<T>(inVal) : dds::core::optional<T>();
|
||||
}
|
||||
|
||||
template <typename T> dds::core::optional<T> optional()
|
||||
{
|
||||
return dds::core::optional<T>();
|
||||
}
|
||||
|
||||
class LTSUTILSGUIDDS_INTERNAL_EXPORT RequestHelper : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -54,20 +49,20 @@ class LTSUTILSGUIDDS_INTERNAL_EXPORT RequestHelper : public QObject
|
||||
}
|
||||
|
||||
void addRequest(const std::function<int64_t()>& requestFunction,
|
||||
const std::function<void(const Core::FunctionReply& baseReply)>& baseReplyHandler = nullptr);
|
||||
const std::function<void(const FunctionReplyType& baseReply)>& baseReplyHandler = nullptr);
|
||||
bool startRequests();
|
||||
|
||||
bool
|
||||
startSingleRequest(const std::function<int64_t(void)>& requestFunction,
|
||||
const std::function<void(const Core::FunctionReply& baseReply)>& baseReplyHandler = nullptr);
|
||||
const std::function<void(const FunctionReplyType& baseReply)>& baseReplyHandler = nullptr);
|
||||
|
||||
void startSingleBackgroundRequest(
|
||||
const std::function<int64_t()>& requestFunction,
|
||||
const std::function<void(const Core::FunctionReply& baseReply)>& baseReplyHandler = nullptr);
|
||||
const std::function<void(const FunctionReplyType& baseReply)>& baseReplyHandler = nullptr);
|
||||
|
||||
void startBackgroundRequests();
|
||||
|
||||
bool requestReply(const Core::FunctionReply& baseReply);
|
||||
bool requestReply(const FunctionReplyType& baseReply);
|
||||
bool requestReply(const Core::FunctionReplyObject& replyObject);
|
||||
|
||||
bool hasRequests() const
|
||||
@@ -95,12 +90,12 @@ class LTSUTILSGUIDDS_INTERNAL_EXPORT RequestHelper : public QObject
|
||||
void failure();
|
||||
|
||||
private:
|
||||
using RequestFunctionContainer = QPair<std::function<int64_t()>, std::function<void(const Core::FunctionReply&)>>;
|
||||
using RequestFunctionContainer = QPair<std::function<int64_t()>, std::function<void(const FunctionReplyType&)>>;
|
||||
|
||||
QVector<RequestFunctionContainer> m_requestFunctions;
|
||||
bool m_failed;
|
||||
int m_repliedId;
|
||||
std::function<void(const Core::FunctionReply&)> m_singleRequestCustomFunctionReply;
|
||||
std::function<void(const FunctionReplyType&)> m_singleRequestCustomFunctionReply;
|
||||
bool m_quiet;
|
||||
bool m_blockingCall;
|
||||
std::function<void(void)> m_successFn;
|
||||
@@ -109,7 +104,7 @@ class LTSUTILSGUIDDS_INTERNAL_EXPORT RequestHelper : public QObject
|
||||
QString m_customWaitMessage;
|
||||
|
||||
void done();
|
||||
bool _requestReply(const Core::FunctionReplyObject& fro, const Core::FunctionReply* baseReply);
|
||||
bool _requestReply(const Core::FunctionReplyObject& fro, const FunctionReplyType* baseReply);
|
||||
|
||||
signals:
|
||||
void signalNextRequest();
|
||||
|
||||
Reference in new issue
Block a user