"It is forbidden to inherit classes from structures or structures from classes. Unlike C++, MQL5 does not support multiple inheritance. A class can have at most one parent. A derived class object has a base class object built into it."
this is true statement or not ? maybe we can somehow bypass it or still not? We can´t access even ClassA "public" data from ClassB if ClassB is not a child of ClassA ? To use class data from another class, it is nessessary to copy *data in a separate function outside the class in order to transfer it to another class? I mean using only mql5. I know that we can build a .dll and then we can build our real pointer , but I would leave such extremes aside for the moment.
the more I research , the more I realize that it was totally stupid idea at all to put these arrays into the class private member. I am on the right track when I think that there is no point in encapsulating such frequently used data as [close] and [time]? It would be correct to leave them in the global space? Or put the basic class and build the whole system on top on this? How do You pro masters build your bigger systems and use global variables is a very big red light?
"It is forbidden to inherit classes from structures or structures from classes. Unlike C++, MQL5 does not support multiple inheritance. A class can have at most one parent. A derived class object has a base class object built into it."
this is true statement or not ? maybe we can somehow bypass it or still not? We can´t access even ClassA "public" data from ClassB if ClassB is not a child of ClassA ? To use class data from another class, it is nessessary to copy *data in a separate function outside the class in order to transfer it to another class? I mean using only mql5. I know that we can build a .dll and then we can build our real pointer , but I would leave such extremes aside for the moment.
the more I research , the more I realize that it was totally stupid idea at all to put these arrays into the class private member. I am on the right track when I think that there is no point in encapsulating such frequently used data as [close] and [time]? It would be correct to leave them in the global space? Or put the basic class and build the whole system on top on this? How do You pro masters build your bigger systems and use global variables is a very big red light?
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi everybody. Although this is little silly but I started learning OOP and unfortunately is started to like too much. Now I decided my just written fully working code rewrite. All started well, but after a while i got stuck on one thing. I don´t know how to update arrays elements inside a class using templates. I would initially want to include normal dynamic arrays and I would like the arrays to be private members of the class. Firstly I´ll try to avoid to CArrayObj ready made class. Here is my function code:
and there is call
C_process_M1.F_Process_Iteration(execution_cycle_M1); if (C_process_M1.Get_Iterate_now()) { fill_ts_arr(c,lookback,ts_count,execution_cycle_M1); fill_ts_arr(t,lookback,ts_count,execution_cycle_M1); ts_count++; }
I´ve read a lot of documentation , but I´m not biting through this big nut to convert it OOP. maybe someone has some good ideas to give or a little advice.