1*6473c071SMatthew Barth /**
2*6473c071SMatthew Barth  * Copyright © 2021 IBM Corporation
3*6473c071SMatthew Barth  *
4*6473c071SMatthew Barth  * Licensed under the Apache License, Version 2.0 (the "License");
5*6473c071SMatthew Barth  * you may not use this file except in compliance with the License.
6*6473c071SMatthew Barth  * You may obtain a copy of the License at
7*6473c071SMatthew Barth  *
8*6473c071SMatthew Barth  *     http://www.apache.org/licenses/LICENSE-2.0
9*6473c071SMatthew Barth  *
10*6473c071SMatthew Barth  * Unless required by applicable law or agreed to in writing, software
11*6473c071SMatthew Barth  * distributed under the License is distributed on an "AS IS" BASIS,
12*6473c071SMatthew Barth  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13*6473c071SMatthew Barth  * See the License for the specific language governing permissions and
14*6473c071SMatthew Barth  * limitations under the License.
15*6473c071SMatthew Barth  */
16*6473c071SMatthew Barth #pragma once
17*6473c071SMatthew Barth 
18*6473c071SMatthew Barth #include <sdeventplus/event.hpp>
19*6473c071SMatthew Barth 
20*6473c071SMatthew Barth namespace phosphor::fan::util
21*6473c071SMatthew Barth {
22*6473c071SMatthew Barth 
23*6473c071SMatthew Barth /** @class SDEventPlus
24*6473c071SMatthew Barth  *  @brief Event access delegate implementation for sdeventplus.
25*6473c071SMatthew Barth  */
26*6473c071SMatthew Barth class SDEventPlus
27*6473c071SMatthew Barth {
28*6473c071SMatthew Barth   public:
29*6473c071SMatthew Barth     /**
30*6473c071SMatthew Barth      * @brief Get the event instance
31*6473c071SMatthew Barth      */
getEvent()32*6473c071SMatthew Barth     static auto& getEvent() __attribute__((pure))
33*6473c071SMatthew Barth     {
34*6473c071SMatthew Barth         static auto event = sdeventplus::Event::get_default();
35*6473c071SMatthew Barth         return event;
36*6473c071SMatthew Barth     }
37*6473c071SMatthew Barth };
38*6473c071SMatthew Barth 
39*6473c071SMatthew Barth } // namespace phosphor::fan::util
40