Forum > General

My first Attempt making a MultiMap generic

(1/1)

jamie:
I tried to use the Generic.Collections Tdictionary but the compiler choked with a "lj3131" symbol not found error at the end of the project file.

So I went with the TFPGMap generic and gave it a shoot.

There are some items in this MAP I need to disable because it's not going to work well with a Multimap.

This is just a start for me and most likely good enough for the project I am doing.

Attached is a test project with the code in hand.

Any thoughts are welcomed.

jamie:
I just added an Enumerator that returns the the Data which in this case is a list instance that hoses the actual data.

I may elect to include a TMultiMapPair but I found that if you need the key there is a INDEXOF(data) that will give you the key.

Going with the pair idea, it looks like I would need to subclass the enumerator to fill the pair record.

jamie:
I've been working on this for a few hours now... Here is just the file with the generics in it.

I've also included a TFPGSet. It needs more work but its useable as it is now.

These aren't the most efficient classes because I just wrapped around existing ones to get things done.

I will now integrate this in my current project so I can get that moving.

I do have TMultiMapPair type in there but its not implemented for the FOR LOOP, the class has FIRST, NEXT, PROV and last
to capture a TPair that gives you the Key and Data List.




Navigation

[0] Message Index

Go to full version