diff options
Diffstat (limited to 'dbus/property.h')
-rw-r--r-- | dbus/property.h | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/dbus/property.h b/dbus/property.h index ea893dc..419da53 100644 --- a/dbus/property.h +++ b/dbus/property.h @@ -7,6 +7,8 @@ #include <map> #include <string> +#include <utility> +#include <vector> #include "base/basictypes.h" #include "base/bind.h" @@ -158,7 +160,7 @@ class PropertyBase { // no knowledge of the contained type is required, this method returns // true if its expected type was found, false if not. // Implementation provided by specialization. - virtual bool PopValueFromReader(MessageReader*) = 0; + virtual bool PopValueFromReader(MessageReader* reader) = 0; // Method used by PropertySet to append the set value to a MessageWriter, // no knowledge of the contained type is required. @@ -229,7 +231,7 @@ class CHROME_DBUS_EXPORT PropertySet { // Methods connected by ConnectSignals() and called by dbus:: when // a property is changed. Sub-classes may override if the property // changed signal provides different arguments. - virtual void ChangedReceived(Signal*); + virtual void ChangedReceived(Signal* signal); virtual void ChangedConnected(const std::string& interface_name, const std::string& signal_name, bool success); @@ -376,7 +378,7 @@ class CHROME_DBUS_EXPORT Property : public PropertyBase { // Method used by PropertySet to retrieve the value from a MessageReader, // no knowledge of the contained type is required, this method returns // true if its expected type was found, false if not. - bool PopValueFromReader(MessageReader*) override; + bool PopValueFromReader(MessageReader* reader) override; // Method used by PropertySet to append the set value to a MessageWriter, // no knowledge of the contained type is required. @@ -398,6 +400,10 @@ class CHROME_DBUS_EXPORT Property : public PropertyBase { property_set()->NotifyPropertyChanged(name()); } + // Method used by test and stub implementations to directly set the + // |set_value_| of a property. + void ReplaceSetValueForTesting(const T& value) { set_value_ = value; } + private: // Current cached value of the property. T value_; @@ -485,6 +491,23 @@ template <> void Property<std::vector<uint8> >::AppendSetValueToWriter( MessageWriter* writer); extern template class Property<std::vector<uint8> >; +template <> +bool Property<std::map<std::string, std::string>>::PopValueFromReader( + MessageReader* reader); +template <> +void Property<std::map<std::string, std::string>>::AppendSetValueToWriter( + MessageWriter* writer); +extern template class Property<std::map<std::string, std::string>>; + +template <> +bool Property<std::vector<std::pair<std::vector<uint8_t>, uint16_t>>>:: + PopValueFromReader(MessageReader* reader); +template <> +void Property<std::vector<std::pair<std::vector<uint8_t>, uint16_t>>>:: + AppendSetValueToWriter(MessageWriter* writer); +extern template class Property< + std::vector<std::pair<std::vector<uint8_t>, uint16_t>>>; + } // namespace dbus #endif // DBUS_PROPERTY_H_ |