1 #pragma once
2 
3 #include "types.hpp"
4 
5 #include <sdbusplus/bus/match.hpp>
6 
7 namespace phosphor::power::psu
8 {
9 
10 /**
11  * @class UtilBase
12  * A base class to allow for mocking certain utility functions.
13  */
14 class UtilBase
15 {
16   public:
17     virtual ~UtilBase() = default;
18 
19     virtual bool getPresence(sdbusplus::bus::bus& bus,
20                              const std::string& invpath) const = 0;
21 };
22 
23 const UtilBase& getUtils();
24 
25 inline bool getPresence(sdbusplus::bus::bus& bus, const std::string& invpath)
26 {
27     return getUtils().getPresence(bus, invpath);
28 }
29 
30 } // namespace phosphor::power::psu
31