mrjt Messages: 705 Registered: March 2007 Location: London
Contributor
luzr wrote on Tue, 31 March 2009 14:23
How do you finds items then? Using fake CollectionElement as key?
Mirek
I think thats the problem isn't it?
You have something like this no?
struct CollectionElement : public Moveable<CollectionElement>
{
String unique_id;
Value data; // Whatever
};
struct Referer : public Moveable<Referer>
{
String unique_id;
Value data; // Whatever
String collection_id;
}
Index<CollectionElement> collection;
Vector<Referer> ref;
int FindRefCollection(Referer &ref) {
unsigned collection_hash = GetHashValue(ref.collection_id);
// Now we need to find the CollectionElement by hash only
// but the closest you can get is Find(T &x, unsigned hash)
return -1;
}
Since AIndex::hash is protected you can of course just inherit and add the memebr yourself, but it wouldn't be ideal.