blob: c8847c4f46707230b6add5af0a8d28aacce7b38e [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"
Matthew Barthbaeeb8f2021-05-13 16:03:54 -050019#include "signal.hpp"
Matthew Barth93341e02021-04-14 13:56:28 -050020#include "timer.hpp"
Matthew Barth54b5a242021-05-21 11:02:52 -050021#include "trigger_aliases.hpp"
Matthew Barth0620be72021-04-14 13:31:12 -050022
Matthew Barth0620be72021-04-14 13:31:12 -050023#include <map>
Matthew Barth0620be72021-04-14 13:31:12 -050024
25namespace phosphor::fan::control::json::trigger
26{
27
Matthew Barth0620be72021-04-14 13:31:12 -050028// Mapping of trigger class name to its creation function
Matthew Barth93341e02021-04-14 13:56:28 -050029static const std::map<std::string, createTrigger> triggers = {
Matthew Barthe8441c62021-05-13 16:50:56 -050030 {"timer", timer::triggerTimer},
31 {"signal", signal::triggerSignal},
Matt Spinlerd1f97f42021-10-29 16:19:24 -050032 {"init", init::triggerInit},
33 {"poweron", init::triggerInit},
34 {"poweroff", init::triggerInit}};
Matthew Barth0620be72021-04-14 13:31:12 -050035
36} // namespace phosphor::fan::control::json::trigger