diff options
author | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2017-06-15 10:39:38 -0400 |
---|---|---|
committer | Patrick Williams <patrick@stwcx.xyz> | 2017-08-02 20:18:18 +0000 |
commit | 423943270b5c0b7f2ab2ccda009d9f8be45f9f30 (patch) | |
tree | 3804885c4b67ff367de7b3718a0a726723489b13 | |
parent | a51f8fe0747374fe13c3ac0ab09d3e5b612ed194 (diff) | |
download | phosphor-fan-presence-423943270b5c0b7f2ab2ccda009d9f8be45f9f30.tar.gz phosphor-fan-presence-423943270b5c0b7f2ab2ccda009d9f8be45f9f30.zip |
Add sdevent singleton
Avoid sdevent::event::Event reference proliferation.
Change-Id: I5c3de11e902cd9e61fdaca8f06c73d329bf4d293
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
-rw-r--r-- | sdevent.hpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/sdevent.hpp b/sdevent.hpp new file mode 100644 index 0000000..ba40435 --- /dev/null +++ b/sdevent.hpp @@ -0,0 +1,27 @@ +#pragma once + +#include "sdevent/event.hpp" + +namespace phosphor +{ +namespace fan +{ +namespace util +{ +/** @class SDEvent + * @brief DBus access delegate implementation for sdevent. + */ +class SDEvent +{ + public: + /** @brief Get the event loop. */ + static auto& getEvent() + { + static auto event = sdevent::event::newDefault(); + return event; + } +}; + +} // namespace util +} // namespace fan +} // namespace phosphor |