[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/service_dbus_adaptor.cc b/service_dbus_adaptor.cc
index 8241ac7..76cfa01 100644
--- a/service_dbus_adaptor.cc
+++ b/service_dbus_adaptor.cc
@@ -7,6 +7,9 @@
#include <map>
#include <string>
+#include <base/logging.h>
+
+#include "shill/error.h"
#include "shill/service.h"
using std::map;
@@ -35,11 +38,11 @@
void ServiceDBusAdaptor::EmitUintChanged(const std::string& name,
uint32 value) {
- PropertyChanged(name, DBusAdaptor::UInt32ToVariant(value));
+ PropertyChanged(name, DBusAdaptor::Uint32ToVariant(value));
}
void ServiceDBusAdaptor::EmitIntChanged(const std::string& name, int value) {
- PropertyChanged(name, DBusAdaptor::IntToVariant(value));
+ PropertyChanged(name, DBusAdaptor::Int32ToVariant(value));
}
void ServiceDBusAdaptor::EmitStringChanged(const std::string& name,
@@ -53,9 +56,10 @@
return map<string, ::DBus::Variant>();
}
-void ServiceDBusAdaptor::SetProperty(const string& ,
- const ::DBus::Variant& ,
+void ServiceDBusAdaptor::SetProperty(const string& name,
+ const ::DBus::Variant& value,
::DBus::Error &error) {
+ DBusAdaptor::DispatchOnType(service_, name, value, error);
}
void ServiceDBusAdaptor::ClearProperty(const string& , ::DBus::Error &error) {