blob: 79097517dcf78a3adedf87b87bc3a730fa3e0f2f [file] [log] [blame]
#include "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 "absl/time/time.h"
#include "boost/asio/io_context.hpp" // NOLINT(readability/boost)
namespace safepower_agent {
using boost::asio::io_context;
DaemonContextBMC::DaemonContextBMC()
: io_context_(1), // concurrency_hint 1
scheduler_(io_context_),
persistent_storage_manager_() {
epoch_ms_ = absl::ToUnixMillis(now());
}
DaemonContextBMC& DaemonContextBMC::Get() {
return static_cast<DaemonContextBMC&>(DaemonContext::Get());
}
SchedulerInterface& DaemonContextBMC::scheduler() { return scheduler_; }
PersistentStorageManager& DaemonContextBMC::persistent_storage_manager() {
return persistent_storage_manager_;
}
io_context& DaemonContextBMC::get_io_context() { return io_context_; }
uint64_t DaemonContextBMC::epoch_ms() { return epoch_ms_; }
} // namespace safepower_agent