[shill] Begin wiring SetProperty
Create a PropertyStoreInterface that can be implemented by Device,
Service, Manager, etc to handle getting/setting of properties. The
various DBusAdaptor subclasses can dispatch incoming calls to their
associated implementation object based on the names of the properties
and/or the types of the arguments.
BUG=chromium-os:16343
TEST=unit tests
Change-Id: If7abb0ffa623e59288943b4ed1f49832a92524ea
Reviewed-on: http://gerrit.chromium.org/gerrit/2408
Reviewed-by: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
diff --git a/device_dbus_adaptor.cc b/device_dbus_adaptor.cc
index eda5ec2..9beec49 100644
--- a/device_dbus_adaptor.cc
+++ b/device_dbus_adaptor.cc
@@ -9,6 +9,7 @@
#include <string>
#include "shill/device.h"
+#include "shill/error.h"
using std::map;
using std::string;
@@ -36,11 +37,11 @@
}
void DeviceDBusAdaptor::EmitUintChanged(const std::string& name, uint32 value) {
- PropertyChanged(name, DBusAdaptor::UInt32ToVariant(value));
+ PropertyChanged(name, DBusAdaptor::Uint32ToVariant(value));
}
void DeviceDBusAdaptor::EmitIntChanged(const std::string& name, int value) {
- PropertyChanged(name, DBusAdaptor::IntToVariant(value));
+ PropertyChanged(name, DBusAdaptor::Int32ToVariant(value));
}
void DeviceDBusAdaptor::EmitStringChanged(const std::string& name,
@@ -53,9 +54,10 @@
return map<string, ::DBus::Variant>();
}
-void DeviceDBusAdaptor::SetProperty(const string& ,
- const ::DBus::Variant& ,
+void DeviceDBusAdaptor::SetProperty(const string& name,
+ const ::DBus::Variant& value,
::DBus::Error &error) {
+ DBusAdaptor::DispatchOnType(device_, name, value, error);
}
void DeviceDBusAdaptor::ClearProperty(const std::string& ,