Add boost asio async connection

Add an async connection and example of usage. This
connection inherits the bus object and allows async
method calls using boost asio. Most of these concepts
are from boost-dbus.

Change-Id: I33b5349d543c9ff4b6ee1ce15346c709c052e1ae
Tested: Compiled and ran asio-example on bmc.
Signed-off-by: James Feist <james.feist@linux.intel.com>
diff --git a/example/asio-example.cpp b/example/asio-example.cpp
new file mode 100644
index 0000000..7dde720
--- /dev/null
+++ b/example/asio-example.cpp
@@ -0,0 +1,65 @@
+#include <iostream>
+#include <sdbusplus/bus.hpp>
+#include <sdbusplus/server.hpp>
+#include <sdbusplus/asio/connection.hpp>
+#include <boost/asio.hpp>
+
+int main()
+{
+    using GetSubTreeType = std::vector<std::pair<
+        std::string,
+        std::vector<std::pair<std::string, std::vector<std::string>>>>>;
+    using message = sdbusplus::message::message;
+    // setup connection to dbus
+    boost::asio::io_service io;
+    auto conn = std::make_shared<sdbusplus::asio::connection>(io);
+
+    // test async method call and async send
+    auto mesg =
+        conn->new_method_call("xyz.openbmc_project.ObjectMapper",
+                              "/xyz/openbmc_project/object_mapper",
+                              "xyz.openbmc_project.ObjectMapper", "GetSubTree");
+
+    static const auto depth = 2;
+    static const std::vector<std::string> interfaces = {
+        "xyz.openbmc_project.Sensor.Value"};
+    mesg.append("/xyz/openbmc_project/Sensors", depth, interfaces);
+
+    conn->async_send(mesg, [](boost::system::error_code ec, message& ret) {
+        std::cout << "async_send callback\n";
+        if (ec || ret.is_method_error())
+        {
+            std::cerr << "error with async_send\n";
+            return;
+        }
+        GetSubTreeType data;
+        ret.read(data);
+        for (auto& item : data)
+        {
+            std::cout << item.first << "\n";
+        }
+    });
+
+    conn->async_method_call(
+        [](boost::system::error_code ec, GetSubTreeType& subtree) {
+            std::cout << "async_method_call callback\n";
+            if (ec)
+            {
+                std::cerr << "error with async_method_call\n";
+                return;
+            }
+            for (auto& item : subtree)
+            {
+                std::cout << item.first << "\n";
+            }
+
+        },
+        "xyz.openbmc_project.ObjectMapper",
+        "/xyz/openbmc_project/object_mapper",
+        "xyz.openbmc_project.ObjectMapper", "GetSubTree",
+        "/org/openbmc/control", 2, std::vector<std::string>());
+
+    io.run();
+
+    return 0;
+}