An easy example of the use of RHashMap ?

Login to reply to this topic.
Wed, 2007-11-07 11:29
Joined: 2007-11-06
Forum posts: 6

Hi everyone !
I am trying to create a RHashMap object, but I can not find an easy example of use.

It is possible, if I am not wrong, to specify any type of key and value ?
This is possible:
RHashMap myMap = new (ELeave)RHashMap<TUint32, TSize>();
No ?

Because I have some compilation errors :

')' expected
expression syntax error
not an lvalue
template argument list expected

What should I do in order to create this object ?
Thanks in advance !
JM


Wed, 2007-11-07 13:26
Joined: 2003-12-05
Forum posts: 672
Re: An easy example of the use of RHashMap ?

R classes are not allocated from heap (there is a very rare exception to this though). So do not try to do it with RHashMap.

The exact reason for your problem is that new (ELeave) returns a pointer, but your myMap is an object, not a pointer.

Wed, 2007-11-07 13:36
Joined: 2007-11-06
Forum posts: 6
Re: An easy example of the use of RHashMap ?

Ah, ok, it works when using a pointer.
Thanks Smiling.

Fri, 2007-11-09 15:04
Joined: 2007-11-06
Forum posts: 6
Re: An easy example of the use of RHashMap ?

Just for infomation: Do you know how efficient is the use of RHashMap ?

I mean, is using InsertL consuming a lot of time, is the access time to an element through the method FindL efficient ?

Thx in advance !

  • Login to reply to this topic.