Implement phosphor-buttons based C++ and sdbusplus interfaces.
This phosphor-buttons module handles all the physical buttons
like Reset/Power/ID button pressed/released signals and the
simulate signals on button pressed/released in WebUI.
All the signals are exposed into dbus and let other
modules be aware.
Change-Id: I52144718ef54d403c5221e5afd0216b9494f8523
Signed-off-by: Kuiying Wang <kuiying.wang@intel.com>
diff --git a/inc/common.hpp b/inc/common.hpp
new file mode 100644
index 0000000..387b626
--- /dev/null
+++ b/inc/common.hpp
@@ -0,0 +1,25 @@
+/*
+// Copyright (c) 2018 Intel Corporation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+*/
+
+#pragma once
+struct EventDeleter
+{
+ void operator()(sd_event* event) const
+ {
+ event = sd_event_unref(event);
+ }
+};
+using EventPtr = std::unique_ptr<sd_event, EventDeleter>;
\ No newline at end of file