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

64 lines
1.3 KiB
C++
Executable File

/**
* @RDE_HEADER@
* Asset
* $Id$
* $HeadURL$
* $Author$
* Created by Christian Fröbel, SLSE, 2017-11-30
*/
#pragma once
#include "avm_export.h"
#include <QObject>
#include <memory>
namespace InfrastructureManagement
{
class InstrumentationAsset;
} // namespace InfrastructureManagement
namespace AudioVideoManagement
{
class MountingPoint;
/**
* Part of the data model used by the AssetAssignmentManager.
* @author Christian Fröbel
*/
class AVM_COMMON_EXPORT Asset : public QObject
{
Q_OBJECT
public:
explicit Asset(const InfrastructureManagement::InstrumentationAsset &asset);
~Asset();
const InfrastructureManagement::InstrumentationAsset &data() const { return *m_data; }
/** Emits the changed() signal. */
void update(const InfrastructureManagement::InstrumentationAsset &data);
bool isMounted() const { return m_mountingPoint != nullptr; }
/** May only be called when mounted. */
MountingPoint *mountingPoint() const;
void mount(MountingPoint *mountingPoint);
void unmount();
signals:
void changed(Asset *asset);
private:
std::unique_ptr<InfrastructureManagement::InstrumentationAsset> m_data;
MountingPoint *m_mountingPoint{nullptr}; // null if not mounted
};
} // namespace AudioVideoManagement