Switch sd_event loops to sdeventplus

This change is mostly focused around plumbing the sdeventplus::Event
object everywhere and using the member functions provided for the event.
No migration to the timer utility is performed yet.

Change-Id: I912ab82bc081239d3b7c3cf7c5caca6742ef9c87
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/presence/gpio.cpp b/presence/gpio.cpp
index 2a0a4c0..19593c2 100644
--- a/presence/gpio.cpp
+++ b/presence/gpio.cpp
@@ -13,14 +13,14 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#include <memory>
+#include <functional>
 #include <phosphor-logging/elog-errors.hpp>
 #include <phosphor-logging/elog.hpp>
+#include <sdeventplus/event.hpp>
 #include <tuple>
 #include <xyz/openbmc_project/Common/Callout/error.hpp>
 #include "gpio.hpp"
 #include "rpolicy.hpp"
-#include "sdevent.hpp"
 
 namespace phosphor
 {
@@ -37,25 +37,23 @@
     evdevfd(open(device.c_str(), O_RDONLY | O_NONBLOCK)),
     evdev(evdevpp::evdev::newFromFD(evdevfd())),
     phys(physDevice),
-    pin(physPin),
-    callback(nullptr)
+    pin(physPin)
 {
 
 }
 
 bool Gpio::start()
 {
-    callback = std::make_unique<sdevent::event::io::IO>(
-            util::SDEvent::getEvent(),
-            evdevfd(),
-            [this](auto& s){this->ioCallback(s);});
+    source.emplace(sdeventplus::Event::get_default(),
+            evdevfd(), EPOLLIN,
+            std::bind(&Gpio::ioCallback, this));
     currentState = present();
     return currentState;
 }
 
 void Gpio::stop()
 {
-    callback = nullptr;
+    source.reset();
 }
 
 bool Gpio::present()
@@ -75,7 +73,7 @@
             GPIO::CALLOUT_DEVICE_PATH(phys.c_str()));
 }
 
-void Gpio::ioCallback(sdevent::source::Source& source)
+void Gpio::ioCallback()
 {
     unsigned int type, code, value;