
Michael Fawcett <michael.fawcett <at> gmail.com> writes:
On Feb 4, 2008 12:16 PM, Joaquín Mª López Muñoz <joaquin <at> tid.es> wrote:
Good to know there's a potential for the keyed variant. Would you support then the provision of regular flyweight and also keyed_flyweight as exposed in my prior post?
I support the notion of being able to lookup existing instances by key. However you implement it, I hope it will have an elegant syntax, and an extremely efficient implementation. Remember that this pattern is used often in games and 3D graphics, where extra copies are not an option, regardless of how pretty it makes the code look.
Besides regular flyweight and keyed_flyweight, there's a third potential variant, namely tha in which the flyweight is keyed but the key is not stored separately and can be obtained from T. I'd like to ask you: in your particular use cases, do your mesh classes store (apart from their data) the name of the file the data was brought from, i.e. can you obtain K from T? I wonder whether this third variant is worth implementing after all, given ther difficulties STL containers have at comparing elements with external keys.
I intended on doing a review but regrettably don't have time to review this library. Good luck! Your libraries are high quality and I enjoy using them, so I hope Flyweight gets accepted.
Thanks for your compliments. The review has brought forward a good number of issues. Regardless of what the review outcome is, I'll have to rethink much of what I've written. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo