aboutsummaryrefslogtreecommitdiff
path: root/src/base.h
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2018-10-04 01:47:49 +0800
committercrupest <crupest@outlook.com>2018-10-04 01:47:49 +0800
commit01ab4511d3006e9f65ff96ae63b21de14b41bc48 (patch)
treee4fa991e7784571c164301ff7ade5aa1ef515744 /src/base.h
parent30ecda8bb354d5982978af97aa90b5f49d9ea195 (diff)
downloadcru-01ab4511d3006e9f65ff96ae63b21de14b41bc48.tar.gz
cru-01ab4511d3006e9f65ff96ae63b21de14b41bc48.tar.bz2
cru-01ab4511d3006e9f65ff96ae63b21de14b41bc48.zip
...
Diffstat (limited to 'src/base.h')
-rw-r--r--src/base.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/base.h b/src/base.h
index 18bf9cc5..0a77e5b9 100644
--- a/src/base.h
+++ b/src/base.h
@@ -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_;
};
}