Guest User

Untitled

a guest
Aug 1st, 2012
71
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Datastructure: A bunch of nodes connected with each other that form a loop.
  2. Each node has a pointer to the previous node and a pointer to the next node.
  3.  
  4. node - node - node - node
  5. | |
  6. node node
  7. | |
  8. node - node - node - node
  9.  
  10.  
  11. The world is divided into regions.
  12. A node can be in multiple regions.
  13. Region1()
  14. Region2[]
  15. (node0 - node1 - [node2) - node3 - node4]
  16.  
  17. Each region will be serialized (saved on the HD).
  18.  
  19. When loading back into the cache the datastructure should be restored. However not all regions will be in the cache at the same time.
  20.  
  21. if Region1 loads into cache it contains node1, node2 and node3. Thats cool.
  22. But sometime Region2 may be loaded into cache too. Region 2 contains node2, node3 and node 4. I need a way to find out that the node2 is the same object in both regions and link it up so that I get a final data structure like: node0-node1-node2-node3-node4.
RAW Paste Data