summaryrefslogtreecommitdiffstats
path: root/hwmon.cpp
blob: bfb67aa14b53ecedf5d09a80786d0a6e24c5f5dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include "hwmon.hpp"

namespace hwmon
{

bool getAttributes(const std::string& type, Attributes& attributes)
{
    // clang-format off
    auto a =
        std::find_if(
            typeAttrMap.begin(),
            typeAttrMap.end(),
            [&](const auto& e)
            {
                return type == getHwmonType(e);
            });
    // clang-format on

    if (a == typeAttrMap.end())
    {
        return false;
    }

    attributes = *a;
    return true;
}

} //  namespace hwmon
OpenPOWER on IntegriCloud