xref: /openbmc/phosphor-fan-presence/presence/get_power_state.cpp (revision 76e73c2a48aa4d70c6fbd306e59c133968fce37f)
1*76e73c2aSMatt Spinler #include "power_state.hpp"
2*76e73c2aSMatt Spinler 
3*76e73c2aSMatt Spinler namespace phosphor::fan
4*76e73c2aSMatt Spinler {
5*76e73c2aSMatt Spinler 
6*76e73c2aSMatt Spinler std::shared_ptr<PowerState> powerState;
7*76e73c2aSMatt Spinler 
getPowerStateObject()8*76e73c2aSMatt Spinler std::shared_ptr<PowerState> getPowerStateObject()
9*76e73c2aSMatt Spinler {
10*76e73c2aSMatt Spinler     if (!powerState)
11*76e73c2aSMatt Spinler     {
12*76e73c2aSMatt Spinler         powerState = std::make_shared<PGoodState>();
13*76e73c2aSMatt Spinler     }
14*76e73c2aSMatt Spinler     return powerState;
15*76e73c2aSMatt Spinler }
16*76e73c2aSMatt Spinler 
17*76e73c2aSMatt Spinler } // namespace phosphor::fan
18