nicholishen: Ok. You tell me which std library class you want to implement observer and which class you want to implement subject and tell show you how to do it.
Ok. I already do it but lets see your way.
Lets make CLine as subject and CStrategyBreak : public CTrade observes. (Just for example)
* I see what you are going to do now. You are going to inherit CObserverWrapper on the observer side and CSubjectWrapper on the subject side. Nice idea, still I prefer my way.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Sorry, I don't mean to bug you.
This is not how you'd implement it. You wouldn't have a class that is both Subject and observer.
The stage is yours
Ok. You tell me which std library class you want to implement observer and which class you want to implement subject and tell show you how to do it.
* I see what you are going to do now. You are going to inherit CObserverWrapper on the observer side and CSubjectWrapper on the subject side. Nice idea, still I prefer my way.
Ok. I already do it but lets see your way.
Let's use a real example. I just don't see a relevant use of a line as the subject and CTrade as observer...
What if i'm telling you what i'm trying to do? So you also help me with my noob experience? :)
Let's use a real example. I just don't see a relevant use of a line as the subject and CTrade as observer...
Why not, you have a strategy class that observes a trend line(or many of them) for crossing of price
What if i'm telling you what i'm trying to do? So you also help me with my noob experience? :)
If that's the case then you had them backwards. The trend lines are observers and the strategy is the subject.