blob: ab1a96206e582b4e5c1d89dbbbb498275e5c565d [file] [log] [blame]
Brandon Wyman3f1242f2020-01-28 13:11:25 -06001#pragma once
2
3#include "types.hpp"
4
5#include <sdbusplus/bus/match.hpp>
6
7namespace phosphor::power::psu
8{
9
10/**
11 * @class UtilBase
12 * A base class to allow for mocking certain utility functions.
13 */
14class 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
23const UtilBase& getUtils();
24
25inline bool getPresence(sdbusplus::bus::bus& bus, const std::string& invpath)
26{
27 return getUtils().getPresence(bus, invpath);
28}
29
30} // namespace phosphor::power::psu