xref: /openbmc/phosphor-led-manager/manager/grouplayout.hpp (revision 7ba70c820ed1ff5c19ea2af337ecad82732f383d)
1*7ba70c82SAlexander Hansen #pragma once
2*7ba70c82SAlexander Hansen 
3*7ba70c82SAlexander Hansen #include "ledlayout.hpp"
4*7ba70c82SAlexander Hansen 
5*7ba70c82SAlexander Hansen #include <string>
6*7ba70c82SAlexander Hansen #include <unordered_map>
7*7ba70c82SAlexander Hansen 
8*7ba70c82SAlexander Hansen namespace phosphor
9*7ba70c82SAlexander Hansen {
10*7ba70c82SAlexander Hansen namespace led
11*7ba70c82SAlexander Hansen {
12*7ba70c82SAlexander Hansen /** @namespace Layout
13*7ba70c82SAlexander Hansen  *  @brief Depicts the LED and their mappings and group actions
14*7ba70c82SAlexander Hansen  */
15*7ba70c82SAlexander Hansen namespace Layout
16*7ba70c82SAlexander Hansen {
17*7ba70c82SAlexander Hansen 
18*7ba70c82SAlexander Hansen /** @brief Name of the Group and its properties
19*7ba70c82SAlexander Hansen  */
20*7ba70c82SAlexander Hansen struct GroupLayout
21*7ba70c82SAlexander Hansen {
22*7ba70c82SAlexander Hansen     int priority = 0;
23*7ba70c82SAlexander Hansen     ActionSet actionSet;
24*7ba70c82SAlexander Hansen };
25*7ba70c82SAlexander Hansen 
26*7ba70c82SAlexander Hansen struct CompareGroupLayout
27*7ba70c82SAlexander Hansen {
operator ()phosphor::led::Layout::CompareGroupLayout28*7ba70c82SAlexander Hansen     bool operator()(const Layout::GroupLayout* lhs,
29*7ba70c82SAlexander Hansen                     const Layout::GroupLayout* rhs) const
30*7ba70c82SAlexander Hansen     {
31*7ba70c82SAlexander Hansen         return lhs->priority < rhs->priority;
32*7ba70c82SAlexander Hansen     };
33*7ba70c82SAlexander Hansen };
34*7ba70c82SAlexander Hansen 
35*7ba70c82SAlexander Hansen } // namespace Layout
36*7ba70c82SAlexander Hansen 
37*7ba70c82SAlexander Hansen using GroupMap = std::unordered_map<std::string, Layout::GroupLayout>;
38*7ba70c82SAlexander Hansen 
39*7ba70c82SAlexander Hansen } // namespace led
40*7ba70c82SAlexander Hansen } // namespace phosphor
41