Im trying to underestand the correct use of dictionaries and I havbe a doubt about the combination of classes and dictionaries. In my code, I have something like this:
class Entity {
Node@ n;
String Name;
*****
}
class ListOfEntity {
Dictionary D;
Entity Find(String id)
{
if (D.Exists(id)) {
retval = entity();
D.Get(id,retval)
return retval;
}
}
After reading about handles, classes and such, I made myself a mess and now I dont know if that is the correct way to do it. Will Find() return a “pointer” to an Entity instance, or just a new copy of it? If id doesnt exists, what should I return? I have tried null, 0, and all of them produces an error.