Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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: 13975
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: Mon May 06 18:47:03 CEST 2024

Total time taken to generate the page: 0.01977 seconds