U++ framework
Do not panic. Ask here before giving up.

Home » Community » Newbie corner » ArrayMap / Polymorphism question (I probably do something wrong here...)
Re: ArrayMap / Polymorphism question [message #49486 is a reply to message #49485] Sat, 17 February 2018 08:43 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14291
Registered: November 2005
Ultimate Member
Kozaluss wrote on Fri, 16 February 2018 22:03
Hello everyone!

I've discovered U++ yesterday and would really like to use it's potential.
But these were years since I've last used C++ - now I mainly work in Clarion - job reasons.

I am trying to write an application - it is supposed to have many different classes (machines) derived from one base class (base machine).

Then on top of that I need an array of pairs int and someclass from the set above.
I understand, that I should declare this like this:

ArrayMap<int,BaseMachine> ML;

where BaseMachine is the base class for all other machine classes.
So when I add some derived type machine, I do it this way:

ML.Add( NUID, MasterMachine() ); // NUID is generated int


ML.Create<MasterMachine>(NUID);
 
Read Message
Read Message
Read Message
Previous Topic: MSSQL and codepage
Next Topic: Protect and Web
Goto Forum:
  


Current Time: Fri Aug 28 21:49:13 GMT+2 2026

Total time taken to generate the page: 0.00917 seconds