Files
qt-migration-legatus/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/asset.cpp
T
berrux-dev 40f767fc4d Migrates AudioVideoManagement to generated rtiddsgen API
Converts accessor calls to plain member access across avm service and plugin.
2026-09-21 02:45:51 +02:00

60 lines
1.1 KiB
C++
Executable File

/**
* @RDE_HEADER@
* Asset
* $Id$
* $HeadURL$
* $Author$
* Created by Christian Fröbel, SLSE, 2017-11-30
*/
#include "asset.h"
#include "mounting_point.h"
#include <InfrastructureManagement/ism.hpp>
#include <QtGlobal>
namespace AudioVideoManagement
{
Asset::Asset(const InfrastructureManagement::InstrumentationAsset &asset)
: m_data(new InfrastructureManagement::InstrumentationAsset(asset))
{
Q_ASSERT(asset.id > 0);
}
Asset::~Asset() = default;
void Asset::update(const InfrastructureManagement::InstrumentationAsset &data)
{
if (*m_data == data)
return;
*m_data = data;
emit changed(this);
}
MountingPoint *Asset::mountingPoint() const
{
Q_ASSERT(isMounted());
return m_mountingPoint;
}
void Asset::mount(MountingPoint *mountingPoint)
{
Q_ASSERT(!m_mountingPoint);
Q_ASSERT(mountingPoint);
m_mountingPoint = mountingPoint;
if (m_mountingPoint)
m_mountingPoint->mount2(this);
}
void Asset::unmount()
{
Q_ASSERT(m_mountingPoint);
if (m_mountingPoint)
m_mountingPoint->unmount2(this);
m_mountingPoint = nullptr;
}
} // namespace AudioVideoManagement