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

60 lines
2.1 KiB
C++
Executable File

/**
* @RDE_HEADER@
* ISM Handler Mounting Point Assets
* $Id$
* $HeadURL$
* $Author$
* Created by Iuliana Ojog, SLSE, 2016-11-26
*/
#pragma once
#include <QHash>
#include "base.h"
//-------------------------------------------------------------------------------------------------------------
namespace InfrastructureManagement
{
class ObjectMountingPointAsset;
class MainHandler;
class HandlerMountingPointAsset final : public Base
, protected Interface::Fts::MountingPointAssetModifyRequestHandler
, protected Interface::Fts::MountingPointAssetRemoveRequestHandler
{
public:
explicit HandlerMountingPointAsset(MainHandler *mainHandler);
~HandlerMountingPointAsset();
bool init();
int getMountingPointAssetId(int assetId, int structureElementId) const;
bool mount(int32_t assetId, int32_t mountingPointId, const std::string &name = {});
bool unmountAsset(int32_t assetId);
bool unmountMountingPoint(int32_t mountingPointId);
int32_t getMountedAssetId(int32_t mountingPointId) const;
int32_t getMountedStructureElementId(int32_t assetId) const;
QHash<int, ObjectMountingPointAsset *> getMountingPointAssetMap() const { return m_objectMountingPointAssetMap;}
void setAvailableInExerciseForAssetOnMountingPoint(int32_t mountingPointId, const std::vector<int32_t> &exercises);
private:
void onMountingPointAssetModifyRequest(const rti::core::SampleIdentity &cookie,
const MountingPointAssetModifyRequest &request) override;
Core::FunctionReplyObject mountingPointAssetCreate(const MountingPointAssetModifyRequest &request);
Core::FunctionReplyObject mountingPointAssetModify(const MountingPointAssetModifyRequest &request);
void onMountingPointAssetRemoveRequest(const rti::core::SampleIdentity &cookie,
const Core::RemoveElementRequest &request) override;
bool unmount(ObjectMountingPointAsset *object);
bool syncAvailableInExercise(int32_t structureElementId, int32_t assetId) const;
private:
QHash<int, ObjectMountingPointAsset *> m_objectMountingPointAssetMap;
};
}