Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
Executable
+59
@@ -0,0 +1,59 @@
|
||||
/**
|
||||
* @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
|
||||
|
||||
Reference in new issue
Block a user