DBus::MethodProxy to return Variant

26 views
Skip to first unread message

Saidou Souare

unread,
May 3, 2018, 5:48:40 AM5/3/18
to Dbus-cxx


Hello.


How can i return function like defined below





I have issue defining the Method


DBus::MethodProxy<const std::map<std::string, DBus::Variant>, void>& foo
   = *(object->create_method<const std::map<std::string, DBus::Variant>, void>("org.freedesktop.ModemManager1.Modem.Simple", "GetStatus"));



Best regards

Robert Middleton

unread,
May 3, 2018, 9:43:08 AM5/3/18
to Saidou Souare, Dbus-cxx
This unfortunately doesn't work well at the moment, because the DBus::Variant needs to be templated.  The work-around for now is to define your own variant type, that you can use to convert to any type that you want.  If you were to use it now, you would have to do something like DBus::Variant<int>.

Check out the earlier thread on how to define your own type: https://groups.google.com/forum/#!topic/dbus-cxx/AxLXh8AyIj0

-Robert Middleton

--
You received this message because you are subscribed to the Google Groups "Dbus-cxx" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dbus-cxx+unsubscribe@googlegroups.com.
To post to this group, send email to dbus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dbus-cxx/3a009d49-0118-4716-b7f8-dbefe46687d0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages