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
+74
-73
@@ -1,6 +1,5 @@
|
||||
|
||||
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef REQUEST_HELPER_WITH_GUI
|
||||
@@ -12,112 +11,114 @@
|
||||
#endif
|
||||
|
||||
#include <Core/core_types.h>
|
||||
#include <DDS/Core/core.hpp>
|
||||
|
||||
#include <DDS/Core/core.hpp>
|
||||
#include <QObject>
|
||||
#include <QVector>
|
||||
#include <QPair>
|
||||
#include <QVector>
|
||||
#include <functional>
|
||||
|
||||
|
||||
namespace LtsUtils
|
||||
{
|
||||
|
||||
template<typename T>
|
||||
dds::core::optional<T> toOptional(T inVal)
|
||||
template <typename T> dds::core::optional<T> toOptional(T inVal)
|
||||
{
|
||||
return inVal != T() ? dds::core::optional<T>(inVal) : dds::core::optional<T>();
|
||||
return inVal != T() ? dds::core::optional<T>(inVal) : dds::core::optional<T>();
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
dds::core::optional<T> optional()
|
||||
template <typename T> dds::core::optional<T> optional()
|
||||
{
|
||||
return dds::core::optional<T>();
|
||||
return dds::core::optional<T>();
|
||||
}
|
||||
|
||||
|
||||
class LTSUTILSGUIDDS_INTERNAL_EXPORT RequestHelper : public QObject
|
||||
class LTSUTILSGUIDDS_INTERNAL_EXPORT RequestHelper : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
static bool s_debug;
|
||||
public:
|
||||
static bool s_debug;
|
||||
|
||||
explicit RequestHelper(QObject *parent = nullptr, bool quiet = false,
|
||||
|
||||
const std::function<void (void)> &success = [](){},
|
||||
const std::function<void (void)> &failure = [](){});
|
||||
~RequestHelper() = default;
|
||||
explicit RequestHelper(
|
||||
QObject* parent = nullptr, bool quiet = false,
|
||||
|
||||
bool quiet() const { return m_quiet; }
|
||||
void setQuiet(bool quiet) { m_quiet = quiet; }
|
||||
void addRequest(const std::function<int64_t()> &requestFunction,
|
||||
const std::function<void(const Core::FunctionReply &baseReply)> &baseReplyHandler = nullptr);
|
||||
bool startRequests();
|
||||
const std::function<void(void)>& success = []() {}, const std::function<void(void)>& failure = []() {});
|
||||
~RequestHelper() = default;
|
||||
|
||||
|
||||
bool startSingleRequest(const std::function<int64_t(void)> &requestFunction,
|
||||
const std::function<void(const Core::FunctionReply &baseReply)> &baseReplyHandler = nullptr
|
||||
);
|
||||
bool quiet() const
|
||||
{
|
||||
return m_quiet;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void setQuiet(bool quiet)
|
||||
{
|
||||
m_quiet = quiet;
|
||||
}
|
||||
|
||||
void startSingleBackgroundRequest(const std::function<int64_t()> &requestFunction,
|
||||
const std::function<void(const Core::FunctionReply &baseReply)> &baseReplyHandler = nullptr);
|
||||
|
||||
void addRequest(const std::function<int64_t()>& requestFunction,
|
||||
const std::function<void(const Core::FunctionReply& baseReply)>& baseReplyHandler = nullptr);
|
||||
bool startRequests();
|
||||
|
||||
void startBackgroundRequests();
|
||||
bool
|
||||
startSingleRequest(const std::function<int64_t(void)>& requestFunction,
|
||||
const std::function<void(const Core::FunctionReply& baseReply)>& baseReplyHandler = nullptr);
|
||||
|
||||
bool requestReply(const Core::FunctionReply &baseReply);
|
||||
bool requestReply(const Core::FunctionReplyObject &replyObject);
|
||||
void startSingleBackgroundRequest(
|
||||
const std::function<int64_t()>& requestFunction,
|
||||
const std::function<void(const Core::FunctionReply& baseReply)>& baseReplyHandler = nullptr);
|
||||
|
||||
|
||||
void startBackgroundRequests();
|
||||
|
||||
bool hasRequests() const { return !m_requestFunctions.isEmpty(); }
|
||||
bool requestReply(const Core::FunctionReply& baseReply);
|
||||
bool requestReply(const Core::FunctionReplyObject& replyObject);
|
||||
|
||||
bool hasRequests() const
|
||||
{
|
||||
return !m_requestFunctions.isEmpty();
|
||||
}
|
||||
|
||||
|
||||
int getRepliedId() const
|
||||
{
|
||||
return m_repliedId;
|
||||
}
|
||||
|
||||
int getRepliedId() const { return m_repliedId; }
|
||||
QString getErrorString() const
|
||||
{
|
||||
return m_errorString;
|
||||
}
|
||||
|
||||
|
||||
void setCustomWaitMessage(const QString& customWaitMessage);
|
||||
|
||||
QString getErrorString() const { return m_errorString; }
|
||||
bool failed() const
|
||||
{
|
||||
return m_failed;
|
||||
}
|
||||
|
||||
|
||||
void failure();
|
||||
|
||||
void setCustomWaitMessage(const QString &customWaitMessage);
|
||||
private:
|
||||
using RequestFunctionContainer = QPair<std::function<int64_t()>, std::function<void(const Core::FunctionReply&)>>;
|
||||
|
||||
bool failed() const { return m_failed; }
|
||||
void failure();
|
||||
QVector<RequestFunctionContainer> m_requestFunctions;
|
||||
bool m_failed;
|
||||
int m_repliedId;
|
||||
std::function<void(const Core::FunctionReply&)> m_singleRequestCustomFunctionReply;
|
||||
bool m_quiet;
|
||||
bool m_blockingCall;
|
||||
std::function<void(void)> m_successFn;
|
||||
std::function<void(void)> m_failureFn;
|
||||
QString m_errorString;
|
||||
QString m_customWaitMessage;
|
||||
|
||||
private:
|
||||
using RequestFunctionContainer = QPair<std::function<int64_t()>, std::function<void(const Core::FunctionReply &)>>;
|
||||
void done();
|
||||
bool _requestReply(const Core::FunctionReplyObject& fro, const Core::FunctionReply* baseReply);
|
||||
|
||||
QVector<RequestFunctionContainer> m_requestFunctions;
|
||||
bool m_failed;
|
||||
int m_repliedId;
|
||||
std::function<void(const Core::FunctionReply &)> m_singleRequestCustomFunctionReply;
|
||||
bool m_quiet;
|
||||
bool m_blockingCall;
|
||||
std::function<void (void)> m_successFn;
|
||||
std::function<void (void)> m_failureFn;
|
||||
QString m_errorString;
|
||||
QString m_customWaitMessage;
|
||||
|
||||
void done();
|
||||
bool _requestReply(const Core::FunctionReplyObject &fro, const Core::FunctionReply *baseReply);
|
||||
|
||||
signals:
|
||||
void signalNextRequest();
|
||||
void signalQuitLoop();
|
||||
void signalSuccess();
|
||||
void signalFailed();
|
||||
|
||||
private slots:
|
||||
void slotNextRequest();
|
||||
signals:
|
||||
void signalNextRequest();
|
||||
void signalQuitLoop();
|
||||
void signalSuccess();
|
||||
void signalFailed();
|
||||
|
||||
private slots:
|
||||
void slotNextRequest();
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace LtsUtils
|
||||
Reference in new issue
Block a user