DBus-C++ on_get_property
Markus Kohler
MarkusK at microsol.ie
Wed Apr 22 03:28:51 PDT 2009
I found in properties.h the following code:
Message PropertiesAdaptor::Get(const CallMessage &call)
{
[...]
Variant *value = interface->get_property(property_name);
if (!value)
throw ErrorFailed("requested property not found");
on_get_property(*interface, property_name, *value);
ReturnMessage reply(call);
MessageIter wi = reply.writer();
wi << *value;
return reply;
}
If you make changes to value inside of on_get_property(...) it will be also written into the interface->get_property(property_name), i.e. changes in there will change the interface. Is this intended to be like this. I would have expected that inside on_get_property(...) you get the value that you can modify for the output to the client application only without changing the values in the interface. If the intention is the later the code should be:
Message PropertiesAdaptor::Get(const CallMessage &call)
{
[...]
--> Variant value = *interface->get_property(property_name);
if (!value)
throw ErrorFailed("requested property not found");
--> on_get_property(*interface, property_name, value);
ReturnMessage reply(call);
MessageIter wi = reply.writer();
--> wi << value;
return reply;
}
Comments?
_______________________________________________________________________
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to which they are addressed.
If you have received this email in error please notify the originator of the message.
This footer also confirms that this email message has been scanned for the presence of computer viruses.
Any views expressed in this message are those of the individual sender, except where the sender specifies and with authority, states them to be the views of Microsol.
If you have received this mail in error you are requested to e-mail us (info at microsol.ie) or by telephoning Microsol on +353 14153700.
Please Visit our website at
http://www.microsol.com
_______________________________________________________________________
This email has been scanned for all viruses.
_______________________________________________________________________
More information about the dbus
mailing list