@@ -43,6 +43,7 @@ class ConcreteEngine : public Engine {
43
43
void OnSelect (Context* ctx);
44
44
void OnContextUpdate (Context* ctx);
45
45
void OnOptionUpdate (Context* ctx, const string& option);
46
+ void OnPropertyUpdate (Context* ctx, const string& property);
46
47
47
48
vector<of<Processor>> processors_;
48
49
vector<of<Segmentor>> segmentors_;
@@ -79,6 +80,10 @@ ConcreteEngine::ConcreteEngine() {
79
80
[this ](Context* ctx, const string& option) {
80
81
OnOptionUpdate (ctx, option);
81
82
});
83
+ context_->property_update_notifier ().connect (
84
+ [this ](Context* ctx, const string& property) {
85
+ OnPropertyUpdate (ctx, property);
86
+ });
82
87
InitializeComponents ();
83
88
InitializeOptions ();
84
89
}
@@ -129,6 +134,15 @@ void ConcreteEngine::OnOptionUpdate(Context* ctx, const string& option) {
129
134
message_sink_ (" option" , msg);
130
135
}
131
136
137
+ void ConcreteEngine::OnPropertyUpdate (Context* ctx, const string& property) {
138
+ if (!ctx) return ;
139
+ LOG (INFO) << " updated property: " << property;
140
+ // notification
141
+ string value = ctx->get_property (property);
142
+ string msg (property + " =" + value);
143
+ message_sink_ (" property" , msg);
144
+ }
145
+
132
146
void ConcreteEngine::Compose (Context* ctx) {
133
147
if (!ctx) return ;
134
148
Composition& comp = ctx->composition ();
0 commit comments