/** * @RDE_HEADER@ * SetRtProfileBase * $Id$ * $HeadURL$ * $Author$ * Created by Christian Fröbel, NLE, 2018-12-17 */ #include "set_rt_profile_base.h" #include #include namespace AudioVideoManagement { namespace AvaCommands { SetRtProfileBase::SetRtProfileBase(IAvaComm *comm) : m_comm(comm) , m_collector(comm, [this] (QVector &&invalidNames) { onInvalidNameListReceived(std::move(invalidNames)); }) { Q_ASSERT(comm); } void SetRtProfileBase::connectToComm() { connect(m_comm, &IAvaComm::ok, this, &SetRtProfileBase::onOk); m_collector.start(); } void SetRtProfileBase::disconnectFromComm() { m_comm->disconnect(this); } void SetRtProfileBase::sendCommand(const QString &cmd) { m_comm->sendPreparedCommand(cmd); } bool SetRtProfileBase::nullifies(ICommand *other) const { Q_ASSERT(other); SetRtProfileBase *other_ = dynamic_cast(other); if (!other_) return false; return true; } void SetRtProfileBase::onOk() { Q_ASSERT(!m_ok); m_ok = true; } void SetRtProfileBase::onInvalidNameListReceived(QVector &&invalidNames) { Q_ASSERT(m_ok); Q_ASSERT(!m_invalidNames); m_invalidNames = std::move(invalidNames); done(); } }} // namespace AudioVideoManagement::AvaCommands