[Dbus-cxx-users] Method call which returns signed char (and takes time_t)?
Status: Beta
Brought to you by:
rvinyard
From: Patrick A. <pa...@ph...> - 2009-06-05 18:47:21
|
Hi: I've just started using dbus-cxx, and I'm having a bit of difficulty. I'm trying to replicate the "callee_object"/"caller_object" example: in my case, the class method looks like char saw(time_t sec); That gave me errors compiling the "callee" portion: /usr/local/include/dbus-cxx-0.1/dbus-cxx/method.h: In member function DBus::HandlerResult DBus::Method<T_return, T_arg1, sigc::nil, sigc::nil, sigc::nil, sigc::nil, sigc::nil, sigc::nil>::handle_call_message(std::shared_ptr<DBus::Connection>, std::shared_ptr<const DBus::CallMessage>) [with T_return = char, T_arg1 = long int]: /usr/local/include/dbus-cxx-0.1/dbus-cxx/method.h:176: error: ambiguous overload for operator>> in i >> _val_1 /usr/local/include/dbus-cxx-0.1/dbus-cxx/method.h:176: note: candidates are: operator>>(int32_t, long int) <built-in> /usr/local/include/dbus-cxx-0.1/dbus-cxx/method.h:176: note: operator>>(uint32_t, long int) <built-in> /usr/local/include/dbus-cxx-0.1/dbus-cxx/method.h:176: note: operator>>(uint64_t, long int) <built-in> /usr/local/include/dbus-cxx-0.1/dbus-cxx/method.h:176: note: operator>>(int64_t, long int) <built-in> I got around that problem by replacing "time_t" with an unsigned int, so that's not that big a deal, though I'd like to know if that can be fixed. I then hit a snag in the "caller" portion, /usr/local/include/dbus-cxx-0.1/dbus-cxx/message.h: In function DBus::MessageIterator DBus::operator>>(std::shared_ptr<const DBus::Message>, T&) [with T = signed char]: /usr/local/include/dbus-cxx-0.1/dbus-cxx/methodproxy.h:109: instantiated from T_return DBus::MethodProxy<T_return, T_arg1, sigc::nil, sigc::nil, sigc::nil, sigc::nil, sigc::nil, sigc::nil>::operator()(T_arg1) [with T_return = signed char, T_arg1 = unsigned int] /usr/local/include/dbus-cxx-0.1/dbus-cxx/message.h:182: error: no matching function for call to DBus::Message::operator>>(signed char&) const which then lists a bunch of operator>> with bool, uint8_t, int16_t,uint16_t,int32_t,uint32_t,int64_t,uint64_t,double, const char*, and std::string. It looks like int8_t is missing from that list. Anyway, I wasn't sure if this was a bug or something related to allowable DBus types, so I figured I'd ask. I can work around it by passing something larger than a char, obviously, but it seems strange for int8_t to be the only one that's missing. Thanks! Patrick |