dartsim/dart — pull request #277 by mxgrey (2014-11-25 21:07:19+00:00)
Title: NameManager & const-correctness

This commit contains a couple somewhat unrelated changes:

A NameManager class was created which has the ability to organize names of objects in a list and to generate new unique names if the user attempts to add an object with a name that is already being used.

The NameManager is being utilized by the World class to organize its Skeletons, and it's being used by the Skeleton class to organize its BodyNodes, SoftBodyNodes, Joints, and Markers.

This commit also contains const-correctness changes where accessor functions have been overloaded to offer a const version and a non-const version.

One final change was to create some consistency with out-of-bounds accessing behavior. Specifically, if the user requests an object from an index which is out-of-bounds, they will get back a NULL (which should probably be changed to "nullptr" in C++11 compatible versions of DART). This behavior already existed for many accessor functions, like Skeleton::getBodyNode(size_t), but it is now the standard for all other accessors, for example BodyNode::getCollisionShape(int).