Files
qt5-legatus-legacy/Lts/Services/OcBaseDownload/WebSocketInterface/data_manager.h
T
2026-08-13 18:33:10 +02:00

81 lines
2.0 KiB
C++
Executable File

/**
* @RDE_HEADER@
* The DataManager class is a convenience class for managing structure data
* $Id$
* $HeadURL$
* $Author$
* Created by Philipp Dassow, SLST, 2017-12-05
*/
#pragma once
#include "WebSocketInterface/Messages/client_message.h"
#include "main_handler.h"
#include "logger.h"
#include "enums.h"
namespace OcBaseDownload
{
namespace WebSocketInterface
{
/**
* @brief The DataManager class is a convenience class for managing structure data
*/
class DataManager final
{
public:
/**
* @brief DataManager Constructor
* @param mainHandler Source for needed handlers
*/
explicit DataManager(MainHandler *mainHandler);
/**
* @brief handleErrorMessage
* @param errData
*/
void handleErrorMessage(const Messages::ErrorMessage::ErrorData &errData);
/**
* @brief servicePortsInformation processing new port informations, only called during base DL
* @param exerciseInformation
*/
void servicePortsInformation(const QVector<Messages::ServicePortsInformation::ExerciseInformation> &exerciseInformation);
// handling asm base data
template <typename T>
void baseData(std::vector<T> &&data)
{
Q_UNUSED(data)
DEBUG_LOG(m_logger) << "Got new base data.";
//m_mainHandler->handlerBaseDownload()->handleBaseData(std::move(data));
}
/**
* @brief handlePdfListMessage
* @param pdfListData a list of PDF document names
*/
void handlePdfListMessage(const Messages::PdfListMessage::PdfListData &pdfListData);
/**
* @brief setCurrentDownload sets the current download
* @param currentDownload The new value
*/
void setCurrentDownload(CurrentDownload currentDownload);
/**
* @brief Getter for current download
* @return Value of the current download
*/
CurrentDownload currentDownload() const;
private: // attributes
MainHandler *m_mainHandler;
CurrentDownload m_currentDownload;
LOGGER_T m_logger;
}; // class DataManager
} // namespace WebSocketInterface
} // namespace OcBaseDownload