#ifndef BOSS_MOD_STATUSCOMMAND_HPP #define BOSS_MOD_STATUSCOMMAND_HPP #include"Json/Out.hpp" #include"Ln/CommandId.hpp" #include #include namespace Boss { namespace Msg { struct CommandRequest; }} namespace Boss { namespace Msg { struct Manifestation; }} namespace Boss { namespace Msg { struct ProvideStatus; }} namespace Ev { template class Io; } namespace S { class Bus; } namespace Boss { namespace Mod { /** class Boss::Mod::StatusCommand * * @brief implements the `clboss-status` command, * soliciting status reports from other modules * and then providing them to the user. */ class StatusCommand { private: S::Bus& bus; Ln::CommandId id; bool soliciting; std::map fields; void start(); Ev::Io on_manifest(Boss::Msg::Manifestation const& m); Ev::Io on_command(Boss::Msg::CommandRequest const& c); Ev::Io on_status(Boss::Msg::ProvideStatus const& s); public: StatusCommand() =delete; StatusCommand(StatusCommand const&) =delete; StatusCommand(StatusCommand&&) =delete; explicit StatusCommand( S::Bus& bus_ ) : bus(bus_) , id() , soliciting(false) , fields() { start(); } }; }} #endif /* !defined(BOSS_MOD_STATUSCOMMAND_HPP) */