You could use a map data structure, with the key being name of the class, and the value being a factory class for creating the object, or a pointer to a function which when run, will return the object. However, you may need to cast the constructed object to your desired type.
Example (apologies for my rusty C++ code):
First, we have an interface for a factory class
class IObjectFactory
{
public:
virtual ~IObjectFactory() {}
virtual void* Create() = 0;
};
Then, a concrete implementation. I'll just do inline.
class ConcreteObjectFactory : public IObjectFactory
{
public:
void* Create() { return new ConcreteObject(); }
};
Now for the map.
using namespace std;
map<string, shared_ptr<IObjectFactory> > classMap;
// register the type
classMap["concreteObject"].reset( new ConcreteObjectFactory() );
// using it, albeit you take all kinds of risks if the string is not found
// or points to the wrong type.
ConcreteObject* o =
static_cast<ConcreteObject *>( classMap["concreteObject"]->Create() );
There are many ways to improve this answer. For those interested, I'll suggest checking out the chapter on RTTI in "C++ for Games Programmers"