[shill] Use composition instead of inheritance with PropertyStore
Instead of having Device, Manager, etc all inherit from PropertyStore
and have it be difficult to follow the getting/setting property code,
have each include a PropertyStore as a data member. Provide an
accessor so that RPC adaptor classes can get and set properties
directly and continue to handle any necessary type conversion
themselves.
BUG=None
TEST=unit tests
Change-Id: I34781bde4de0e152550ca636e28d472abde756af
Reviewed-on: http://gerrit.chromium.org/gerrit/3616
Tested-by: Chris Masone <cmasone@chromium.org>
Reviewed-by: Darin Petkov <petkov@chromium.org>
diff --git a/wifi_service.cc b/wifi_service.cc
index 6f4e959..59d7d36 100644
--- a/wifi_service.cc
+++ b/wifi_service.cc
@@ -33,19 +33,19 @@
eap_.key_management = key_management;
// TODO(cmasone): Figure out if mode_ should be a string or what
- // RegisterString(flimflam::kModeProperty, &mode_);
- RegisterString(flimflam::kPassphraseProperty, &passphrase_);
- RegisterBool(flimflam::kPassphraseRequiredProperty, &need_passphrase_);
- RegisterConstString(flimflam::kSecurityProperty, &security_);
+ // store_.RegisterString(flimflam::kModeProperty, &mode_);
+ store_.RegisterString(flimflam::kPassphraseProperty, &passphrase_);
+ store_.RegisterBool(flimflam::kPassphraseRequiredProperty, &need_passphrase_);
+ store_.RegisterConstString(flimflam::kSecurityProperty, &security_);
- RegisterConstString(flimflam::kWifiAuthMode, &auth_mode_);
- RegisterConstBool(flimflam::kWifiHiddenSsid, &hidden_ssid_);
- RegisterConstUint16(flimflam::kWifiFrequency, &frequency_);
- RegisterConstUint16(flimflam::kWifiPhyMode, &physical_mode_);
- RegisterConstUint16(flimflam::kWifiHexSsid, &hex_ssid_);
+ store_.RegisterConstString(flimflam::kWifiAuthMode, &auth_mode_);
+ store_.RegisterConstBool(flimflam::kWifiHiddenSsid, &hidden_ssid_);
+ store_.RegisterConstUint16(flimflam::kWifiFrequency, &frequency_);
+ store_.RegisterConstUint16(flimflam::kWifiPhyMode, &physical_mode_);
+ store_.RegisterConstUint16(flimflam::kWifiHexSsid, &hex_ssid_);
- RegisterConstUint8(flimflam::kSignalStrengthProperty, &strength_);
- RegisterConstString(flimflam::kTypeProperty, &type_);
+ store_.RegisterConstUint8(flimflam::kSignalStrengthProperty, &strength_);
+ store_.RegisterConstString(flimflam::kTypeProperty, &type_);
}
WiFiService::~WiFiService() {