1
0
Files
BasaltMeter/BasaltPresenter/Shared/basalt/deliver.cpp
2026-01-09 16:40:30 +08:00

34 lines
969 B
C++

#include "deliver.hpp"
#include <stdexcept>
namespace basalt::shared::deliver {
IDeliver::IDeliver() : status(DeliverStatus::Ready) {}
IDeliver::~IDeliver() {
if (this->status != DeliverStatus::Stop) {
this->shutdown();
}
}
guid::Guid IDeliver::get_guid() const {
throw std::logic_error("unimplemented function");
}
void IDeliver::startup(DeliverConfig &&config) {
if (this->status != DeliverStatus::Ready) throw std::runtime_error("unexpected deliver status");
this->config = std::move(config);
this->status = DeliverStatus::Running;
}
void IDeliver::transmit() {
if (this->status != DeliverStatus::Running) throw std::runtime_error("unexpected deliver status");
}
void IDeliver::shutdown() {
if (this->status != DeliverStatus::Running) throw std::runtime_error("unexpected deliver status");
this->status = DeliverStatus::Stop;
}
}