diff options
author | crupest <crupest@outlook.com> | 2018-10-04 01:47:49 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2018-10-04 01:47:49 +0800 |
commit | 01ab4511d3006e9f65ff96ae63b21de14b41bc48 (patch) | |
tree | e4fa991e7784571c164301ff7ade5aa1ef515744 /src/base.h | |
parent | 30ecda8bb354d5982978af97aa90b5f49d9ea195 (diff) | |
download | cru-01ab4511d3006e9f65ff96ae63b21de14b41bc48.tar.gz cru-01ab4511d3006e9f65ff96ae63b21de14b41bc48.tar.bz2 cru-01ab4511d3006e9f65ff96ae63b21de14b41bc48.zip |
...
Diffstat (limited to 'src/base.h')
-rw-r--r-- | src/base.h | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -116,6 +116,9 @@ namespace cru class PropertyChangedNotifyObject : public Object { public: + using PropertyChangedHandler = Function<void(const StringView&)>; + using PropertyChangedHandlerPtr = FunctionPtr<void(const StringView&)>; + PropertyChangedNotifyObject() = default; PropertyChangedNotifyObject(const PropertyChangedNotifyObject& other) = delete; PropertyChangedNotifyObject(PropertyChangedNotifyObject&& other) = delete; @@ -123,14 +126,14 @@ namespace cru PropertyChangedNotifyObject& operator = (PropertyChangedNotifyObject&& other) = delete; ~PropertyChangedNotifyObject() override = default; - void AddPropertyChangedListener(FunctionPtr<void(String)> listener); + void AddPropertyChangedListener(FunctionPtr<void(const StringView&)> listener); - void RemovePropertyChangedListener(const FunctionPtr<void(String)>& listener); + void RemovePropertyChangedListener(const FunctionPtr<void(const StringView&)>& listener); protected: - void RaisePropertyChangedEvent(String property_name); + void RaisePropertyChangedEvent(const StringView& property_name); private: - std::list<FunctionPtr<void(String)>> listeners_; + std::list<FunctionPtr<void(const StringView&)>> listeners_; }; } |