blob: b462a015743430b19936fd5ce7c2f744b4af1afd [file] [log] [blame]
Matthew Barth0620be72021-04-14 13:31:12 -05001/**
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 Barthe8441c62021-05-13 16:50:56 -050018#include "init.hpp"
Matt Spinlerd0ba86a2021-11-09 10:09:13 -060019#include "parameter.hpp"
Matthew Barthbaeeb8f2021-05-13 16:03:54 -050020#include "signal.hpp"
Matthew Barth93341e02021-04-14 13:56:28 -050021#include "timer.hpp"
Matthew Barth54b5a242021-05-21 11:02:52 -050022#include "trigger_aliases.hpp"
Matthew Barth0620be72021-04-14 13:31:12 -050023
Matthew Barth0620be72021-04-14 13:31:12 -050024#include <map>
Matthew Barth0620be72021-04-14 13:31:12 -050025
26namespace phosphor::fan::control::json::trigger
27{
28
Matthew Barth0620be72021-04-14 13:31:12 -050029// Mapping of trigger class name to its creation function
Matthew Barth93341e02021-04-14 13:56:28 -050030static const std::map<std::string, createTrigger> triggers = {
Matthew Barthe8441c62021-05-13 16:50:56 -050031 {"timer", timer::triggerTimer},
32 {"signal", signal::triggerSignal},
Matt Spinlerd1f97f42021-10-29 16:19:24 -050033 {"init", init::triggerInit},
34 {"poweron", init::triggerInit},
Matt Spinlerd0ba86a2021-11-09 10:09:13 -060035 {"poweroff", init::triggerInit},
36 {"parameter", parameter::triggerParameter}};
Matthew Barth0620be72021-04-14 13:31:12 -050037
38} // namespace phosphor::fan::control::json::trigger