62 lines
2.3 KiB
C++
Executable File
62 lines
2.3 KiB
C++
Executable File
/**
|
|
* The TemplateHandler class manages all template related function topics and holds classes for
|
|
* further tempalte data.
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
* Created by Hannes Baeuerle, SLSE, 2016-07-27
|
|
*/
|
|
#pragma once
|
|
|
|
#include <QtCore/QMutex>
|
|
#include <QtCore/QHash>
|
|
|
|
#include "dds_handler.h"
|
|
#include "logger.h"
|
|
|
|
namespace ParticipantManagement
|
|
{
|
|
class MainHandler;
|
|
|
|
namespace TemplateHandling
|
|
{
|
|
class Template;
|
|
class TemplateHandler final
|
|
: protected Interface::Fts::ModifyTemplateDataRequestHandler
|
|
{
|
|
public:
|
|
explicit TemplateHandler(MainHandler *mainHandler);
|
|
~TemplateHandler();
|
|
bool init();
|
|
|
|
void onModifyTemplateDataRequest(const rti::core::SampleIdentity &cookie,
|
|
const ModifyTemplateDataRequest &request) override;
|
|
|
|
private: // methods
|
|
Core::FunctionReplyObject modifyTemplateDataRequest(const ParticipantManagement::ModifyTemplateDataRequest &request);
|
|
std::vector<int32_t> inferiorIdsForTemplate(int32_t superiorTemplateId) const;
|
|
|
|
Core::FunctionReplyObject createNewTemplate(const TemplateData ¤tData,
|
|
QHash<int32_t, int32_t> &modIdToTemplateId,
|
|
QVector<Template *> &templatesWithChanges);
|
|
Core::FunctionReplyObject validateTemplateData(const QVector<ParticipantManagement::TemplateData> &dataVec,
|
|
QHash<int32_t, int32_t> &modIdToTemplateId,
|
|
const ParticipantManagement::TemplateData &templateToValidate);
|
|
|
|
Core::FunctionReplyObject validateTemplateData(const QVector<ParticipantManagement::TemplateData> &dataVec,
|
|
QHash<int32_t, int32_t> &modIdToTemplateId,
|
|
int startIndex,
|
|
int range);
|
|
|
|
Core::FunctionReplyObject deleteTemplateById(int32_t templateId, bool isTriggeredFromFtRequest = false);
|
|
|
|
private: // attributes
|
|
MainHandler *m_mainHandler;
|
|
QHash<int32_t, Template *> m_templates; // <templateId, Template>
|
|
QMutex m_mutex;
|
|
LOGGER_T m_logger;
|
|
|
|
}; // class TemplateHandler
|
|
} // namespace TemplateHandling
|
|
} // namespace ParticipantManagement
|