You can just keep a pointer of all objects in the manager and use a QHash using the id parameters to make a key

Qt Code:
  1. struct Object
  2. {
  3. void bar(){/* do nothing */}
  4. };
  5.  
  6. class Manager
  7. {
  8. QHash<Key, Object*> map;
  9.  
  10. void foo()
  11. {
  12. // do something with 'key's object:
  13. Key key;
  14. map[key]->bar(); // no need to run method for each key/object
  15. }
  16. };
To copy to clipboard, switch view to plain text mode