Questions on OOP in MQL5 - page 58

 
Vladimir Simakov:

Let me explain.

In mql5, the nested class as well as in pluses is a friend of the external one (by the way, this is the point I didn't know). But in mql4 it's not implemented, and you have to write crutches there. That is, this code will compile correctly in mql5, but will cause compilation errors in mql4.

Although, of course, they will write that it's not C++, but still, I will draw an analogy.

I don't recall anything about nested classes in official mql docs, or about peculiarities of access to external fields from it. Consequently, all this makes me think of UB. Yes, it works, but laying the groundwork for it, until the relevant information appears in the docs, is kind of at your own risk.

The 5-th one is being corrected more and more often to eliminate the remaining inconsistencies. Less attention is paid to the 4th. That's probably why. And apparently nobody needed nested classes before in the times of 4)))

 
Igor Makanu:

Why is your story instructive? Everyone gets a job this way - you have to be in the right place at the right time, that's all... there was a vacancy as a button man, so they hired you )))

or did you have some foreign certificate at that time?)


ZS: Why do you work? are the costs large? - You have an average check for the EA 100-300 thousand rubles, in my opinion should suffice at least a month )))).


UPD: got the feeling that I was an unwitting participant in a freak show, it's not right (((

Had a good laugh, thanks! )))) Humor is a very important thing ...in PLO... )))))

 
Igor Makanu:

And what is the instructive part of your story?

My point is that seemingly complicated things are simple. And this thread of many pages is a discussion of simple things in complicated words... That's the whole message...

 
Evgeniy Zhdan:

My point is that seemingly complicated things are simple. And this thread of many pages is a discussion of simple things in complicated words... That's the whole point...

I can't remember some old joke, but all that comes to mind is the ending "what's there to think about! You've got to jump higher!

)))


I'm sorry if I offended you, I didn't mean to, but this is how the discussion turned into a total hullabaloo.


thank you for your help in the discussion, i'm off

 
Evgeniy Zhdan:

My point is that seemingly complicated things are simple. And this thread of many pages is a discussion of simple things in complicated words... That's the whole message...

I agree) I also think that one's attitude... for example towards patterns... is usually best expressed by one's therapist ))))

 
Igor Makanu:

thanks for your help in the discussion, i'm off

Have you solved your problem? )

Igor Makanu:

Given:
1. A finite state machine (FSA)
2. The number of KAs is unknown.
3. States of spacecraft: successful / failed / working
4. CAs are executed in several threads, the number of threads is unknown

A pattern must allow:
1. Issue a unique ID for each process - counter doesn't work
2. Add spa spa uniformly by threads
3. Get status of spacecraft
4. Restart KA if KA state is the same as the task that was issued earlier
5. Save AC to database and remove it from the flow if the state is successful
6. Restore the state of AC ( ID from saving ) and add it to the flow
7. To have a common pool for exchanging EA messages, the pool is not rubber, deleted EAs do not receive messages, but newly created EAs should receive new messages and not the ones left from killed EAs, there is no synchronization between the threads and EAs
8. Save and restore the state of the whole pattern and message pool

* KAs do not perform the same tasks
** Message pool is the main problem, but it can be either CA or DB or ?
*** maybe it's all database work and patterns aren't needed here at all?

From this abstract description it's hard to understand what exactly the purpose of this algorithm is. But it looks like you know in your heart that it all boils down to a trivial DB routine, and this whole abstruse list is an attempt to cut out the tonsils through the ass )

The same as with this ill-fated Keeper. Essentially you need to copy the contents of an object into some container, and then from that container back into the object. But no, you had to invent some mysterious Memento who controls everything. Only confusing the algorithm and creating an overhead on the spot.

 
Alexey Navoykov:

Have you solved your problem? )

Yes, the physical information has been gathered, and now it is being absorbed and analysed.

And thank you, as one of the few who can write in substance while expressing a personal opinion.


Alexey Navoykov:

From this abstract description, it is difficult to understand the specific purpose of this algorithm.

I think the search for information is supposed to look so abstract, and it's not about some secret research paper with a Darwin prize later on....

seriously, if i write specific goals - they are implemented, but everything is crooked and askew, then i will have to discuss your previous experience and not my goal - to structure slash code, because now it is possible to transfer algorithms from scratch - volumes are small and powers are clearly divided.... but in 3 separate working tasks, and the goal in the end is common.... you see, everything has become clear now ))))

 

hello again!


this question, there is an enum , we need either an array enum or a list enum or a container enum - something where to store 7 enum , but the appetite grows, maybe 70 enum


where ?

 
Igor Makanu:

this question, there is an enum , we need either an array enum or a list enum or a container enum - something to store 7 enums now, but the appetite is growing, maybe 70 enums

7 enum types or 7 enum values?
 
Alexey Navoykov:
7 enum types or 7 enum values?

7 types, number of values arbitrary


the only thing that comes to mind is a structure as a container, but I'm looking for technical information again ))


the problem is, that only global visibility of enums is supposed, but to save the state of objects, you need to use specific enum

Reason: