   name generation
  In Ogre I have a class with an entity inside of it. The entity is created in the class constructor like this...Ogre::Entity* Mass = mSceneMgr->createEntity("Sphere", "lightsphere.mesh");    SphereNode->attachObject(Mass);    Mass->setMaterialName("Template/Red50");unfortunately each entity in ogre needs to have a unique name so if I decide to create two objects from the class the program won't work because I'll have two entities named Sphere. How would I autogenerate new names for each entity without having to write code for every new one?   
  This is how I do it ...#include <string>std::map<std::string, int> uniqueNames;std::string getNewUniqueName(const std::string &_name){if (uniqueNames.find(_name) == uniqueNames.end())uniqueNames[_name] = 0;else++uniqueNames[_name];std::ostringstream name;name << _name << "_" << (uniqueNames[_name] < 100 ? "0" : "") << (uniqueNames[_name] < 10 ? "0" : "") << uniqueNames[_name];return name.str();}