blob: 6089fde3ca38e5980780fb40efb754248449037f [file] [log] [blame]
#ifndef PRODUCTION_SUSHID_SAFEPOWER_AGENT_BMC_DAEMON_CONTEXT_BMC_H_
#define PRODUCTION_SUSHID_SAFEPOWER_AGENT_BMC_DAEMON_CONTEXT_BMC_H_
#include <cstdint>
#include "bmc/persistent_storage_bmc.h"
#include "bmc/scheduler_bmc.h"
#include "daemon_context.h"
#include "persistent_storage.h"
#include "scheduler_interface.h"
#include "boost/asio/io_context.hpp" // NOLINT(readability/boost)
namespace safepower_agent {
using boost::asio::io_context;
class DaemonContextBMC : public DaemonContext {
public:
DaemonContextBMC();
SchedulerInterface& scheduler() override;
PersistentStorageManager& persistent_storage_manager() override;
uint64_t epoch_ms() override;
io_context& get_io_context();
DaemonContextBMC(DaemonContextBMC&& other) = delete;
DaemonContextBMC& operator=(DaemonContextBMC&& other) = delete;
// There is only one context so getter is static to enforce
static DaemonContextBMC& Get();
private:
io_context io_context_;
SchedulerBMC scheduler_;
persistent_storage::PersistentStorageManagerBMC persistent_storage_manager_;
uint64_t epoch_ms_;
};
} // namespace safepower_agent
#endif // PRODUCTION_SUSHID_SAFEPOWER_AGENT_BMC_DAEMON_CONTEXT_BMC_H_