   Serialization and resource management
  Well, at the moment I'm struggling at find the proper solution to the problem I have at my hands.FactsI have Resource Managers for Materials, Textures, Sprites and other resources. Serialization is Boost.ProblemResource managers are acting as singletons and as factories providing resources by request and keeping track of each and every resource allocated. I handle out const pointers to the resources (Materials, Textures) to ensure their values aren't changed. The problem I face at the moment is within the serialization. For example, I have a structure that keeps pointers to resources, and it wants to serialize itself. Now, when I do that, how do I serialize the resource pointers? I want to serialize the resources that the resource managers hold ONLY, but then how do I re-acquire the resources for the structure? By name, handle, ID?An example would be:struct tModel{ITexture *pTexture;IMaterial *pMaterial;IVertexBuffer *pVB;}When I want to serialize tModel, what and how do I do it? I do not want to serialize the contents of the pointers (e.g the actual data for Material and Texture), but I want later to retrieve them from the resource manager. What do I do?Possible SolutionI heard about people using Resource Handles or GUIDs for each and every resource. Boost uses auto-incremented ID to identify each class in the archive.But I need each class be unique for ANY archive. One solution is to do MD5 on class name or use RTTI, which I want to avoid to not be too dependant.Also, the pointers should point to the material/texture/resource with the same content, so how would I do that?So, what do you people may suggest for me?Thanks![Edited by - Daniel Protopopov on June 18, 2006 8:53:10 PM]