summaryrefslogtreecommitdiffstats
path: root/example/asio-example.cpp
diff options
context:
space:
mode:
authorVernon Mauery <vernon.mauery@linux.intel.com>2018-09-05 12:02:39 -0700
committerVernon Mauery <vernon.mauery@linux.intel.com>2018-09-05 19:59:34 +0000
commit2c8f93fb44cd08a6210f2b06d62ffb98677e7968 (patch)
treebfe5bd3b42a956ab50d236fe5a30a63531f7004f /example/asio-example.cpp
parente0d6965e73f1f648ed02e483277f81a328ecb6df (diff)
downloadsdbusplus-2c8f93fb44cd08a6210f2b06d62ffb98677e7968.tar.gz
sdbusplus-2c8f93fb44cd08a6210f2b06d62ffb98677e7968.zip
sdbusplus::asio: fix callback with void args specialization
Callbacks with no arguments failed to build due to an error in the utility::get_first_arg template. It failed to provide a type member for the void specialization. With this fix, it is possible to have a handler that has no arguments. Tested by: Added a new callback to the asio-example.cpp. Without the template change, this caused the build to fail as expected. After adding the template change, the build succeeds and the example runs as expected. Change-Id: Ib09b58c76df8cba57dc093ab37a4c1b68ea11ad3 Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
Diffstat (limited to 'example/asio-example.cpp')
-rw-r--r--example/asio-example.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/example/asio-example.cpp b/example/asio-example.cpp
index 31b55f2..354c7b0 100644
--- a/example/asio-example.cpp
+++ b/example/asio-example.cpp
@@ -17,6 +17,11 @@ int methodWithMessage(sdbusplus::message::message& m, int test)
return ++test;
}
+int voidBar(void)
+{
+ return 42;
+}
+
int main()
{
using GetSubTreeType = std::vector<std::pair<
@@ -121,6 +126,8 @@ int main()
iface->register_method("TestMethodWithMessage", methodWithMessage);
+ iface->register_method("VoidFunctionReturnsInt", voidBar);
+
iface->initialize();
iface->set_property("int", 45);
io.run();
OpenPOWER on IntegriCloud