Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2009-11

(Generic) Container Classes

6 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Juha Manninen

Hi,

I submitted a TStringHashMap class to CCR. I also created a wiki page: http://wiki.lazarus.freepascal.org/StringHashMap

I made a comprehensive demo program for it. It should be good now.

I found some hashed list and similar classes from FPC sources (with no documentation) but no hash map with string -> pointer relationship.

The question is why I need to search and port such container classes? Such containers should be part of libraries. Delphi didn't have them either until recently and it was a big missing feature.

Generics syntax is being implemented in FPC. Containers especially would benefit from generics.
Is there a concrete plan to make such generics container library?

Regards,
Juha Manninen

Juha Manninen
to Juha Manninen

Uhh...

Is the class TFPStringHashTable (and TFPCustomHashTable) actually doing a hashmap?
The ported JCL StringHashMap is duplicate effort then after all.

Juha Manninen

Juha Manninen
to Vincent Snijders
Vincent Snijders wrote 13 lines
Juha Manninen schreef: > Uhh... > > Is the class TFPStringHashTable (and TFPCustomHashTable) actually doing a > hashmap? > The ported JCL StringHashMap is duplicate effort then after all. Here is the docs: http://lazarus-ccr.sourceforge.net/fpcdoc/fcl/contnrs/tfpstringhashtable.ht ml It has a source location, so you can find the implementation in the fpc sources.

Yes I found it.
I am only thinking now if HashTable and HashMap are the same thing. If they are and TFPStringHashTable is as fast as JCL's StringHashMap, then it doesn't make sense to add StringHashMap to CCR.

I extracted it from JCL already a long time ago and it has been useful. No wasted effort there.
But now I made a demo program for it. It could be used to demonstrate another similar class, too.

What about the generic containers? I guess it has not been planned yet.

Juha Manninen

Vincent Snijders
to Juha Manninen
Juha Manninen wrote
What about the generic containers? I guess it has not been planned yet.

There are some in the fgl unit in the RTL. As far as I can see, they are not yet documented.

Vincent

leledumbo
to Vincent Snijders
> What about the generic containers? I guess it has not been planned yet. There are some in the fgl unit in the RTL. As far as I can see, they are not yet documented.

I've used it in some occasions and it works very well (except for that ifdef-ed Assign method, that also affects recursive data structure).

View this message in context: http://old.nabble.com/%28Generic%29-Container-Classes-tp26557919p26569234.html Sent from the Free Pascal - General mailing list .