Matthew Barth | 0620be7 | 2021-04-14 13:31:12 -0500 | [diff] [blame] | 1 | /** |
| 2 | * Copyright © 2021 IBM Corporation |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | #pragma once |
| 17 | |
Matthew Barth | e8441c6 | 2021-05-13 16:50:56 -0500 | [diff] [blame] | 18 | #include "init.hpp" |
Matthew Barth | baeeb8f | 2021-05-13 16:03:54 -0500 | [diff] [blame] | 19 | #include "signal.hpp" |
Matthew Barth | 93341e0 | 2021-04-14 13:56:28 -0500 | [diff] [blame] | 20 | #include "timer.hpp" |
Matthew Barth | 54b5a24 | 2021-05-21 11:02:52 -0500 | [diff] [blame] | 21 | #include "trigger_aliases.hpp" |
Matthew Barth | 0620be7 | 2021-04-14 13:31:12 -0500 | [diff] [blame] | 22 | |
Matthew Barth | 0620be7 | 2021-04-14 13:31:12 -0500 | [diff] [blame] | 23 | #include <map> |
Matthew Barth | 0620be7 | 2021-04-14 13:31:12 -0500 | [diff] [blame] | 24 | |
| 25 | namespace phosphor::fan::control::json::trigger |
| 26 | { |
| 27 | |
Matthew Barth | 0620be7 | 2021-04-14 13:31:12 -0500 | [diff] [blame] | 28 | // Mapping of trigger class name to its creation function |
Matthew Barth | 93341e0 | 2021-04-14 13:56:28 -0500 | [diff] [blame] | 29 | static const std::map<std::string, createTrigger> triggers = { |
Matthew Barth | e8441c6 | 2021-05-13 16:50:56 -0500 | [diff] [blame] | 30 | {"timer", timer::triggerTimer}, |
| 31 | {"signal", signal::triggerSignal}, |
Matt Spinler | d1f97f4 | 2021-10-29 16:19:24 -0500 | [diff] [blame^] | 32 | {"init", init::triggerInit}, |
| 33 | {"poweron", init::triggerInit}, |
| 34 | {"poweroff", init::triggerInit}}; |
Matthew Barth | 0620be7 | 2021-04-14 13:31:12 -0500 | [diff] [blame] | 35 | |
| 36 | } // namespace phosphor::fan::control::json::trigger |