Download MetaTrader 5

Multiple inheritance

To add comments, please log in or register
ThreadHandle
104
ThreadHandle  

The Normal syntax doesnt seem to register, does mql cater for multiple inheritance or do i have to work around it?

 I was attempting a partial MVC, well different adaptation but essentially wanted a controller class between MarketIndicator and Trader, they both inherit statistics class but for different reasons.

Should i just include both mqh files and create an instance of each?  

ThreadHandle
104
ThreadHandle  
Also im guessing the Cbox's and dialogues dont work in strategy tester?  
whroeder1
17112
whroeder1  
Keelan: The Normal syntax doesnt seem to register, does mql cater for multiple inheritance or do i have to work around it?
Inheritance - MQL4 Documentation Last line: MQL4 has no multiple inheritance
ThreadHandle
104
ThreadHandle  

Yeh was just wondering if there was a work around but ive opted for static variables as the go between.

Never worked in C++ before, They seem to omit a fair chunk of the functionality, this due to simplicity or just their variation?

Also any idea why the downtime on the servers? I cant imagine they'd have any problem with latency or bandwidth. 

Ex Ovo Omnia
3422
Ex Ovo Omnia  
Where did you encounter multiple inheritance if you never worked with C++?
ThreadHandle
104
ThreadHandle  

Not sure maybe java had more than extends? i forget. I think c# you can inherit base class + shared interface. 

Plus since starting mql I've made a few steps towards learning c++.

ThreadHandle
104
ThreadHandle  
Are chart events void on strategy testers? that would explain the lack of functionality of dialogues. 
JC
1584
JC  
Keelan:

Not sure maybe java had more than extends? i forget. I think c# you can inherit base class + shared interface. 

(Not really relevant to this forum, but... the .NET languages don't have multiple inheritance in the full sense but a class can implement multiple interfaces, i.e. inherit from multiple abstract classes.)
Ex Ovo Omnia
3422
Ex Ovo Omnia  
Keelan:

Not sure maybe java had more than extends? i forget. I think c# you can inherit base class + shared interface. 

Plus since starting mql I've made a few steps towards learning c++.

 

No, and interface is not inheritance.
ThreadHandle
104
ThreadHandle  
Right you are...
Ex Ovo Omnia
3422
Ex Ovo Omnia  
Keelan:
Right you are...

The work-around (or pattern from my point of view) which might be used is embedding the instance of the class into the instance of the other class type.

E.g. if you need Runnable instance for your logic, but your method is implemented in RunClass, create a wrapper (RunClassWrapper) and invoke your RunClass.operation() from within the RunClassWrapper.run() metod.

 

12
To add comments, please log in or register