#include "deliver.hpp" #include namespace basalt::shared::deliver { IDeliver::IDeliver() {} 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; } }