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