ptr_map and property investigation

Published April 19, 2010
Advertisement
Citizen stuff
Smart pointer discussion continued in this entry.

Took a little time to replace the map collection of components in ComponentManagerBase with a boost::ptr_map.

Not much to say about it really since it worked right out of the box with some minor tweaking. I had to replace an array access operator call with a method call, but that's about it.

I have been working a lot in C# recently so I'm getting more and more used to the convenience of having garbage collection on objects. And boost can really make my C++ life easier here.

Right now I'm looking into different uses of boost::scoped_ptr/shared_ptr and if possible to use boost::unordered_map with a ptr_map_adapter.

I have also been investigating if a property pattern approach to storing data on entities is the next step for the engine. So far I've found several good examples out there, as well as this thorough article by Steve Yegge. He discusses the usage of the pattern in general and also implementation and performance considerations in a language-independent context. Very well worth read.

EDIT:
I should mention that the above article was suggested by Trefall in an earlier forum post. His engine is also one of those I've looked at. *Tippin' the hat* [smile]
0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement